v1

latestOpenAPI 3.0.1MIT2026-07-263151,3912.3 MB
Orders

Update Order

Updates the specified order by setting the values of the parameters passed in the request body. Any parameters not provided will be left unchanged.

put/v1/orders/{orderId}

Request body

source_idstring nullable

Unique source ID of an existing order that will be linked to the redemption of this request.

For validation and redemption, if source_id is used with an existing order, the original order data will be used, like items, amount, and so on, not the one sent in the new request.

status'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED'

The order status.

amountinteger

A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts.

initial_amountinteger

A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts.

discount_amountinteger

Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).

metadataobject

A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas.

created_atstring date-time

Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.

referrer_idstring nullable

Unique referrer ID.

Example request

{
  "created_at": "2021-12-22T10:13:06.487Z",
  "referrer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix"
}

Response

Returns the order object if the update succeeded.

idstring

Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request.

source_idstring nullable

Unique source ID of an existing order that will be linked to the redemption of this request.

status'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED'

The order status.

amountinteger

This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).

initial_amountinteger

This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).

discount_amountinteger

Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).

items_discount_amountinteger

Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).

total_discount_amountinteger

Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).

total_amountinteger

Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).

applied_discount_amountinteger

This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).

items_applied_discount_amountinteger

Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).
sum(items, i => i.applied_discount_amount)

total_applied_discount_amountinteger

Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).
total_applied_discount_amount = applied_discount_amount + items_applied_discount_amount

metadataobject

A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas.

object'order'

The type of the object represented by JSON.

created_atstring date-time

Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.

updated_atstring date-time nullable

Timestamp representing the date and time when the order was last updated in ISO 8601 format.

customer_idstring nullable

Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.

referrer_idstring nullable

Unique referrer ID.

redemptionsobject

Example response

{
  "created_at": "2021-12-22T10:13:06.487Z",
  "updated_at": "2021-12-22T10:14:45.316Z",
  "customer_id": "cust_7iUa6ICKyU6gH40dBU25kQU1",
  "referrer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix"
}