Skip to content

Update a standing order

posthttps://api.tranzila.com/v2/sto/update

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

JSON
{
  "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.

JSON
{
  "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

JSON
{
  "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

JSON
{
  "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

X-tranzila-api-request-timestringrequired

Request time sent in Unix format (large integer counting milliseconds from Jan 1st, 1970 00:00:00)

X-tranzila-api-app-keystringrequired

Application public key supplied by Tranzila

X-tranzila-api-noncestringrequired

A 40 bytes NONCE – unique random string generated with any random bytes function

X-tranzila-api-access-tokenstringrequired

hash_hmac using 'sha256' on application key with secret + request-time + nonce

Body

application/json
terminal_nameterminalNamerequired
sto_idintegerrequired

The ID of the standing order to update

Example:344394
sto_statusstring

New status for the standing order

Allowed values:activeinactive
Example:inactive
itemsarray[STOItemV2]

Updated list of items. **Note:** Sending items will replace all existing items and recalculate the charge amount.

index_linkedstring

Enable or disable price index linkage. When set to "Y", the following fields become required: `index_type`, `base_month`, `min_price`

Allowed values:YN
Example:Y
index_typeinteger

CBS (Central Bureau of Statistics) index code. Currently supported: `120010` (Consumer Price Index - CPI)

Example:120010
base_monthstring

Reference month for index calculation (format YYYY-MM)

Match pattern:^(19|20)\d\d[-](0[1-9]|1[012])$
Example:2022-01
min_pricestring

Minimum price protection

Allowed values:YN
Example:Y
response_languageAPILanguage
updated_by_userstring

Username or identifier of the user updating this STO

Example:admin

Responses

The response can be 200 with an Application error code:

Error CodeDescription
20300Too many payment methods
20301Failed to update STO
20302Failed to retrieve STO
20303No payment method

Response body

response.json
JSON
1{
2  "error_code": 0,
3  "message": "Success"
4}
5
Was this page helpful?