Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Jit V2

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 30

JIT ORDER FULFILMENT API

SPECIFICATION
Table of Contents

GETTING STARTED................................................................................................................................................................... 3
URI SCHEME......................................................................................................................................................................................................................................3
API CALLS................................................................................................................................................................................ 4
AUTHENTICATION...............................................................................................................................................................................................................................4
GET PENDENCY ORDERS...................................................................................................................................................................................................................5
Cancel ORDER............................................................................................................................................................................... 7
GET ORDERS....................................................................................................................................................................................................................................18
GENERATE B2B INVOICE................................................................................................................................................................................................................13
UPDATE B2B INVOICE....................................................................................................................................................................................................................16
UPLOAD SIGNED COPY OF B2B INVOICE.......................................................................................................................................................................................17
CANCELLATION SUMMARY (NOT AN API, GENERAL UNDERSTANDING):.......................................................................................................18
GENERATE SHIPPING LABEL DATA.................................................................................................................................................................................................20
GENERATE SHIPPING LABEL PDF.........................................................................................................................................................22
GENERATE MANIFEST.....................................................................................................................................................................................................................23
Products Count........................................................................................................................................................................... 24
Products........................................................................................................................................................................................................................................25
Update ATP Inventory.............................................................................................................................................................................................................26
Shipment Box..............................................................................................................................................................................................................................30
Invoice Details............................................................................................................................................................................................................................32
Overview
This is the AJIO JIT B2B Fulfilment API Integration Guide. It provides details for the implementation,
parameter formats, Cancelation flow, and order status information. It also provides descriptions, syntax, and
usage examples for each of the actions and data types.

Getting Started
URI Scheme
Base path: to be confirmed
Sandbox IP: http://116.50.64.106:8080
Prod URL: https://api-seller.services.ajio.com

Once Onboarding is completed, generated POB ID and POB password will be shared over email which is to
be used in every authentication call, detailed below.
API Calls

Authentication

Generate auth token using username and password. This auth token is needed to pass in header with header
name ‘apiKey’ for all interaction with AJIO Platform.

POST /authToken
Description :
 All API requests will require to pass Auth Token.
 You can use Authentication API to get Auth token by passing your POB ID and POB password
 Token once generated is valid for 30 mins, upon expiry with response code as 401, fresh token to
be generated using same steps.

Behaviour :
 Authenticate and generate JWT based auth and refresh token.
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 40x if authentication is unsuccessful.

Consumes
• application/json

Produces
• application/json

Sample Request
{
"password":"",
"username":""
}

Sample Response
{
"success": true,
"statusCode": 0,
"result": {
"accessToken": "string",
"refreshToken": "string"
}
}
Products Count
GET /productsCount

Description :
 Returns a JSON object with the product count based on the specified "publishedStatus".
 The count is accessible through the "count" field in the response JSON.

Behaviour :
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.
Throttling limit: 100 requests per minute per user.

Request Header
{
"apiKey": "accessToken"
}

Request Params
publishedStatus : PUBLISHED/UNPUBLISHED

Sample Response
{
"count": 0
}
Products
GET /products

Description :
 The API allows users to query products based on their publication status, skus, providing the
flexibility to filter results by specifying whether products are "PUBLISHED" or
"UNPUBLISHED."
 To manage large result sets, the API supports pagination through parameters like
"pageNumber" and "pageSize," enabling users to retrieve a controlled subset of product data
per request.
Behaviour :
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.
Throttling limit: 100 requests per minute per user.

Request Header
{
"apiKey": "accessToken"
}

Request Params
publishedStatus : PUBLISHED/UNPUBLISHED
skus: String (Comma Seperated)
pageNumber : Integer (starting from 1)
pageSize : Integer (starting from 1)
Update ATP Inventory
POST /updateInventory

Description :
 The API allows users to query products based on their publication status, skus, providing the
flexibility to filter results by specifying whether products are "PUBLISHED" or
"UNPUBLISHED."
 To manage large result sets, the API supports pagination through parameters like
"pageNumber" and "pageSize," enabling users to retrieve a controlled subset of product data
per request.
Behaviour :
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.
Throttling limit: 100 requests per minute per user.

