xero-api Not able to create bank transaction. Error with the account code - xero-api

We are trying to create a bank transaction through the Xero API:
Here is the curl statement:
curl --location --request POST 'https://api.xero.com/api.xro/2.0/BankTransactions' \
--header 'Authorization: Bearer ' \
--header 'Xero-Tenant-Id: ' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Cookie: ' \
--data-raw '{
"bankTransactions":[
{
"type":"RECEIVE",
"contact":{
"contactID":"1db8660c-387a-45e9-943e-269a0fa9f6b39"
},
"lineItems":[
{
"description":"Foobar",
"TaxType":"NONE",
"quantity":1.0,
"unitAmount":20.0,
"accountCode":"4567"
}
],
"bankAccount":{
"code":"4567"
}
}
]
}'
We get an account by calling Get Account API and we get a response:
{
"AccountID": "5aef5a57-f9f7-401f9-a627-30708840fb2",
"Code": "4567",
"Name": "Xero Integration",
"Status": "ACTIVE",
"Type": "BANK",
"TaxType": "NONE",
"Class": "ASSET",
"EnablePaymentsToAccount": false,
"ShowInExpenseClaims": false,
"BankAccountNumber": "456789",
"BankAccountType": "BANK",
"CurrencyCode": "USD",
"ReportingCode": "ASS.CUR.CAS.CAS",
"ReportingCodeName": "Cash on hand",
"HasAttachments": false,
"UpdatedDateUTC": "/Date(1670594412700+0000)/",
"AddToWatchlist": false
},
We get the validation error:
"Account code '4567' is not a valid code for this document."
I have checked the account code multiple times and everything looks good to me. Let us know what are we doing wrong.
API call by changing the account code and bank account code

The line item in the bank transaction needs to be a different account, you can't post a line item to a bank account.
Usually, for a receive money transaction, it would be a revenue account eg 200 Sales.

Related

fulfillment shopify api not working 2023-01

I am trying to use this api /fulfillments.json in shopify but i am getting error {"errors":"Not Found"}
my code is here
curl --location --request POST 'https://logixgrid-save.myshopify.com/admin/api/2023-01/fulfillments.json' \
--header 'X-Shopify-Access-Token: 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' \
--header 'Content-Type: application/json' \
--data-raw '{
"fulfillment": {
"message": "The package was shipped this morning.",
"notify_customer": false,
"tracking_info": {
"number": 1562678,
"url": "https://www.my-shipping-company.com",
"company": "my-shipping-company"
},
"line_items_by_fulfillment_order": [
{
"fulfillment_order_id": 5247929286964,
"fulfillment_order_line_items": [
{
"id": 1058737495,
"quantity": 1
}
]
}
]
}
}'
Here is my test store detail you can try this i will delete all these after 2 days
i am getting this response
{"errors":"Not Found"}
Most likely this is because 1058737495 id was took directly from documentation and you don't have such line_item in your order.
EDIT: Your fulfillment order id is wrong. You can get correct one by fetching /admin/api/2023-01/orders/{{ order.id}}/fulfillment_orders.json. This will return array of fulfillment orders. Try one of the ids - it should be working.
curl -X GET "https://redacted.myshopify.com/admin/api/2023-01/orders/5250054553908/fulfillment_orders.json" \
-H "X-Shopify-Access-Token: shpca_redacted"

LinkedIn Article Post API giving 500 Internal Server Error

I'm trying to post an article on LinkedIn via their new Post API.
Below is my curl request. Which follows their documentation.
Problem: Randomly Article Post giving 500 Internal Server Error from LinkedIn
The image is uploaded via the Image API and urn works in an "image" post.
curl --location --request POST 'https://api.linkedin.com/rest/posts' \
--header 'Authorization: Bearer UserAccessToken' \
--header 'X-Restli-Protocol-Version: 2.0.0' \
--header 'LinkedIn-Version: 202208' \
--header 'Content-Type: application/json' \
--data-raw '{
"author": "urn:li:person:ownerid1234",
"commentary": "UnitTest ArticlePost with Latest API",
"visibility": "PUBLIC",
"distribution": {
"feedDistribution": "MAIN_FEED",
"targetEntities": [],
"thirdPartyDistributionChannels": []
},
"content": {
"article": {
"source": "https://shorturl.at/cfhL4",
"title": "Article Post",
"description": "",
"thumbnail": "urn:li:image:C5610AQE5yn7MbvKXow"
}
},
"lifecycleState": "PUBLISHED",
"isReshareDisabledByAuthor": false
}'

