Creating a new sales order
POSThttps://ecc123456789012345.servicebus.windows.net/MyEbms/ABC/OData/ARINV
{
"ID": "DOEJOH",
"INV_DATE": "01/15/2020",
"SHIP_DATE": "01/21/2020",
"DESCR": "Misc groceries",
"MEMO": "multi – line memo \r\nSo much can be written here and can be printed at the bottom of the invoice",
"Details":
[
[
"M_QUAN_VIS": "2",
"M_SHIP_VIS": "1",
"INVEN": "STRAWBER",
"DESCR": "[Overwrite the EBMS description if you wish with this multi-line memo]",
"UNIT":"14.99",
"UNIT_MEAS":"Box"
},
{
"INVEN": "SUGARWH",
"M_QUAN_VIS": "1",
"M_SHIP_VIS": "1"
},
],
"Payments":
[
{
"AMOUNT":"7.32",
"DATE":"01/15/2020",
"CHECK_NO":"CASH",
"TYPE":"Cash",
"CASH_ACNT":"01000-000"
}
],
"PROCESS":"Process"
}
Creating a new sales order with credit card payment
POSThttps://ecc123456789012345.servicebus.windows.net/MyEbms/ABC/OData/ARINV
{
"ID": "DOEJOH",
"INV_DATE": "01/15/2020",
"SHIP_DATE": "01/21/2020",
"DESCR": "Misc groceries",
"MEMO": "multi – line memo \r\nSo much can be written here and can be printed at the bottom of the invoice",
"Details":
[
{
"M_QUAN_VIS": "2",
"M_SHIP_VIS": "1",
"INVEN": "STRAWBER",
"UNIT":"14.99",
"UNIT_MEAS":"Box"
},
{
"M_QUAN_VIS": "1",
"M_SHIP_VIS": "1",
"INVEN": "SUGARWH"
},
],
"ShippingAmount": 23.54,
"Payments":
[
{
"TYPE": "Credit",
"CC_TYPE": "MC",
"CC_4DIGIT": "1234",
"ACTION": "XX7",
"AMOUNT":"7.32",
"CASH_ACNT":"01000-000",
"DATE":"01/15/2020"
}
],
"PROCESS":"Process"
}
Editing sales order details
In this example, we modify one item, remove one item, and add one new item.
PATCHhttps://ecc123456789012345.servicebus.windows.net/MyEbms/ABC/OData/ARINV('2SQIJ0T7679LEIG0')
{
"Details@delta": [
{
"@id":"39D80NN66P729HA1",
"M_QUAN_VIS":10
},
{
"@id":"V9D80NN66P729HA1",
"@removed":true
},
{
"INVEN":"LHAM",
"M_QUAN_VIS":10
}
]
}
Voiding a payment
Payments can be voided by setting ACTION to XX4, note that you cannot remove payments, only void them.
PATCHhttps://ecc123456789012345.servicebus.windows.net/MyEbms/ABC/OData/ARINV('2SQIJ0T7679LEIG0')
{
"Payments@delta": [
{
"@id":"K908NQRVPDNCQ000",
"ACTION":"XX4"
}
]
}
Creating a new sales order with manual taxes
POSThttps://ecc123456789012345.servicebus.windows.net/MyEbms/ABC/OData/ARINV
{
"ID": "DOEJOH",
"MAN_TAX": true,
"Details":
[
{
"M_QUAN_VIS": "1",
"M_SHIP_VIS": "1",
"INVEN": "SUGARWH"
},
],
"ARINVTAXes":
[
{
"TAX_ID": "PA",
"SO_TAX_AMT": -4.23,
"SO_TAXABLE": -70.50,
"SO_TXBLQTY": 0.00,
"TAX_AMT": -4.23,
"TAXABLEAMT": -70.50,
"TAXABLEQTY": 0.00
}
]
}
Assigning Terms or Discounts
PATCHhttps://ecc123456789012345.servicebus.windows.net/MyEbms/ABC/OData/ARINV('10000')
Setting the Discount or Due fields on Sales Orders is a little tricky because there are two values that need to be set. The first is an ID, and the second is what is to be displayed. Configure a sales order to what is desired and then using Postman GET the sales order information. The values it pulls are the values that should be written with the POST or PATCH.
It is also important that the ID be first in the JSON body that is being sent to EBMS through the API.
For example:
{
"IDDISCOUNT": "1DSCOUNT",
"DISCOUN": "5 % paid in 10 days"
}
or in the case of (None) only the ID needs to be sent because no specific values such as 5% or 10 days are needed.
{
"IDDISCOUNT": "DNONE"
}