---
title: "Create Order"
method: POST
path: "/v1/orders"
tags: ["Orders"]
---

# Create Order

`POST /v1/orders`

Creates an order object and triggers an order creation event.



> 📘 Upsert Mode
>
> If you pass an `id` or a `source_id` that already exists in the order database, Voucherify will return a related order object with updated fields.

## Request body

- OrdersCreateRequestBody — Order information.
  - `id` string — Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request.
  - `source_id` string, 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.
  - `amount` integer — 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_amount` integer — 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_amount` integer — 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` OrderItem[] — Array of items applied to the order. It can include up to 500 items.
    - `sku_id` string — Unique identifier of the SKU. It is assigned by Voucherify.
    - `product_id` string — Unique identifier of the product. It is assigned by Voucherify.
    - `related_object` 'product' | 'sku' — Used along with the source_id property, can be set to either sku or product.
    - `source_id` string — The merchant's product/SKU ID (if it is different from the Voucherify product/SKU ID). It is useful in the integration between multiple systems. It can be an ID from an eCommerce site, a database, or a third-party service.
    - `quantity` integer — The quantity of the particular item in the cart.
    - `discount_quantity` integer — Number of dicounted items.
    - `initial_quantity` integer — A positive integer in the smallest unit quantity representing the total amount of the order; this is the sum of the order items' quantity.
    - `amount` integer — The total amount of the order item (price * quantity).
    - `discount_amount` integer — Sum of all order-item-level discounts applied to the order.
    - `initial_amount` integer — 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.
    - `price` integer — Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
    - `product` object — An object containing details of the related product.
      - `id` string — A unique identifier that represents the product and is assigned by Voucherify.
      - `source_id` string — The merchant's product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service.
      - `override` boolean — The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system. Override works only for endpoints that create an order in the database.
      - `name` string — Product name.
      - `metadata` object — A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format. It can be used to create product collections.
      - `price` number — Product price. A positive integer in the smallest currency unit (e.g. 100 cents for $1.00).
    - `sku` object — An object containing details of the related SKU.
      - `id` string — A unique identifier that represents the SKU and is assigned by Voucherify.
      - `source_id` string — The merchant's SKU ID (if it is different than Voucherify's SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service.
      - `override` boolean — The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system.
      - `sku` string — The SKU name.
      - `price` number — SKU price. A positive integer in the smallest currency unit (e.g. 100 cents for $1.00).
      - `metadata` object — A set of custom key/value pairs that you can attach to an order item. It can be useful for storing additional information about the order item in a structured format. It can be used to create product collections.
    - `metadata` object — A set of custom key/value pairs that you can attach to an order item. It can be useful for storing additional information about the order item in a structured format. It can be used to define business validation rules.
  - `metadata` object — 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_at` string, date-time — Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.
  - `referrer_id` string, nullable — Unique referrer ID.
  - `customer` Customer
    - `id` string — The ID of an existing customer.
    - `source_id` string — A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored.
    - `name` string — Customer's first and last name.
    - `description` string — An arbitrary string that you can attach to a customer object.
    - `email` string — Customer's email address.
    - `phone` string — Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel.
    - `birthday` string, date — `Deprecated`. ~~Customer's birthdate; format YYYY-MM-DD~~.
    - `birthdate` string, date — Customer's birthdate; format YYYY-MM-DD.
    - `address` object, nullable — Customer's address.
      - `city` string — City
      - `state` string — State
      - `line_1` string — First line of address.
      - `line_2` string — Second line of address.
      - `country` string — Country.
      - `postal_code` string — Postal code.
    - `metadata` object — A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.
  - `referrer` Referrer
    - `id` string — The ID of an existing customer.
    - `source_id` string — A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored.
    - `name` string — Customer's first and last name.
    - `description` string — An arbitrary string that you can attach to a customer object.
    - `email` string — Customer's email address.
    - `phone` string — Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel.
    - `birthday` string, date — `Deprecated`. ~~Customer's birthdate; format YYYY-MM-DD~~.
    - `birthdate` string, date — Customer's birthdate; format YYYY-MM-DD.
    - `address` object, nullable — Customer's address.
      - `city` string — City
      - `state` string — State
      - `line_1` string — First line of address.
      - `line_2` string — Second line of address.
      - `country` string — Country.
      - `postal_code` string — Postal code.
    - `metadata` object — A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.

