Store Update¶
Store update APIs may be used to update store properties. Currently, toggling the state of the store is the only feature supported through APIs. Changing other attributes will be supported later.
Store Toggle API¶
Description: Enabling and disabling a particular store for order acceptance.
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/store
curl --request POST \
--url 'https://seller-network-testing.pincode.com/tsp/catalog/v1/store' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: O-Bearer <token>' \
--data ' {
"requestContext": {
"requestId": "R212121231231"
},
"messages": [
{
"messageId": "M1123123",
"operationType": "PARTIAL_UPDATE",
"serviceProviderId": "28372837",
"data": {
"type": "STORE_TOGGLE",
"orderAcceptance": {
"status": "DISABLED",
"validTill": 1712155446000
}
}
}
]
}'
import requests
url = 'https://seller-network-testing.pincode.com/tsp/catalog/v1/store'
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': f'O-Bearer {token}'
}
data = {
"requestContext": {
"requestId": "R212121231231"
},
"messages": [
{
"messageId": "M1123123",
"operationType": "PARTIAL_UPDATE",
"serviceProviderId": "28372837",
"data": {
"type": "STORE_TOGGLE",
"orderAcceptance": {
"status": "DISABLED",
"validTill": 1712155446000
}
}
}
]
}
response = requests.post(url, headers=headers, json=data)
Response:
{
"requestContext": {
"requestId": "R212121231231"
},
"response": {
"submissionId": "28327398273927392"
}
}
Field Explanation:
Parameter | Type | Description |
---|---|---|
requestContext | Object | This object represents the context of the update/create in which the update/create is being given |
requestContext.requestId | String | The unique ID for every request made will be the same in callbacks and identify every new request |
messages[0].messageId | String | Identifier for the message that is unique within this request. Response messages are correlated to this message id |
messages[0].data.type | Enum | STORE_TOGGLE: Used toggling store for order acceptance |
messages[0].operationType | Enum | PARTIAL_UPDATE |
messages[0].serviceProviderId | String | Represents the store identification ID that the receiver platform understands |
messages[0].data.orderAcceptance.status | Enum | DISABLED: The store is not accepting order ENABLED: The store is accepting order |
messages[0].data.orderAcceptance.validTill | Long | validTill is only applicable when the status is disabled. The store would not accept orders until this epoch timestamp |
Note
Even though the messages are a list object, only a single store will be allowed in the current version of the API.
Callback:
{
"submissionId": "28327398273927392",
"requestContext": {
"requestId": "R212121231231"
},
"processingStatus": "COMPLETED",
"issues": [
{
"messageId": "M1123123",
"code": "90221",
"severity": "ERROR",
"message": "Valid Till Timing is Incorrect ",
"attribute_errors": [
{
"validTill": "validTill should be in epoch milliSec"
}
]
}
],
"summary": {
"errors": 1,
"warnings": 0,
"success": 0,
"total": 0
}
}