Convert purchase order to restock
curl --request POST \
--url https://staging-api.usetyms.com/v1/adam/purchase-orders/{uuid}/convert-to-restock \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{}'import requests
url = "https://staging-api.usetyms.com/v1/adam/purchase-orders/{uuid}/convert-to-restock"
payload = {}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://staging-api.usetyms.com/v1/adam/purchase-orders/{uuid}/convert-to-restock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"message": "Purchase order converted to restock successfully",
"data": {
"uuid": "restock-uuid-1",
"transaction_type": "restock"
}
}{
"status": "failed",
"message": "<string>"
}{
"status": "failed",
"message": "<string>"
}Purchase Orders
Convert purchase order to restock
Convert a purchase order to an inventory restock document when goods arrive. Stock quantities are increased per line item. Pass an empty body {}.
POST
/
purchase-orders
/
{uuid}
/
convert-to-restock
Convert purchase order to restock
curl --request POST \
--url https://staging-api.usetyms.com/v1/adam/purchase-orders/{uuid}/convert-to-restock \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{}'import requests
url = "https://staging-api.usetyms.com/v1/adam/purchase-orders/{uuid}/convert-to-restock"
payload = {}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://staging-api.usetyms.com/v1/adam/purchase-orders/{uuid}/convert-to-restock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"message": "Purchase order converted to restock successfully",
"data": {
"uuid": "restock-uuid-1",
"transaction_type": "restock"
}
}{
"status": "failed",
"message": "<string>"
}{
"status": "failed",
"message": "<string>"
}Authorizations
Business secret tyms_sk_... for business-scoped routes. Partner secret for register-business and referred-business distributor routes.
Path Parameters
Purchase order uuid.
Body
application/json
The body is of type object.
Response
Restock created from PO