## Response `200`

Returns an order object if the operation succeeded.

- OrdersCreateResponseBody — Order information.
  - `id` string — Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request.
  - `source_id` string, 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.
  - `amount` integer — 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_amount` integer — 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_amount` integer — 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_amount` integer — 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_amount` integer — 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_amount` integer — 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_amount` integer — 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_amount` integer — 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_amount` integer — 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`
  - `metadata` object — 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_at` string, date-time — Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.
  - `updated_at` string, date-time, nullable — Timestamp representing the date and time when the order was last updated in ISO 8601 format.
  - `customer_id` string, nullable — Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
  - `referrer_id` string, nullable — Unique referrer ID.
  - `customer` CustomerId
    - `id` string, required — A unique identifier of an existing customer.
    - `object` 'customer', required — The type of the object represented by JSON.
  - `referrer` ReferrerId
    - `id` string, required — A unique identifier of an existing customer.
    - `object` 'customer', required — The type of the object represented by JSON.
  - `redemptions` object
  - `items` OrderCalculatedItem[] — Array of items applied to the order. It can include up to 500 items.
    - `id` string — Unique identifier of the order line item.
    - `sku_id` string — Unique identifier of the SKU. It is assigned by Voucherify.
    - `product_id` string — Unique identifier of the product. It is assigned by Voucherify.
    - `related_object` 'product' | 'sku' — Used along with the source_id property, can be set to either sku or product.
    - `source_id` string — The merchant's product/SKU ID (if it is different from the Voucherify product/SKU ID). It is useful in the integration between multiple systems. It can be an ID from an eCommerce site, a database, or a third-party service.
    - `quantity` integer — The quantity of the particular item in the cart.
    - `discount_quantity` integer — Number of dicounted items.
    - `initial_quantity` integer — A positive integer in the smallest unit quantity representing the total amount of the order; this is the sum of the order items' quantity.
    - `amount` integer — The total amount of the order item (price * quantity).
    - `discount_amount` integer — Sum of all order-item-level discounts applied to the order.
    - `applied_discount_amount` integer — This field shows the order-level discount applied.
    - `applied_discount_quantity` integer — Number of the discounted items applied in the transaction.
    - `applied_quantity` integer — Quantity of items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced.
    - `applied_quantity_amount` integer — Amount for the items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced.
    - `initial_amount` integer — 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.
    - `price` integer — Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
    - `subtotal_amount` integer — Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. `subtotal_amount`=`amount`-`applied_discount_amount`
    - `product` object — An object containing details of the related product.
      - `id` string — A unique identifier that represents the product and is assigned by Voucherify.
      - `source_id` string — The merchant's product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service.
      - `override` boolean — The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system.
      - `name` string — Product name.
      - `metadata` object — A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format. It can be used to create product collections.
      - `price` number — Product price. A positive integer in the smallest currency unit (e.g. 100 cents for $1.00).
    - `sku` object — An object containing details of the related SKU.
      - `id` string — A unique identifier that represents the SKU and is assigned by Voucherify.
      - `source_id` string — The merchant's SKU ID (if it is different than Voucherify's SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service.
      - `override` boolean — The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system.
      - `sku` string — The SKU name.
      - `price` number — SKU price. A positive integer in the smallest currency unit (e.g. 100 cents for $1.00).
      - `metadata` object — A set of custom key/value pairs that you can attach to an SKU. It can be useful for storing additional information about the SKU in a structured format. It can be used to create product collections.
    - `object` 'order_item', required — The type of the object represented by JSON.
    - `metadata` object — A set of custom key/value pairs that you can attach to an item object. It can be useful for storing additional information about the item in a structured format. It can be used to define business validation rules or discount formulas.

---

[API](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions.md) · [All operations](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voucherifyio/voucherify-api-async-actions/revisions/4982266e0494/schema)