Request Header
{
"apiKey": "accessToken"
}

Request Body
{
"inventoryList": [

{
"productId": "49999999822",
"variantId": "49999999822",
"inventory": 51105
},
{
"productId": "49999999823",
"variantId": "49999999823",
"inventory": 510015
}
]
}

Response Body
Success :
{
"status": "SUCCESS",
"failedProductList": null
}
Partial Failure :
{
"status": "PARTIAL_SUCCESS",
"failedProductList": [
{
"productId": "900000000027",
"variantId": "900000000027",
"message": "Invalid input passed"
}
]
}
Full failure:
{
"status": "FAILED",
"failedProductList": [
{
"productId": "900000000027",
"variantId": "900000000027",
"message": "Invalid input passed"
},
{
"productId": "480005475",
"variantId": "480005475",
"message": "Invalid input passed”
}
]
}
Get Pendency Orders
API to fetch newly created Orders(without any Purchase Order). This can also be used for soft inventory
reservation at vendor side. The response contains all the open orders belongs to a POB which are yet to be
acknowledge by seller.

GET /orders/pendency

Description :
 Filter and fetch orders which are in Open status and whose acknowledgment is not yet
received.
 It is advised not to consume Order value from this API.
 This API should only be used to get visibility on booked orders and blocking inventory.
 Date Format to be adhered to avoid failures described at beginning

Behaviour :
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.

Throttling limit: 100 requests per minute per user.

Headers

{
"apiKey": "accessToken"
}

Parameters
Type Name Description Schema
orderDateFro
Query m Filter Criteria for Order date string

orderDateTo
Query Filter Criteria for Order date string

pageNumber
Query Page Number integer (int32)

pageSize
Query Page Size. (Max size is 50) integer (int32)

Produces
• application/json
Response Body:

{
"pendencies": [
{
"orderId": "string",
"orderItems": [
{
"onHold": true,
"orderItemId": "string",
"productId": "string",
"quantity": 0,
"sku": "string",
"status": "CANCELLED",
"title": "string",
"variantId": "string"
}
],
"orderStatus": "PROCESSING"
}
],
"page": {
"size": 0,
"totalElements": 0,
"totalPages": 0,
"number": 0
}
}
Get Orders
API to fetch Purchase Orders (Orders) which are previously acknowledge by seller and whose purchase
order is generated in the system.

GET /orders

Description :
 Filter and fetch orders whose purchase order is generated.
 Reconcile Order quantity
 Refer "quantity", for quantities to be fulfilled as of now (net off all cancellations)
 PO (Order) value to be considered from this API

Calculating B2B Invoice value:

 MRP – MRP is price at which seller has catalogued specific product (inclusive of GST)
 Item_base_price – It is Product ID level base price after adjustments of Seller discounts
and AJIO Margin at a unit level, exclusive of GST
 Quantity – Is the count of items to be fulfilled for the mentioned Product ID
 tax_summary– It is the breakup of tax values under different heads at consolidated quantity
level for the specific Product ID.
 po_line_amount" – It is the final price of PO inclusive of tax and item prices* qty.
po_line_amount = Item_base_price * Quantity + tax_summary
 total_tax: - It is the tax value of total PO amount.

Example:

a b c d e f g h
Item_base_ quant cgst_am cgst_perce igst_am igst_perce sgst_am sgst_perce
price ity ount ntage ount ntage ount ntage
Line 1 100 2 10 5% - - 10 5%
Line 2 200 1 - - 20 10% - -
po_line_a
mount
440
(a*b+c+e+
g)
total_tax
40
(c+e+g)

Behaviour :
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.

Throttling limit: 100 requests per minute per user.


Different Status in Forward Journey:

 Cancelled - When an order is cancelled by a customer.


 Confirmed - When an order is acknowledged.
 Packed - When B2B is uploaded
 Dispatched - When manifest is generated
 Delivered - When order reached destination
 READY_TO_DISPATCH – After B2C is created or Shipping label is created.

Parameters
Type Name Description Schema
orderDateFrom
Query Filter Criteria for Order date string

orderDateTo
Query Filter Criteria for Order date string

orderIds
Query Filter Criteria for order ids string

