Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Overview
This document has details of all the API integrated with MAGENTO 2.4 and above.
API Documentation
Understanding of APIs
Given the nature of software development, reasonable minor modifications are expected in future. Here are the clarifications on processes and APIs.
Proxy Flow | Channel API's | Channel API endpoints |
Get List of Orders | Lists orders that match specified search criteria.(based on filters for status and created_at time) | /rest/default/V1/orders |
Get an Order | Get order details for an order id | /rest/default/V1/orders/{orderId} |
Get Order status | Get status of a specific order | /rest/default/V1/orders/{id}/statuses |
Get Canceled orders List | Lists orders that match specified search criteria.(based on filters for status and updated_at time | /rest/default/V1/orders |
Order Acknowledgment | Change order status to processing as an acknowledgement of order received | rest/default/V1/orders/orders/{orderId}/comments |
Cancel order | Cancels a specified order. | /rest/default/V1/orders/{orderId}/cancel |
Create Shipment | Performs persist operations for a specified shipment. | /rest/default/V1/shipment/ |
Create Invoice | Create invoice on magento | /rest/default/V1/order/{orderId}/invoice |
Get Invoice | Get invoice details from magento based on the filter of order id | /rest/default/V1/invoices |
Get Shipment | Get shipping label | /rest/default/V1/shipment/{shipmentId} |
Create Manifest | No call to channel | null |
Get Manifest | No call to channel | null |
Update Inventory | Update the inventory of a specific sku | /rest/default/V1/products/{productSku}/stockItems/{itemId} |
Credential Api | Get access token | /rest/V1/integration/admin/token |
Return Orders | No call to channel(used to create a return order corresponding to a forward order in Increff Omni) | null |
Handover Orders | The order is handed over to the delivery partner marking the order complete at magento panel | /rest/default/V1/order/{orderId}/ship |
Fetch Orders
Get Orders: GET | /rest/default/V1/orders
Lists orders that match specified search criteria. This call returns an array of objects.
...
The items to be synced should have the product_type as simple.
The field method under payment should be cashondelivery for COD orders.
The increament_id will be used as the parent order id(will be displayed on invoice and shipping label) whereas, the internal order id(used to fetch order) will be used as the channel order id.
Request
QueryParams
Name | Type | Mandatory | Comments |
|
|
|
|
|
|
|
|
|
|
|
|
Response
Code Block | ||
---|---|---|
| ||
{ "items": [ { "base_currency_code": "INR", "base_discount_amount": 10.0, "base_shipping_amount": 50.0, "created_at": "2022-02-17 07:24:49", "discount_amount": 50, "entity_id": 11254, "grand_total": 25980.0, "discount_tax_compensation_amount": 10, "increment_id": "M000013856", "order_currency_code": "INR", "shipping_amount": 60, "status": "string", "items": [ { "base_original_price": 0, "base_price": 0, "base_price_incl_tax": 0, "base_row_total": 0, "base_row_total_incl_tax": 0, "base_tax_amount": 0, "discount_amount": 0, "item_id": 0, "name": "string", "order_id": 0, "original_price": 0, "price": 0, "price_incl_tax": 0, "product_type": "simple", "qty_canceled": 0, "qty_ordered": 0, "qty_refunded": 0, "row_total_incl_tax": 0, "sku": "string", "tax_amount": 0, "parent_item": {}, "product_option": { "extension_attributes": { "giftcard_item_option": {} } } } ], "billing_address": { "city": "string", "country_id": "string", "email": "string", "firstname": "string", "lastname": "string", "middlename": "string", "postcode": "string", "region": "string", "street": [ "string" ], "telephone": "string" }, "payment": { "method": "string" }, "extension_attributes": { "shipping_assignments": [ { "shipping": { "address": { "city": "string", "country_id": "string", "email": "string", "firstname": "string", "lastname": "string", "middlename": "string", "postcode": "string", "region": "string", "street": [ "string" ], "telephone": "string" } } } ], "cash_on_delivery_fee": 50.0, "base_cash_on_delivery_fee": 60.0, "amstorecredit_base_amount": 100.0, "amstorecredit_amount": 120.0, "applied_taxes": [ { "code": "GST-18", "title": "GST-18", "percent": 18, "amount": 3963.05, "base_amount": 3963.05 } ], "item_applied_taxes": [ { "type": "product", "item_id": 11593, "applied_taxes": [ { "code": "GST-18", "title": "GST-18", "percent": 18, "amount": 3963.05, "base_amount": 3963.05 } ] } ] } } ] } |
HttpStatus : 200
Get Order Status:
GET | /rest/default/V1/orders/{id}/statuses
Gets the status for a specified order.
Request
Path parameter
Name | Type | Mandatory | Comments |
|
|
|
|
Response
“processing”
HttpStatus : 200
Order Acknowledgment
POST | rest/default/V1/orders/orders/{id}/comments
This call is made to acknowledge that the order is received in our system and to make the status of order processing in the magento panel(if not already in processing).
Request
Path parameter
Name | Type | Mandatory | Comments |
|
|
|
|
Response
True
HttpStatus : 200
Get Canceled Orders
GET | /rest/default/V1/orders
Lists orders that match specified search criteria. This call returns an array of objects.
...
The items to be synced should have the product_type as simple.
Request
QueryParams
Name | Type | Mandatory | Comments |
|
|
|
|
|
|
|
|
|
|
|
|
Response
HttpStatus : 200
Cancel Order
POST | /rest/default/V1/orders/{id}/cancel
Cancels a specified order based on the order id of the order.
Request
Path parameter
Name | Type | Mandatory | Comments |
|
|
|
|
Response
True
HttpStatus : 200
Shipment
Create Invoice
POST | /rest/default/V1/order/{orderId}/invoice
This API call generates an invoice at magento for a specific order.
Note: This is not a mandatory call. For some clients the invoice generation on magento is done as soon as the order moves to processing status, so in cases in which such a job does not run at client end, this call generates invoice at magento, as without invoice generation, shipment creation cannot be done for magento.
Request
Path parameter
Name | Type | Mandatory | Comments |
|
|
|
|
Response
HttpStatus : 200
Get Invoice
GET | /rest/default/V1/invoices
This API call is used to get the invoice details for the specified order based on search criteria.
Request
QueryParams
Name | Type | Mandatory | Comments |
|
|
|
|
|
|
|
|
|
|
|
|
Response
Code Block | ||
---|---|---|
| ||
{ "items": [ { "base_currency_code": "INR", "base_discount_amount": 0, "base_shipping_amount": 0, "billing_address_id": 70058, "created_at": "2022-07-29 09:00:05", "discount_amount": 0, "entity_id": 1, "grand_total": 100, "discount_tax_compensation_amount": 0, "increment_id": "M000033958", "order_id": 1, "shipping_address_id": 1, "shipping_amount": 0, "store_to_base_rate": 0, "store_to_order_rate": 0, "subtotal": 100.0, "subtotal_incl_tax": 100, "tax_amount": 73.93, "total_qty": 1, "transaction_id": "pay_Jz7LmmJjjfMjPk", "updated_at": "2022-07-29 09:00:05", "items": [ { "base_discount_tax_compensation_amount": 0, "base_price": 690, "base_price_incl_tax": 690, "base_row_total": 616.07, "base_row_total_incl_tax": 690, "base_tax_amount": 73.93, "description": "", "entity_id": 167859, "discount_tax_compensation_amount": 0, "name": "Pack of 1 dress - off white", "parent_id": 33958, "price": 616.07, "price_incl_tax": 690, "product_id": 28618, "row_total": 616.07, "row_total_incl_tax": 690, "sku": "8907095618689", "tax_amount": 73.93, "order_item_id": 172596, "qty": 1 } ], "comments": [] } ], "search_criteria": { "filter_groups": [ { "filters": [ { "field": "order_id", "value": "1", "condition_type": "eq" } ] } ] }, "total_count": 1 } |
HttpStatus : 200
Create Shipment
POST | /rest/default/V1/shipment/
Performs persist operation for a specified shipment
Request
Code Block | ||
---|---|---|
| ||
{ "entity": { "created_at": "2022-11-30 12:28:00", "order_id": 46773, "items": [ { "sku": "8907095853998", "order_item_id": 235211, "qty": 2 } ], "tracks": [ { "order_id": 46773, "created_at": "2022-11-30 12:28:00", "parent_id": 46773, "weight": 1, "qty": 1, "description": "", "track_number": "11704910415542", "title": "Delhivery", "carrier_code": "11704910415542" } ], "comments": [ { "is_customer_notified": 0, "parent_id": 0, "comment": "comment", "is_visible_on_front": 0, "created_at": "2022-11-30 12:28:00", } ] } } |
...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Response
Code Block | ||
---|---|---|
| ||
{ "entity_id": 0, "increment_id": "string", "order_id": 0 } |
HttpStatus : 200
Get Shipment
GET | /rest/default/V1/shipment/{id}
Loads a specified shipment.
Request
Path parameter
Name | Type | Mandatory | Comments |
|
|
|
|
Response
Code Block | ||
---|---|---|
| ||
{ "entity_id": 0, "increment_id": "string", "order_id": 0 } |
HttpStatus : 200
Update Inventory
PUT | /rest/default/V1/products/{productSku}/stockItems/{itemId}
This API will push the inventory count to the channel.
Request
Path parameter
Name | Type | Mandatory | Comments |
|
|
|
|
|
|
|
|
Request Body
Name | Type | Mandatory | Comments |
|
|
|
|
|
|
|
|
|
|
|
|
Response
32380(entity id)
HttpStatus : 200
Handover
POST | /rest/default/V1/order/{orderId}/ship
This API marks the order complete in magento.
Request
Path parameter
Name | Type | Mandatory | Comments |
|
|
|
|
Response
2568 ( Handover ID)
HttpStatus : 200
Create Return Order
Inbound | POST | /return/return-orders
Summary
This API is used to create B2C return orders in Omni.
Description
This API is used to create B2C return orders in Omni. One order item represents only one quantity of an SKU. If there are multiple quantities of the same SKU then multiple order items should be created.
Request
Code Block | ||
---|---|---|
| ||
{ "forwardOrderCode": "108", "returnOrderCode": "100078", "locationCode": "Wid234", "returnOrderTime": "2020-10-16T20:22:28.000+05:30", "returnOrderStatus" : "RETURN_CREATED", "expectedDate" : "2020-10-16T20:22:28.000+05:30", "orderItems": [ { "itemCode": "I10098_1", "reason": "Different Size", "enableDoorStepQc": "true", "channelSkuCode": "10007345", "name" : "Name", "brand": "Brand1", "color": "Black", "category": "Footwear", "subCategory": "Shoe", "serialNumber": "100", "price" : 100.00, "finalAmountPaid" : 100.00, "imageUrl": "xyz", "storeCreditsUsed": 0.0, "subTaxItemData": [ { "type": "type", "rate": 10, "taxPerUnit": 10, "taxTotal": 10 } ] }, { "itemCode": "I10098_2", "reason": "Different Size", "enableDoorStepQc": "true", "channelSkuCode": "10007345", "name" : "Name", "brand": "Brand1", "color": "Black", "category": "Footwear", "subCategory": "Shoe", "serialNumber": "100", "price" : 100.00, "finalAmountPaid" : 100.00, "imageUrl": "xyz", "storeCreditsUsed": 0.0, "subTaxItemData": [ { "type": "type", "rate": 10, "taxPerUnit": 10, "taxTotal": 10 } ] } ], "orderType": "CUSTOMER_RETURN", "awbNumber": "HYN402", "transporter": "transporter", "currencyCode": "INR", "regionType": "INDIAN", "returnReason": "damaged product", "sellerGstin": "29AADCP7081J1ZY", "consigneeGstin": "29AAHCT2518N1ZW", "shipmentDimension": { "breadth": 10, "height": 10, "length": 10, "weight": 1 }, "dropAddress": { "name": "customerName", "line1": "address line 1", "line2": "address line 2", "line3": "address line 3", "city": "Bengaluru", "state": "Karnataka", "zip": "560076", "country": "INDIA", "email": "email.com", "phone": "9999999999" }, "pickupAddress": { "name": "customerName", "line1": "address line 1", "line2": "address line 2", "line3": "address line 3", "city": "Bengaluru", "state": "Karnataka", "zip": "560076", "country": "INDIA", "email": "email.com", "phone": "9999999999" }, "orderDetails" : { "codValue": 0, "invoiceNumber": "INV-10", "invoiceTime": "2020-10-16T20:22:28.000+05:30", "invoiceValue": 100.00, "isCod": false, "forwardShipmentNumber": "101" } } |
...
Info |
---|
*→ These fields are mandatory if courier partner integration needs to be done via Increff(ie. in cases where the channel does not have the AWB and transporter details and wants increff to fetch these details through the integration between increff and logistic aggregator) *† → These fields are dependant on the Courier partner being integrated with, if it is mandatory for the courier partner, then they must be sent. |
Response
Empty Body
HttpStatus : 200
Return Order Ack
Outbound | PUT | {Client’s URL}
Summary
This API will call the channel with return order processing details.
Description
This API will call the channel with return order processing details.This API will only get triggered after the return order is received and processed.
Request
Code Block | ||
---|---|---|
| ||
{ "returnOrderCode": "H893RUOT123", "forwardOrderCode": "forwardOrder1", "locationCode": "Wid234", "orderItems": [ { "itemCode": "I10098", "channelSkuCode": "100007542", "qcStatus": "FAIL", "qcReason": "DAMAGED", "imageUrls": [ "https://increff.com/img.jpg", "https://increff.com/img2.jpg" ] } ] } |
Parameter Name | Data Type | Description | Mandatory |
| String | Unique code used by the channel to identify the return order | yes |
| String | ForwardOrderCode associated with the return order | yes |
| String | Location code of the warehouse where the return order will be received. | yes |
| Object[] | List of return items processed. | yes |
| String | Unique code used by the channel to identify the return order item | yes |
| String | SKU code of return order item | yes |
| String | The reason due to which this return item has been marked qc fail | no |
| String | The qcStatus of the return Item. Possible values : PASS , FAIL | yes |
| String[] | It contains the list of urls of the images of the return items .It will only be populated in case that item has been marked as fail. | no |
Response
Empty body
HttpStatus : 200
Pushing Notifications to Magento front-end system
Outbound | POST | {Client’s URL}
Summary
This API will push notifications to the client’s system.
Description
This API will push notifications to the client’s systems. Notifications can be of the forward order statuses or it can be of return orders. These notifications pushed can be from both Clickpost and/or Shiprocket (based on the configuration).
Request (Forward Order Notification Payload)
Code Block | ||
---|---|---|
| ||
{ "forwardOrderCode":"order-1", "forwardShipmentCode":"101", "forwardAwb":"awb-1", “courierName”:”SELF”, "notificationType":"PICKED_UP", "notificationUpdateTime":1678949844, "logisticAggregatorInfo":{ "logisticAggregatorName":"CLICKPOST", "logisticAggregatorMetaData":{ "Account Code":"ABCD", "Security Key":"12abcd12", } } "returnOrderInfo":null, "warehouseCode":"wh-1", "items":[ { "itemId":"2", "sku":"puma-sku-1", "quantity":1 } ] } |
The above request is a sample notification for a forward order notification.
Request (Return Order Notification Payload)
Code Block | ||
---|---|---|
| ||
{ "forwardOrderCode":"order-1", "forwardAwb":null, “courierName”:”SELF”, "notificationType":"PICKED_UP", "logisticAggregatorInfo":{ "logisticAggregatorName":"CLICKPOST", "logisticAggregatorMetaData":{ "Account Code":"ABCD", "Security Key":"12abcd12", } } "returnOrderInfo":{ "returnOrderId":"2", "returnAwb":"awb-1_rev", "transporter":"Self Reverse", "returnOrderTime":1678949844 }, "warehouseCode":"wh-1", "items":[ { "itemId":"2", "sku":"puma-sku-1", "quantity":1 } ] } |
The above request is a sample notification payload for a return order notification. The return order details will be found in the returnOrderInfo object.
Parameter Name | Data Type | Description | Mandatory |
| String | Forward Order Code | yes |
| String | Forward Shipment Code | no |
| Long | Epoch timestamp at which notification was received from channel |
|
| String | Forward AWB for the order. If the notification is of forward order, this field would be present. | Conditional yes |
| String | The type of notification that is being sent. The possible values are listed below. | yes |
| Object | Return Order Information. Will be present if the notification type is a return type(AWB_GENERATED, RETURN_PICKUP, RTO etc.) | Conditional yes |
| String | Return Order Id | Conditional yes |
| String | Return Awb | Conditional yes |
| String | Courier for the return order | Conditional yes |
| Long | Return Order Time | Conditional yes |
| Object | This contains the custom fields sent by Clickpost/Shiprocket | yes |
| String | Logistic Aggregator type. Can be CLICKPOST or SHIPROCKET | yes |
| Object | Map of extra information that are passed to us by logistic aggregators. Example - Account Code, Security Key etc. in Clickpost’s case | yes |
| String | Warehouse Code for the forward/return order. If the shipping label was generated through MiniOMS, then this field would be populated. | Conditional yes |
| Objects | The items for the forward/return order. Would be null in case of shiprocket forward order statuses | Conditional yes |
| String | Item Id | Conditional yes |
| String | SKU of the item | Conditional yes |
| Integer | Quantity of the item | Conditional yes |
Request (Invoice Notification Payload)
Code Block | ||
---|---|---|
| ||
{ "forwardOrderCode": "ABCD", "forwardShipmentCode": "1", "notificationType": "INVOICE_GENERATED", "notificationUpdateTime": 1678949844, "invoiceData": { "invoiceId": 123, "invoiceStatus": "CREATED", "documentType": "INVOICE", "documentUrl": "https://invoice.com/dummy/pdf" } } |
...
The above request is a sample notification payload for invoice generated notification. This notification will be sent when Invoice is generated in our system. The invoice document details will be found in the PushInvoice
object.
Parameter Name | Data Type | Description | Mandatory |
| String | Id of the generated invoice | yes |
| String | Url of invoice document | yes |
| String | Status of invoice | yes |
| String | Invoice/Credit note | yes |
| String | Forward Shipment Code | yes |
| String | Forward Order Code | yes |
| NotificationType | The type of notification that is being sent. The possible values are listed below. | yes |
| Long | Epoch timestamp at which notification was received from channel | yes |
Notification Type
The following are the types of notifications that can be sent to the client’s system
Notification Type | Applicable for | Description |
| Clickpost | Shipping Label has been generated |
| Clickpost,Shiprocket | Courier is out to pick up the shipment |
| Clickpost | Courier has picked up the return order |
| Clickpost,Shiprocket | Courier is out to deliver the shipment |
| Clickpost | shipment could not be delivered ( e.g. address not found, person not available) |
| Clickpost,Shiprocket | Shipment delivered successfully |
| Clickpost,Shiprocket | Shipment could not be delivered and the shipment is now being sent back to its origin/Warehouse |
| Clickpost | Customer has placed the return order
|
| Clickpost | AWB is generated for the shipment |
| Clickpost,Shiprocket | Shipment has been canceled (e.g customer cancellation) |
| Clickpost,Shiprocket | Shipment delivered to origin |
| Clickpost | fwd order picked up from warehouse to exchange against the return order |
| Clickpost | Return order picked up, fwd order delivered |
| Clickpost | shipment from warehouse canceled |
| Clickpost | Shipment is stuck in transit |
| Clickpost | Shipment not delivered on time |
| Clickpost,Shiprocket | Shipment lost in transit |
| Clickpost,Shiprocket | Shipment damaged in transit |
| Shiprocket | Invoice for shipment has been generated |
| Shiprocket | Shipment Label has been generated |
| Shiprocket | Shipment pick up has been scheduled and pick request is sent to courier partner |
| Shiprocket | Shipment dispatched from the Warehouse |
| Shiprocket |
|
| Shiprocket |
|
| Shiprocket | Shipment is in queue for pickup post shipment pickup was scheduled |
| Shiprocket | Pick up is rescheduled |
| Shiprocket | An order for which there is some error in pick up generation |
| Shiprocket | Cancellation has been requested for the order |
| Shiprocket | Shipment is in transit |
| Shiprocket | Shipment could not be delivered in first attempt. |
| Shiprocket | Shipment is delayed but within SLA |
| Shiprocket |
|
| Shiprocket |
|
| Shiprocket |
|
| Shiprocket | During transit shipment reached from one HUB to final HUB before delivering to customer |
| Shiprocket | Shipment sent to wrong route |
| Clickpost,Shiprocket | Shipment picked up from the warehouse |
| Shiprocket | An order for which RTO is acknowledged by seller |
| Clickpost |
|
FAQs
Que: How can I identify if the notification is for a forward order or a return order?
Ans: If the “returnOrderInfo“ field is null, then it is a forward order notification. If it is not null, it is a return order notification.
Nuances
Shipment
The required by time of Increff OMS(SLA) is set as 2 days from the time at which the order is created at channel.
Shipping Label
Shipping labels are generated by RMS.
The customer address details will not be changed after order creation.(If needed in case of a pin code not serviceable from clickpost)it should be raised and then will be changed from the database.
A set of default dimensions will be sent to the logistic aggregator(non configurable)
Invoice
Signature and logo png file to be provided by the client which further needs to be stored in the system.(By default increff logo is used in invoice)
From party location contact name will be shown in the from to address in invoice
The invoice will include item level discount(which is populated from magento in the discount field of the get order response payload)
The total discount will be shown in the invoice (it can also include the store credit if it is present in amstorecredit_amount inside the extension_attributes of the order response payload).
The cash on delivery fee is added to the shipping charge in case it is present in the field cash_on_delivery_fee inside the extension_attributes of order.
HSN code will be visible under Item tax code/HSN code
The pdf format supported is A4 size.
...
Logistic Aggregator type to be selected from CLICKPOST, SHIPROCKET, SHIPWAY
The Invoice prefix and series(Integer) to be provided by client
Updates
Multi-warehousing support in Magento- 13-May-23
Introduced multi-warehousing support through our advanced order splitting and routing capabilities. This means that we can now split and route all orders to different locations mapped to the client-channel pair, providing seamless fulfillment across multiple locations.
As Magento does not support multi-warehousing and does not split orders based on location, we have implemented this functionality to support multi-warehousing.
...