The Sales Order API enables users to retrieve detailed sales order information, including shipment and payment status, shipping and billing addresses, as well as relevant delivery order and invoice numbers.
A. Endpoints
GET: {APIhost}/salesorder
Headers: x-emerge-api-key: [Your API Key]
C# example
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("https://yourapi.com/");
client.DefaultRequestHeaders.Add("x-emerge-api-key", "YOUR_API_KEY");
// Get or Post Request
var response = client.GetAsync("ProductInventory").Result;
}
Java example
import requests
headers = {
'x-emerge-api-key': 'YOUR_API_KEY'
}
response = requests.get('https://yourapi.com/ProductInventory', headers=headers)
Java example
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create("http://exampleURL.com/aFile"));
requestBuilder.header("xxxx","yyyyy");
HttpRequest request = requestBuilder.build();
Object data example
[
{
"salesOrderId": 65025,
"salesOrderNumber": "SO-USA-24091410999",
"customerName": "John Doe",
"shipmentStatus": "Delivered",
"paymentStatus": "PartiallyPaid",
"shippingAddress": {
"shippingAddress": "1234 Elm Street Suite 100 New York, NY 10001",
"shippingCity": "New York",
"shippingPostalCode": "10001",
"shippingCountry": "United States",
"shippingCountryCode": "US",
"shippingState": "New York",
"shippingPhone": "+1-212-555-1234",
"shippingContact": [
{
"contactName": "Jane Doe",
"phoneNumber": "+1-212-555-5678"
}
]
},
"billingAddress": {
"billingName": "ACME Corp",
"billingAddress": "4321 Oak Avenue, Los Angeles, CA 90001",
"billingCity": "Los Angeles",
"billingPostalCode": "90001",
"billingCountry": "United States",
"billingCountryCode": "US",
"billingState": "California",
"billingPhone": "+1-310-555-7890",
"billingEmail": "billing@acmecorp.com",
"billingContact": [
{
"contactName": "Mark Smith",
"phoneNumber": "+1-310-555-6789"
}
]
},
"deliveryOrderNumber": [
{
"deliveryOrderNumber": "DO-USA-240914402",
"customStatusValue": "In transit"
}
],
"invoiceNumber": [
{
"invoiceNumber": "INV-USA-240914197",
"displayNumber": "INV-0001"
},
{
"invoiceNumber": "INV-USA-240914198",
"displayNumber": "INV-0002"
}
],
"dateCreated": "2024-09-14T09:36:01.953"
}
]
B. Params
1. Limit
Data type: Int
Description: The maximum number of items returned per page, with a default value of 10. Maximum = 100
2. Page
Data type: Int
Description: The current page number to retrieve
3. from_date_created
Data type: Nullable Datetime
Description: An optional filter to return sales order created after this date.
4. to_date_created
Data type: Nullable Datetime
Description: An optional filter to return sales order created before this date.
C. Searching criterias
1. Query
Data type: String
Description: Searching product Sales Order number or Customer name
2. IDs
Data type: Int[]
Description: An array of integer IDs that represents a list of specific sales order ID to be included in the search.
3. invoice_number
Data type: String
Description: Searching Invoice Number related to the sales order
4. displayed_invoice_number
Data type: String
Description: Searching Displayed Invoice Number related to the sales order
D. Attributes
1. salesOrderID
Data type: String
Description: Unique identifier for the sales order. This property is always present
2. salesOrderNumber
Data type: string
Description: Name of the sales order. For example: SO0001
3. customerName
Data type: string
Description: This sales order is for which customer.
4. shipmentStatus
Data type: string
Description: There're 5 shipment statuses: In progress, Partially delivered, Deliverd, Partially issued, Issued
5. PaymentStatus
Data type: string
Description:There're 5 payment statuses: In progress, Partially paid, Paid, Partially issued, Issued
6. customerContact
ContactName
Data type: String
Description: The name of the customer contact person.
PhoneNumber
Data type: String
Description: The phone number of the customer contact person.
7. shippingAddress
Data type: array
Description: Shipping address of the sales order. List of addressm city, postalcode, country, country code, state and contacts (name & phone number)
8. billingAddress
Data type: array
Description: Billing address of the sales order. List of addressm city, postalcode, country, country code, state and contacts (name & phone number)
9. deliveryOrderNumber
Data type: array
Description:
deliveryOrderNumber
(string): Delivery order number. For example: DO001customStatusValue
(string): A customizable status value for the delivery order. This field may be left empty if no custom status is provided.
10. invoiceNumber
Data type: array
Description:
invoiceNumber
(string): The invoice number used internally by the system. For example: INV0001displayNumber
(string): The external or customer-facing invoice number for display purposes, which may differ from the system invoice number.totalAmount
(decimal): Total amount of the customer invoice
11. dateCreated
Data type: Datetime
Description: The date and time of creation, formatted according to the ISO 8601 standard. Format:
YYYY-MM-DDTHH:MM:SS
(Example:2024-09-14T09:36:01
)