We have been using NetSuite REST API successfully for a while to create Invoices.
Now we added Tax Code requirement and I’m unable to create an Invoice with it.
The following works when used in USA, where we don’t enforce Tax Code.
{
“memo”: “magical land in USA : closing date 5/7/2021 : {{REOS_TX_NUMBER}}”,
“entity”: {
“id”: {{NETSUITE_USA_CUSTOMER}}
},
“department”: {{NETSUITE_DEPARTMENT_ID}},
“location”: {{NETSUITE_TEXAS_LOCATION}},
“externalId”: “{{REOS_TX_NUMBER}}-{{$timestamp}}”,
“ADMIN_TRANSACTION_ID”: “{{REOS_TX_NUMBER}}”,
“ADMIN_TRANSACTION_LINK”: “https://adminlink.com”,
“ADMIN_PROPERTY_ADDRESS”: “magical land in USA”,
“ADMIN_JSON_DATA”: “{ \”sample\”: \”test\” }”,
“item”: {
“items”: [
{
“department”: {{NETSUITE_DEPARTMENT_ID}},
“item”: {
“id”: {{NETSUITE_INVOICE_ITEM_TYPE}}
},
“amount”: {{REOS_TITLE_AMOUNT}}
}
]
}
}
In Canada I tried various permutations trying to follow the REST API documentations and questions by people here, but none seem to work.
{
“memo”: “magical land in USA : closing date 5/7/2021 : {{REOS_TX_NUMBER}}”,
“entity”: {
“id”: {{NETSUITE_CANADIAN_CUSTOMER}}
},
“department”: {{NETSUITE_DEPARTMENT_ID}},
“location”: {{NETSUITE_ALBERTA_LOCATION}},
“externalId”: “{{REOS_TX_NUMBER}}-{{$timestamp}}”,
“ADMIN_TRANSACTION_ID”: “{{REOS_TX_NUMBER}}”,
“ADMIN_TRANSACTION_LINK”: “https://adminlink.com”,
“ADMIN_PROPERTY_ADDRESS”: “magical land in USA”,
“ADMIN_JSON_DATA”: “{ \”sample\”: \”test\” }”,
“item”: {
“items”: [
{
“department”: {{NETSUITE_DEPARTMENT_ID}},
“item”: {
“id”: {{NETSUITE_INVOICE_ITEM_TYPE}},
“taxCode”: {
“id”: {{NETSUITE_ALBERTA_TAX_CODE}}
}
},
“amount”: {{REOS_TITLE_AMOUNT}}
}
]
}
}
I receive the following error:
“type”: “https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1”,
“title”: “Bad Request”,
“status”: 400,
“o:errorDetails”: [
{
“detail”: “Error while accessing a resource. Please enter value(s) for: Tax Code.”,
“o:errorPath”: “item.items[0]”,
“o:errorCode”: “USER_ERROR”
}
]
}
I double checked and the internal-id provided is correct.
I also tried creating an Invoice with Tax-Code via the UI, and fetch it from the API to see the settings used on it, but it doesn’t seem to show them.