poNumbers
Query Filter Criteria for purchase order numbers string

enum (CANCELLED,
CONFIRMED,
PACKED,
DISPATCHED,
orderStatus
Query Filter Criteria for Order Status DELIVERED,
READY_TO_DISPATCH
)

pageNumber
Query Page number integer (int32)

pageSize
Query Page Size (Max size is 50) integer (int32)

Produces
• application/json
Sample Response:

{
"orders": [
{
"additionalInfo": "string",
"billingAddress": {
"addressLine1": "string",
"addressLine2": "string",
"city": "string",
"country": "string",
"email": "string",
"name": "string",
"phone": "string",
"pincode": "string",
"state": "string"
},
"id": "string",
"orderDate": "string",
"orderItems": [
{
"onHold": true,
"orderItemId": "string",
"orderItemPrice": {
"currency": "string",
"discount": 0,
"sellingPrice": 0,
"totalPrice": 0,
"transferPrice": 0
},
"productId": "string",
"quantity": 0,
"sku": "string",
"status": "CANCELLED",
"title": "string",
"variantId": "string"
}
],

"orderPrice": {
"currency": "string",
"totalPrepaidAmount": 0,
},
"orderStatus": "PROCESSING",
"paymentType": "COD",
"priority": 0,
"shippingAddress": {
"addressLine1": "string",
"addressLine2": "string",
"city": "string",
"country": "string",
"email": "string",
"name": "string",
"phone": "string",
"pincode": "string",
"state": "string"
},
"sla": "string"
}
]
}
Cancel Order
API to cancel the order

POST /orders/cancel
Description :
 Users can specify the orderId to identify the order to be canceled. Additionally, users must
provide an array of orderItems, each containing details such as orderItemId, productId,
quantity, and variantId for precise cancellation.

Behaviour :
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.

Throttling limit: 100 requests per minute per user.

Consumes
• application/json

Produces
• application/json

Sample Request:
{
"orderId": "string",
"orderItems": [
{
"orderItemId": "string",
"productId": "string",
"quantity": 0,
"variantId": "string"
}
]
}

Sample Response:
{
"orderItems": [
{
"errorMessage": "string",
"orderItemId": "string"
}
],
"status": "SUCCESS"
}
Shipment Box
GET /shipment/box

Description :
 The API serves to facilitate the creation of a shipment box by enabling users to submit a POST
request with essential shipment details.
 Users provide a request payload containing crucial information such as "requestId,"
"shipmentNo," "orderNo," and an array of "itemDetails" specifying order item IDs
("orderItemId") and corresponding quantities.

Behaviour :
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.
Throttling limit: 100 requests per minute per user.

Request Header
{
"apiKey": "accessToken"
}
Request Body
{
"requestId": "string",
"shipmentNo": "string",
"orderNo": "string",
"itemDetails": [
{
"orderItemId": "string",
"quantity": "integer"
}
]
}

Response Body
{
"masterAWB": "string"
"bagId": "string",
"status": "SUCCESS","FAILED",

"failedOrderItem": [
{
"orderItemId": "string",
"errorMessage": "string"
}
]
}
Invoice Details
GET /invoiceDetails

Description :
 This API allows users to retrieve detailed information about an order's invoice by submitting a
request that includes encrypted seller credentials, the order ID, and the shipment number.
 Detailed invoice information includes the invoice code, tracking number, courier details, GST
identification number (GSTIN), invoice date, invoice URL, Invoice Reference Number (IRN),
and a signed QR code.
Behaviour :
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.
Throttling limit: 100 requests per minute per user.

Request Header
{
"apiKey": "accessToken"
}

Request Body
{
"auth": "string", // Encrypted seller credentials string
"orderId": "string",
"shipmentNo": "string"
}
Response Body
{
"invoicecode": "string",
"trackingNo": "string",
"courier": "string",
"gstin": "string",
"invoiceDate": "date",
"invoiceUrl": "string",
"irn": "string",
"signedQRCode": "string",
"productTaxes": [
{
"orderId": "string",
"orderItemId": "string",
"additionalInfo": "string",
"productId": "string",
"variantId": "string",
"taxPercentage": "number",
"centralGstPercentage": "number",
"stateGstPercentage": "number",
"unionTerritoryGstPercentage": "number",
"integratedGstPercentage": "number",
"compensationCessPercentage": "number"
}
],
"invoiceQuantityDetails": [
{
"orderId": "string",
"orderItemId": "string",
"invoicedQuantity": "number",
"shortPickedQantity": "number"
}
]
}
Dispatch Order
POST /orders/dispatch

