The Invoice Managment API empowers retailers to generate invoices for e-commerce orders dispatched outside the API platform. It captures essential data such as customer information, delivery addresses, and order details to enable seamless tracking and efficient returns processing. By utilizing this API, retailers can enhance operational efficiency and improve the customer experience.
Intelligent Invoice Grouping: - Streamline returns management by leveraging the
groupIdfield in the Order Model to intelligently group multiple invoices associated with a single e-commerce order. This feature simplifies the processing of complex orders and improves organizational workflows.Flexible Invoice Management: - Modify invoices effortlessly using the Update Invoice API, enabling seamless updates when item details are unavailable during the initial Create Invoice call.
Efficient Product Returns: - Facilitate a seamless and customer-friendly returns process with real-time tracking and updates. The platform ensures accurate handling of return requests, reducing processing time and enhancing overall customer satisfaction.
Once set up as a user, you can leverage the Invoice Management API to ingest order information for e-commerce orders dispatched outside the API platform. By integrating this functionality, you can intelligently group multiple invoices for streamlined returns management and seamlessly update invoices as new details become available. This ensures accurate tracking and efficient processing.
What information is required to create an invoice?
- groupId: The e-commerce order ID mapped to the invoice for efficient tracking and returns management.
- orderExternalId: The retailer-specific order reference.
- customer object: Includes customer information.
- orderInfo object: Subset of the order data, including deliveryAddress.
- brandExternalId: Identifies the brand associated with the invoice.
- createdDate: The date the original order was created (in int64 format).
- timeZone: Timezone of the order creation date."
- storeExternalId: The ID of the store from which the order was dispatched.
When should I use the Update Invoice API?
The Update Invoice API is used to modify an existing invoice when new details, such as item specifics, become available or corrections are needed. For example, you can update the itemList to include SKU details, dimensions, or images after the initial invoice creation.
What is the role of the customer object in the API?
The customer object provides critical customer details, including delivery address and order information. This data ensures that invoices are correctly associated with the right customer and facilitates efficient returns management.
Can I update the delivery address for an existing invoice?
Yes, the Update Invoice API allows you to modify the deliveryAddress object if changes to the customer's address or return location are required.
Does the API support batch updates for invoices?
Currently, the API supports updating invoices individually using the Update Invoice API. For batch updates, separate calls for each invoice are required.
When the system is unable to respond to a request, be it from a malformed request, an illegal or invalid value, or other issues, the API generates an error response.
Successful response may or may not include warnings.
- Without warnings - Indicates the request has been processed as anticipated.
- With warnings - Indicates the request has been processed with potentially unanticipated results. The warning contains information in the response that should be passed to the end user.
The severity of an error may be transient or hard.
- Transient error - Indicates an error that is temporary in nature. Such errors may be caused by response timeouts due to high server loads or scheduled maintenance in progress. The request may be issued successfully at a later time.
- Hard error - Indicates the request has a problem that the system is not able to resolve. These errors are critical and prevent requests from processing.
POST
| Type | HTTP Code | Severity | Description |
|---|---|---|---|
| UNAUTHORIZED | 401 | Hard | Unauthorized: Invalid or missing authentication token |
| INTERNAL_SERVER_ERROR | 500 | Transient | Internal Server Error: An unexpected error occurred while processing the request |
| INVALID_DATA | 422 | Hard | Invalid data: Invoice already Exists |
| INVALID_DATA | 400 | Hard | Invalid data: Please enter the phone number in E.164 format" or other invalid values in the request |
| GEOCODING_FAILED | 422 | Hard | Geocoding Service for the given address failed. |
| TOO_MANY_REQUESTS | 429 | Transient | Too many requests received per second. |
| UNMAPPED_ERROR | 422 | Transient | Request received unidentifiable error response. |
/invoices/{invoice_id}
PUT
| Type | HTTP Code | Severity | Description |
|---|---|---|---|
| UNAUTHORIZED | 401 | Hard | Unauthorized: Invalid or missing authentication token |
| INTERNAL_SERVER_ERROR | 500 | Transient | Internal Server Error: An unexpected error occurred while processing the request |
| NOT_FOUND | 404 | Hard | Not Found: Invoice not found |
| INVALID_DATA | 400 | Hard | Invalid data: Please enter the phone number in E.164 format" or other invalid values in the request |
| GEOCODING_FAILED | 422 | Hard | Geocoding Service for the given address failed. |
| TOO_MANY_REQUESTS | 429 | Transient | Too many requests received per second. |
| UNMAPPED_ERROR | 422 | Transient | Request received unidentifiable error response. |
Create Invoice
Use this endpoint to create an Invoice for any e-commerce order. This is essential for enabling returns management through Delivery Solutions when the order was not initially dispatched using Delivery Solutions' platform.
Request Body schema: application/json
Request was successful
Bad Request
Unauthorized
Processing failed as request contains invalid data
Internal server error
- Payload
- curl
- Node.js
- JavaScript
- PHP
- Python
- C#
- Java
{- "itemList": [
- {
- "sku": "sku89",
- "quantity": 5,
- "size": {
- "length": 2,
- "width": 2,
- "height": 2,
- "unit": "in"
}, - "weight": {
- "value": 7,
- "unit": "lb"
}, - "price": 200,
- "salePrice": 100,
- "title": "demo",
- "description": "demodesc"
}, - {
- "sku": "sku90",
- "quantity": 1,
- "size": {
- "length": 3,
- "width": 3,
- "height": 3,
- "unit": "in"
}, - "weight": {
- "value": 7,
- "unit": "lb"
}, - "price": 300,
- "salePrice": 250,
- "title": "dmeotitle",
- "description": "demodescription"
}
], - "groupId": "GAKunalA0089",
- "orderExternalId": "AKunalA0089",
- "customer": {
- "name": "Nupur",
- "userExternalId": "nupur123",
- "phone": "+14343424224",
- "email": "nupur@deliverysolutions.co"
}, - "orderInfo": {
- "type": "delivery",
- "amount": 30,
- "orderValue": 100,
- "tips": 10,
- "orderAttributes": {
- "key": "value"
}, - "status": "ORDER_DISPATCHED"
}, - "deliveryAddress": {
- "street1": "508 S Vine St",
- "street2": "",
- "city": "Atlanta",
- "state": "IL",
- "postalCode": "61723",
- "countryCode": "US",
- "latitude": 40.2587474,
- "longitude": -89.2294067
}, - "brandExternalId": "kunal",
- "timeZone": "America/Los_Angeles",
- "createdDate": 1707356123000
}- 201
- 400
- 401
- 422
- 500
{- "id": "656eb9dd180d13598624a50b",
- "groupId": "GAKunalA0089",
- "tenantId": "kunal",
- "orderExternalId": "AKunalA0089",
- "deliveryAddress": {
- "street1": "508 S Vine St",
- "street2": "",
- "city": "Atlanta",
- "state": "IL",
- "postalCode": "61723",
- "countryCode": "US",
- "latitude": 40.2587474,
- "longitude": -89.2294067
}, - "customer": {
- "email": "nupur@deliverysolutions.co",
- "phone": "+14343424224",
- "name": "Nupur",
- "userExternalId": "nupur123"
}, - "brandExternalId": "kunal",
- "locationExternalId": "location001",
- "timeZone": "America/Los_Angeles",
- "createdAt": "2024-07-23T10:34:01.695Z",
- "createdDate": 1709231400000,
- "itemList": [
- {
- "sku": "sku89",
- "quantity": 5,
- "size": {
- "length": 2,
- "width": 2,
- "height": 2,
- "unit": "in"
}, - "weight": {
- "value": 7,
- "unit": "lb"
}, - "price": 200,
- "salePrice": 100,
- "title": "demo",
- "description": "demodesc",
- "tags": [ ]
}, - {
- "sku": "sku90",
- "quantity": 1,
- "size": {
- "length": 3,
- "width": 3,
- "height": 3,
- "unit": "in"
}, - "weight": {
- "value": 7,
- "unit": "lb"
}, - "price": 300,
- "salePrice": 250,
- "title": "dmeotitle",
- "description": "demodescription",
- "tags": [ ]
}
], - "orderInfo": {
- "type": "delivery",
- "amount": 30,
- "orderValue": 100,
- "tips": 10,
- "orderAttributes": {
- "key": "value"
}, - "status": "ORDER_DISPATCHED"
},
}Update Invoice
Use this API to update an Invoice by specifying the Invoice ID.
path Parameters
Request Body schema: application/json
Array of objects (Item) Array of Items for which Invoice has been created | |||||||||||||||||||||||||||
Array
| |||||||||||||||||||||||||||
| groupId | string <= 100 characters E-commerce order id should be mapped to groupId field so that tracking and returns can be utilized efficiently. | ||||||||||||||||||||||||||
| orderExternalId | string <= 100 characters Order Id by which retailer can refer to the Invoice's order. | ||||||||||||||||||||||||||
object (schemas-Customer) | |||||||||||||||||||||||||||
object (OrderInfo) Subset of Order Object to control the rules. | |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
object (components-schemas-Address) Address of the location | |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
| brandExternalId | string <= 100 characters Brand External Id for which the Invoice is being created. | ||||||||||||||||||||||||||
| createdDate | integer <int64> The date at which the invoice was created. | ||||||||||||||||||||||||||
| timeZone | string The timezone in which the invoice was created. | ||||||||||||||||||||||||||
| locationExternalId | string location External Id from where the Order was dispatched. | ||||||||||||||||||||||||||
Request was successful
Bad Request
Unauthorized
Resource was not found
Bad Request
Internal server error
- Payload
- curl
- Node.js
- JavaScript
- PHP
- Python
- C#
- Java
{- "itemList": [
- {
- "sku": "sku89",
- "quantity": 5,
- "size": {
- "length": 2,
- "width": 2,
- "height": 2,
- "unit": "in"
}, - "weight": {
- "value": 7,
- "unit": "lb"
}, - "price": 200,
- "salePrice": 100,
- "title": "demo",
- "description": "demodesc"
}, - {
- "sku": "sku90",
- "quantity": 1,
- "size": {
- "length": 3,
- "width": 3,
- "height": 3,
- "unit": "in"
}, - "weight": {
- "value": 7,
- "unit": "lb"
}, - "price": 300,
- "salePrice": 250,
- "title": "dmeotitle",
- "description": "demodescription"
}
], - "groupId": "GAKunalA0089",
- "orderExternalId": "AKunalA0089",
- "customer": {
- "name": "Nupur",
- "userExternalId": "nupur123",
- "phone": "+14343424224",
- "email": "nupur@deliverysolutions.co"
}, - "orderInfo": {
- "type": "delivery",
- "amount": 30,
- "orderValue": 100,
- "tips": 10,
- "orderAttributes": {
- "key": "value"
}, - "status": "ORDER_DISPATCHED"
}, - "deliveryAddress": {
- "street1": "508 S Vine St",
- "street2": "",
- "city": "Atlanta",
- "state": "IL",
- "postalCode": "61723",
- "countryCode": "US",
- "latitude": 40.2587474,
- "longitude": -89.2294067
}, - "brandExternalId": "kunal",
- "timeZone": "America/Los_Angeles",
- "createdDate": 1707356123000
}- 200
- 400
- 401
- 404
- 422
- 500
{- "groupId": "GAKunalA0089",
- "tenantId": "kunal",
- "orderExternalId": "AKunalA0089",
- "deliveryAddress": {
- "street1": "508 S Vine St",
- "street2": "",
- "city": "Atlanta",
- "state": "IL",
- "postalCode": "61723",
- "countryCode": "US",
- "latitude": 40.2587474,
- "longitude": -89.2294067
}, - "customer": {
- "email": "nupur@deliverysolutions.co",
- "phone": "+14343424224",
- "name": "Nupur",
- "userExternalId": "nupur123"
}, - "brandExternalId": "kunal",
- "locationExternalId": "location001",
- "timeZone": "America/Los_Angeles",
- "createdAt": "2024-07-23T10:34:01.695Z",
- "createdDate": 1709231400000,
- "itemList": [
- {
- "sku": "sku89",
- "quantity": 5,
- "size": {
- "length": 2,
- "width": 2,
- "height": 2,
- "unit": "in"
}, - "weight": {
- "value": 2,
- "unit": "lb"
}, - "price": 200,
- "salePrice": 100,
- "title": "demo",
- "description": "demodesc",
- "tags": [ ]
}, - {
- "sku": "sku90",
- "quantity": 1,
- "size": {
- "length": 3,
- "width": 3,
- "height": 3,
- "unit": "in"
}, - "weight": {
- "value": 7,
- "unit": "lb"
}, - "price": 300,
- "salePrice": 250,
- "title": "dmeotitle",
- "description": "demodescription",
- "tags": [ ]
}
], - "orderInfo": {
- "type": "delivery",
- "amount": 30,
- "orderValue": 100,
- "tips": 10,
- "orderAttributes": {
- "key": "value"
}, - "status": "ORDER_DISPATCHED"
}, - "id": "63ea84197afb7569bf4bc6eb"
}