Update Order
curl --request PUT \
--url https://{cluster}.voucherify.io/v1/orders/{orderId} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"status": "CANCELED"
}
'{
"id": "ord_cRKOEXiBOj0EZKF7g9n6l0eH",
"source_id": "new",
"created_at": "2022-09-09T09:20:01.660Z",
"updated_at": "2022-09-09T09:41:00.881Z",
"status": "CANCELED",
"amount": 121700,
"total_amount": 121700,
"items": [
{
"object": "order_item",
"source_id": "prod_1",
"related_object": "product",
"quantity": 2,
"amount": 120000,
"price": 60000,
"subtotal_amount": 120000,
"product": {
"id": "prod_0b7d7c4e814be5c502",
"source_id": "prod_1",
"name": "Apple iPhone 12",
"metadata": {
"color": [
"purple"
],
"vendor": "mall"
},
"price": 60000
}
},
{
"object": "order_item",
"source_id": "ComicBook_1",
"related_object": "sku",
"product_id": "prod_0b7d7dfb05cbe5c616",
"quantity": 1,
"amount": 1700,
"price": 1700,
"subtotal_amount": 1700,
"product": {
"id": "prod_0b7d7dfb05cbe5c616",
"source_id": "Books",
"name": "Comic Books1",
"metadata": {
"color": [
"silver"
],
"vendor": "Bookstore1"
},
"price": 2100
},
"sku": {
"id": "sku_0b7d7dfb090be5c619",
"source_id": "ComicBook_1",
"sku": "Comics1",
"metadata": {
"color": [
"golden"
],
"vendor": "islands"
},
"price": 1700
}
}
],
"metadata": {
"location_id": [
"L1",
"L2"
],
"payment_mean": [
"paypal",
"credit-card"
]
},
"customer": {
"id": "cust_H0nXrItO1DNV3UiPIl54HA5o",
"object": "customer"
},
"referrer": {
"id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv",
"object": "customer"
},
"customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o",
"referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv",
"object": "order"
}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}
Update Order
curl --request PUT \
--url https://{cluster}.voucherify.io/v1/orders/{orderId} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"status": "CANCELED"
}
'{
"id": "ord_cRKOEXiBOj0EZKF7g9n6l0eH",
"source_id": "new",
"created_at": "2022-09-09T09:20:01.660Z",
"updated_at": "2022-09-09T09:41:00.881Z",
"status": "CANCELED",
"amount": 121700,
"total_amount": 121700,
"items": [
{
"object": "order_item",
"source_id": "prod_1",
"related_object": "product",
"quantity": 2,
"amount": 120000,
"price": 60000,
"subtotal_amount": 120000,
"product": {
"id": "prod_0b7d7c4e814be5c502",
"source_id": "prod_1",
"name": "Apple iPhone 12",
"metadata": {
"color": [
"purple"
],
"vendor": "mall"
},
"price": 60000
}
},
{
"object": "order_item",
"source_id": "ComicBook_1",
"related_object": "sku",
"product_id": "prod_0b7d7dfb05cbe5c616",
"quantity": 1,
"amount": 1700,
"price": 1700,
"subtotal_amount": 1700,
"product": {
"id": "prod_0b7d7dfb05cbe5c616",
"source_id": "Books",
"name": "Comic Books1",
"metadata": {
"color": [
"silver"
],
"vendor": "Bookstore1"
},
"price": 2100
},
"sku": {
"id": "sku_0b7d7dfb090be5c619",
"source_id": "ComicBook_1",
"sku": "Comics1",
"metadata": {
"color": [
"golden"
],
"vendor": "islands"
},
"price": 1700
}
}
],
"metadata": {
"location_id": [
"L1",
"L2"
],
"payment_mean": [
"paypal",
"credit-card"
]
},
"customer": {
"id": "cust_H0nXrItO1DNV3UiPIl54HA5o",
"object": "customer"
},
"referrer": {
"id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv",
"object": "customer"
},
"customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o",
"referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv",
"object": "order"
}Authorizations
X-App-Id & X-App-TokenX-Voucherify-OAuth
Scopes
Path Parameters
Body
application/json
Specify the parameters of the order that are to be updated.
Request body schema for PUT v1/orders/{orderId}.
Response
200 - application/json
Returns the order object if the update succeeded.
Response body schema for PUT v1/orders/{orderId}.
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

