Update a standing order
This is a paid module
Please contact sales to use this module.
Update Standing Order
Update an existing standing order's status, items, pricing, and price index linkage settings.
Available Updates
- Change STO status (active/inactive)
- Update items and pricing
- Modify price index linkage settings
Updating Prices via Items
You can update the STO price by sending new items in the items array.
Important: Items Replacement Behavior
When you send items in an update request, all existing items are deleted and replaced with the new items you provide. The charge amount is then recalculated based on the new items.
If you want to keep existing items, you must include them in the request along with any new or modified items.
Price Index Linkage Updates
You can update the index linkage settings for an existing STO. When updating items with index_link set to "Y", ensure the STO-level index_linked is also set to "Y".
Code Examples
Update STO Status
{
"terminal_name": "myterminal",
"sto_id": 344394,
"sto_status": "inactive",
"updated_by_user": "admin"
}
Update STO Price (Replace Items)
This example replaces all existing items with new ones. The charge amount will be recalculated.
{
"terminal_name": "myterminal",
"sto_id": 344394,
"updated_by_user": "admin",
"items": [
{
"code": "PROD001",
"name": "Updated Product",
"unit_price": 50,
"type": "I",
"units_number": 2,
"unit_type": 1
},
{
"code": "PROD002",
"name": "New Product",
"unit_price": 25,
"type": "I",
"units_number": 1,
"unit_type": 1
}
]
}
Update Items with Price Index Linkage
{
"terminal_name": "myterminal",
"sto_id": 344394,
"updated_by_user": "admin",
"items": [
{
"code": "PROD001",
"name": "Updated Product",
"type": "I",
"units_number": 3,
"unit_type": 1,
"index_link": "Y",
"base_price": 10
}
]
}
Update Index Linkage Settings
{
"terminal_name": "myterminal",
"sto_id": 344394,
"index_linked": "Y",
"index_type": 120010,
"base_month": "2022-01",
"min_price": "Y",
"updated_by_user": "admin"
}
Request
Headers
Request time sent in Unix format (large integer counting milliseconds from Jan 1st, 1970 00:00:00)
Application public key supplied by Tranzila
A 40 bytes NONCE – unique random string generated with any random bytes function
hash_hmac using 'sha256' on application key with secret + request-time + nonce
Body
application/jsonThe ID of the standing order to update
344394New status for the standing order
activeinactiveinactiveUpdated list of items. **Note:** Sending items will replace all existing items and recalculate the charge amount.
Enable or disable price index linkage. When set to "Y", the following fields become required: `index_type`, `base_month`, `min_price`
YNYCBS (Central Bureau of Statistics) index code. Currently supported: `120010` (Consumer Price Index - CPI)
120010Reference month for index calculation (format YYYY-MM)
^(19|20)\d\d[-](0[1-9]|1[012])$2022-01Minimum price protection
YNYUsername or identifier of the user updating this STO
adminResponses
The response can be 200 with an Application error code:
| Error Code | Description |
|---|---|
| 20300 | Too many payment methods |
| 20301 | Failed to update STO |
| 20302 | Failed to retrieve STO |
| 20303 | No payment method |
Response body
1{
2 "error_code": 0,
3 "message": "Success"
4}
5