Skip to content

Order Poll API

This resource may be used for fetching the list of orders updated in the given time durations. The response will contain a list of order IDs, and their details will have to be fetched in a subsequent status check API.

Note

This API is NOT to be used for reporting use cases, it should only be used to keep your system up to date with all orders being placed on Pincode. There will be restrictions on the size of orders being fetched, and rate-limiting on how frequently this is being called, etc

Authentication:
As explained in the Authentication section, this API requires the Authentication token as a header.

Coordinates
Staging: seller-network-testing.pincode.com
Production: shopping-network.phonepe.com

Resource: POST /tsp/order/v1/changes

curl --request POST \
--url 'https://seller-network-testing.pincode.com/tsp/order/v1/changes' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: O-Bearer <token>' \ 
--data ' {
    "requestContext": {
    "requestId": "OMS2402220921362644329327"
  },
  "serviceProviderId": "S01",
  "fromTimestamp": 1713523439000,
  "toTimestamp": 1718021525000,
  "sortOrder": "ASC",
  "nextPage": "eyJzdGFydCI6IkFUMVRiMVpYVnpSVmJrZ",
  "size": 2
}
import requests

url = 'https://seller-network-testing.pincode.com/tsp/order/v1/changes'
headers = {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'Authorization': f'O-Bearer {token}'
}
data = {
  "requestContext": {
    "requestId": "OMS2402220921362644329327"
  },
  "serviceProviderId": "S01",
  "fromTimestamp": 1713523439000,
  "toTimestamp": 1718021525000,
  "sortOrder": "ASC",
  "nextPage": "eyJzdGFydCI6IkFUMVRiMVpYVnpSVmJrZ",
  "size": 2
}
response = requests.post(url, headers=headers, json=data)

Success Response:

{
  "requestContext": {
    "requestId": "OMS2402220921362644329327"
  },
  "response": {
    "orderIds": [
      "OD2401121901140533863584",
      "OD24011219011405233863584"
    ],
    "nextPage": "eyJzdGFydCI6IkFUMVRiMVpYVnpSVmJrZ"
  }
}

Error Payload:

{
  "requestContext": {
    "requestId": "OMS2402220921362644329327",
    "transactionId": "OD2401121901140533863584"
  },
  "error": {
    "errorCode": "NOT_FOUND",
    "message": "Order id OD2401121901140533863584 not found"
  }
}

Expected Response:
The following response is expected from the API exposed by you.

{
  "status": "ACK",
  "requestContext": {
    "requestId": "OMS2402220921362644329327",
    "transactionId": "OD2401121901140533863584"
  }
}

Field Explanations

Field Type Description
requestContext Object This object represents the context of the order in which the update is being given
requestContext.requestId String The unique ID for every request made will be the same in callbacks and identify every new request
serviceProviderId String Store’s ID of technical service provider
fromTimestamp Long Timestamp, from which orders need to be scrolled
toTimestamp Long Timestamp, till which orders need to be scrolled
sortOrder Enum Sort order represents in what direction order will be scanned from fromTimestamp (ASC/DESC)
nextPage String The next page is the pointer reference where the scan starts. Pass the nextPage received from the previous response. If no nextPage is passed it will scan from the first page.
size Integer size is the page size. (Number of orders you want in a single response). It must be between 1-10