Description :
 Generate m

Behaviour :
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.
Throttling limit: 100 requests per minute per user.

Request Body
{
"auth": "string", // Encrypted seller credentials string
"dispatchItems": [
{
"invoiceNo": "string",
"shipmentNo": "string",
"orderId": "string"
}
]
}
Response Body
{
"failedDispatchItems": [
{
"invoiceNo": "string",
"shipmentNo": "string",
"orderId": "string"
}
],
"manifestUrl": "string",
"status": [
"SUCCESS",
"PARTIAL_SUCCESS",
"FAILED",
"IN_PROGRESS",
"EBR_PENDING"
]
}
Generate B2B Invoice
API to generate B2B invoice in AJIO.

POST / shipments/{shipmentId}/invoice

Description :
 The API is designed to request the generation of B2B invoice for AJIO shipments.
• Authentication headers (x-tenant and x-pob-id) and the shipment number (shipmentNo) are
mandatory parameters.
• Upon successful invoice generation, the API responds with details about the generated invoice,
including the invoice ID, number, date, media information (resource ID and path), signed
invoice media details, invoice amount, and the final status.

Behaviour :

 Returns HTTP/1.1 status code 200 if the request was successful.


 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.

Throttling limit: 100 requests per minute per user

Parameters
Type Name Schema
x-tenant
Header string
required

x-pob-id
Header string
required

shipmentNo
Path string
required

Consumes & Produces


• application/json

Request Body
{
"status": "string",
"invoiceNumber": "string",
"auth": "string",
"username": "string",
"password": "string"
}
Response Body

{
"result": {
"invoiceId": 0,
"invoiceNumber": "string",
"invoiceDate": "2023-12-26",
"invoiceMedia": {
"resourceId": "string",
"path": "string"
},
"signedInvoiceMedia": {
"resourceId": "string",
"path": "string"
},
"invoiceAmount": 0,
"status": "string"
}
}
Update B2B Invoice
API to update B2B invoice.

PUT /shipments/{shipmentNo}/invoice

Description :
 This API is designed to update Business-to-Business (B2B) invoice details for a
specific shipment. It requires authentication headers (x-tenant and x-pob-id) and a
request body containing information such as the invoice status, number, authentication
details (username and password), etc.

Behaviour :
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.
Throttling limit: 100 requests per minute per user.

Parameters
Type Name Schema
x-tenant
Header string
required

x-pob-id
Header string
required

shipmentNo
Path string
required

Consumes
• application/json

Produces
• application/json

Request Body
{
"status": "string",
"invoiceNumber": "string",
"auth": "string",
"username": "string",
"password": "string"
}

Response Body
{
"result": {
"invoiceId": 0,
"invoiceNumber": "string",
"invoiceDate": "2023-12-26",
"invoiceMedia": {
"resourceId": "string",
"path": "string"
},
"signedInvoiceMedia": {
"resourceId": "string",
"path": "string"
},
"invoiceAmount": 0,
"status": "string"
}
}

Upload signed copy of B2B Invoice


API to upload signed(manually or digital) copy of B2B invoice.

POST / shipments/{shipmentId}/invoice/file
Description :
 This API is designed to upload B2B invoice media.
 The Request must include the x-tenant and x-pob-id headers for authentication and the shipmentNo as
a path param.
Behaviour :
 Returns HTTP/1.1 status code 200 if the request was successful.
 Returns HTTP/1.1 status code 400 request in invalid.
 Returns HTTP/1.1 status code 401 if token is invalid/expired.
Throttling limit: 100 requests per minute per user.

Parameters
Type Name Schema
x-tenant
Header string
required
x-pob-id
Header string
required
shipmentNo
Path string
required

Consumes & Produces


• multipart/form-data

Request Body
File (required)