How to setup Adyen acquirer account

I have a problem with testing MB WAY for API only payment method on Adyen https://docs.adyen.com/payment-methods/mb-way/api-only
After I send request as described here https://docs.adyen.com/payment-methods/mb-way/api-only#make-payment
curl https://checkout-test.adyen.com/v68/payments \
-H 'x-api-key: YOUR_API_KEY' \
-H 'content-type: application/json' \
-d '{
"merchantAccount": "YourCompanyECOM",
"reference": "My first Adyen test payment",
"amount": {
"value": 1000,
"currency": "EUR"
},
"paymentMethod": {
"type": "scheme",
"encryptedCardNumber": "test_4111111111111111",
"encryptedExpiryMonth": "test_03",
"encryptedExpiryYear": "test_2030",
"encryptedSecurityCode": "test_737"
}
}'
I receive this response
{
"status": 500,
"errorCode": "905_1",
"message": "Could not find an acquirer account for the provided txvariant (mbway), currency (EUR), and action (AUTH).",
"errorType": "configuration",
"pspReference": "GBSGRNJVSBLZNN82"
}
I did not found a way to set up an acquirer account on Adyen dashboard so far. Is that option there, or I need to do something else to make it work?
This kind of error can have as origin one of the following reasons:
The currency is not configured or supported
The minimum amount is set too low
The payment method is not configured on your account
The payment type (shopperInteraction) is not supported.
The full documentation of this error is here

Authorization error in Onfido with same api token

I am using onfido v3.2 and I want to create SDK token. First I had create applicant using sandbox API key.
curl -X POST https://api.eu.onfido.com/v3.2/applicants/ \
-H 'Authorization: Token token=<YOUR_API_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"first_name": "Jane",
"last_name": "Doe"
}'
Then I had use applicant id from above api response for create SDK token and use same API token. https://documentation.onfido.com/#create-applicant
curl -X POST https://api.eu.onfido.com/v3.2/sdk_token \
-H 'Authorization: Token token=<YOUR_API_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"applicant_id": "<APPLICANT_ID>"
}'
I am using same API TOKEN in both api but sdk create api return error.
https://documentation.onfido.com/#generate-sdk-token
{
"error": {
"type": "authorization_error",
"message": "Authorization error: please re-check your credentials",
"fields": {}
}
}
I don't understand what going wrong here? Thank you in advance.

Cannot create new Pipeline using Az DevOps Pipelines API 6.0-preview.1

I'm trying to create new Pipelines using this API endpoint:
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=6.0-preview.1
This is the request I'm using:
curl -X POST \
'https://dev.azure.com/<myorg>/<myproj>/_apis/pipelines?api-version=6.0-preview.1' \
-H 'Authorization: Basic <b64string>' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"configuration":{
"repository": {
"id": "<repo-guid>",
"name": "<repo-name>",
"type": "azureReposGit"
},
"path": "pipeline.yaml",
"type": "yaml"
},
"folder": "\\custompath\\",
"name": "<pipelinename>"
}
I keep getting the same error:
{
"$id": "1",
"innerException": null,
"message": "Value cannot be null.\r\nParameter name: repositoryName",
"typeName": "System.ArgumentNullException, mscorlib",
"typeKey": "ArgumentNullException",
"errorCode": 0,
"eventId": 0
}
It seems an issue with my payload, but documentation isn't very helpful about it
https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-6.0
Current version o nodejs sdk doesn't support the Pipeline API yet. Can anyone help me?
I'm able to reproduce your issue on my side, and have reported this issue at website below:
https://developercommunity.visualstudio.com/content/problem/1101376/create-pipeline-rest-api-does-not-work.html
Product team has provided response that "A fix for this issue has been prepared. It should be released to everyone within the next 3 weeks."