Skip to main content

Create or update a shop

This API lets a Master Merchant manage the point-of-sale (shop) data of its sub-Merchants. You use the same endpoint to create a new shop or update an existing one.

POST
URLhttps://open-api.tingee.vn/v1/shop/create-or-update

Add a new shop or update shop details, depending on the 'id' parameter.

Header Request​

HeaderRequiredDescription
Content-Type✓application/json
x-client-id✓Partner identifier issued by TINGEE.
x-signature✓HMAC SHA512 authentication signature. See How to generate the signature.
x-request-timestamp✓Time the request is sent (format: yyyyMMddHHmmssSSS, UTC+7)

Body Parameter​

FieldTypeRequiredDescription
merchantIdnumber~ID of the sub-Merchant that owns the shop.
Required when calling with a Master Merchant account.
idnumber✕Shop ID (pass it to perform an update).
namestring✓Shop display name (up to 500 characters).
addressstring✕Detailed address of the point of sale (house number, street), up to 125 characters.
fullAddressstring✕Full address of the point of sale, up to 250 characters.
This value is returned in the address field of the Get shop list API.
provinceIdstring✕Province/city code (up to 20 characters).
districtIdstring✕District code (up to 20 characters).
communeIdstring✕Ward/commune code (up to 20 characters).
emailstring✕Shop email, in a valid email format (up to 256 characters).
phoneNumberstring✕Shop phone number: 10 characters, starting with 0.
isActiveboolean✓Active status (true/false).
A newly created shop is always active; this value only takes effect on update.

Code samples​

curl --location --request POST 'https://open-api.tingee.vn/v1/shop/create-or-update' \
--header 'accept: application/json' \
--header 'x-client-id: YOUR_CLIENT_ID' \
--header 'x-request-timestamp: 20240509154004003' \
--header 'x-signature: YOUR_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{
"merchantId": 10001,
"name": "Cửa hàng Chi nhánh 1",
"isActive": true,
"address": "Số 123 Đường ABC, Hà Nội"
}'

Sample Response​

{
"code": "00",
"message": "Success",
"data": {
"shopId": 5566
}
}
FieldTypeDescription
codestringResult code (00 = Success).
messagestringResponse message.
data.shopIdnumberID of the shop that was created or updated.

Common error codes​

CodeDescriptionHow to handle
1031Shop not foundWhen updating, check the shop id (from Shop list); omit id to create a new shop.
1095, 1096Master Merchant merchantId errorPass the merchantId of a sub-Merchant that belongs to the Master Merchant calling the API.
90, 91, 92, 97Request authentication error (timestamp, client-id, signature)See System error codes.
OthersOther errorsSee Error codes.