Response Body
{
"result": {
"invoiceId": 0,
"invoiceNumber": "string",
"invoiceDate": "2023-12-26",
"invoiceMedia": {
"resourceId": "string",
"path": "string"
},
"signedInvoiceMedia": {
"resourceId": "string",
"path": "string"
},
"invoiceAmount": 0,
"status": "string"
}
}
Cancellation Summary (Not an API, general understanding):

Customer Cancellation
Customer cancellation is allowed until B2B invoice is not generated. API integrator needs to
1. Reconcile the quantity received in Acknowledge call and consider fulfilment of the
quantity mentioned against the confirmed_quantity response parameter.
2. Reconcile the quantity received in Generate B2B invoice call and consider fulfilment of
the quantity received in response.
3. If a full order is cancelled then the seller has to stop order processing.

Seller Cancellation
Seller cancellation can be done.as below:
1. During Acknowledgement Call: In this request, seller can specify cancelled_quantity
and confirmed_quantity.
2. During Generate B2B Invoice Call: In this request, seller can specify lesser quantity against quantity
parameter than what mentioned in the confirmed_quantity during Acknowledgement call. Quantity
value should be always less than or equal to the confirmed_quantity mentioned in ACK call.

Business Cancellation
Business cancellation is allowed until B2B invoice is uploaded. API integrator needs to
1. Reconcile quantity received in Generate B2C invoice call and consider fulfilment of the
quantity received in response.
2. If a full order is business cancelled then the seller has to stop order processing.
3. Account reconciliation will be handled offline.

Customer Order 5 Tshirt

Scenario 1 No Cancellation
Pendency API Ordered_Quantity=5
Acknowledge Order API Cancelled_Quantity=0 Confirmed_quantity=5
Get Orders API quantity = 5 customer_cancelled quantity =0
Generate B2B invoice API quantity = 5
Generate B2C invoice API quantity = 5

Scenario 2 Customer Cancels 2 quantity before Acknowledge API is triggered


Pendency API Ordered_Quantity=5
Acknowledge Order API Cancelled_Quantity=2 Confirmed_quantity=3
Get Orders API quantity = 3 customer_cancelled quantity =2
Generate B2B invoice API quantity = 3
Generate B2C invoice API quantity = 3

Scenario 3 Customer Cancels 2 quantity before PO API is triggered but after acknowledge API
Pendency API Ordered_Quantity=5
Acknowledge Order API Cancelled_Quantity=0 Confirmed_quantity=5
Get Orders API quantity = 3 customer_cancelled quantity =2
Generate B2B invoice API quantity = 3
Generate B2C invoice API quantity = 3

Scenario 4 Customer Cancels 2 quantity before generate B2B API is triggered but after PO API
Pendency API Ordered_Quantity=5
Acknowledge Order API Cancelled_Quantity=0 Confirmed_quantity=5
Get Orders API quantity = 5 customer_cancelled quantity =0
Generate B2B invoice API quantity = 3
Generate B2C invoice API quantity = 3
Customer Cancels 1 quantity before Acknowledge API, 1 before PO API and 1
Scenario 5 before generate B2B invoice API
Pendency API Ordered_Quantity=5
Acknowledge Order API Cancelled_Quantity=1 Confirmed_quantity=4
Get Orders API quantity = 3 customer_cancelled quantity =2
Generate B2B invoice API quantity = 2
Generate B2C invoice API quantity = 2
No Customer Cancellation but 2 quantities are cancelled by business after B2B
Scenario 6 invoice
Pendency API Ordered_Quantity=5
Acknowledge Order API Cancelled_Quantity=0 Confirmed_quantity=5
Get Orders API quantity = 5 customer_cancelled quantity =0
Generate B2B invoice API quantity = 5
Generate B2C invoice API quantity = 3
Business Cancels 1 quantity before Acknowledge API, 1 before PO API and 1 before
Scenario 7 generate B2B invoice API
Pendency API Ordered_Quantity=5
Acknowledge Order API Cancelled_Quantity=1 Confirmed_quantity=4
Get Orders API quantity = 3 customer_cancelled quantity =2
Generate B2B invoice API quantity = 2

You might also like