[Stage Only] Stock Inward API¶
This API may be used to alter the quantity of an existing item.
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/catalog/v1/listing
curl --request POST \
--url 'https://seller-network-testing.pincode.com/tsp/catalog/v1/listing' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: O-Bearer <token>' \
--data ' {
"requestContext": {
"requestId": "REQ408237401230948923"
},
"messages": [
{
"operationType": "INVENTORY_UPDATE",
"messageId": "messageId28369127019",
"serviceProviderId": "pinpostest",
"serviceProviderItemId": "SKU2511131249352348683122",
"serviceProviderTransactionId": "12345678",
"reasonType": "AUDIT",
"subReason": "Testing.",
"data": {
"type": "INVENTORY_STOCK_ALTER",
"quantityToBeAltered": -10
}
}
]
}'
import requests
url = 'https://seller-network-testing.pincode.com/tsp/catalog/v1/listing'
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': f'O-Bearer {token}'
}
data = {
"requestContext": {
"requestId": "REQ408237401230948923"
},
"messages": [
{
"operationType": "INVENTORY_UPDATE",
"messageId": "messageId28369127019",
"serviceProviderId": "pinpostest",
"serviceProviderItemId": "SKU2511131249352348683122",
"serviceProviderTransactionId": "12345678",
"reasonType": "AUDIT",
"subReason": "Testing.",
"data": {
"type": "INVENTORY_STOCK_ALTER",
"quantityToBeAltered": -10
}
}
]
}
response = requests.post(url, headers=headers, json=data)
Response:
{
"requestContext": {
"requestId" : "R122334343412",
"transactionId": "R122334343412"
},
"response" : {
"submissionId": "28327398273927392"
}
}
Field Explanation:
| Parameter | 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 |
| requestContext.transactionId | String | For catalog related APIs, the transactionId will be same as requestId |
| messages[0].messageId | String | Identifier for the message that is unique within this request. Response messages are correlated to this message id |
| messages[0].serviceProviderId | String | Represents the store identification ID that the receiver platform understands |
| messages[0].operationType | Enum | Represent type of operation. This value would be INVENTORY_UPDATE for stock alter. |
| messages[0].serviceProviderItemId | String | Represent the item identification ID for a store that the receiver platform understands |
| messages[0].serviceProviderTransactionId | String | A unique id for corelating the update request on the client side. |
| messages[0].reasonType | String | Represents the source of the update. Sample values: AUDIT, OFFLINE_POS_SALES etc |
| messages[0].subReason | String | User notes |
| messages[0].data.type | Enum | Message data type. This value would be INVENTORY_STOCK_ALTER for stock inward. |
| messages[0].data.quantityToBeAltered | Double | Quantity to be altered. (This is a delta field i.e. the change is added to the existing quantity.) |