The Voucherify Developer Hub

Welcome to the Voucherify developer hub. You'll find comprehensive guides and documentation to help you start working with Voucherify as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started

Some promotions might depend on the purchase history of customers. To model these scenarios in Voucherify, you can use the Order object. An order stores the cart structure (products and SKUs), the total amount of a transaction, and status: CREATED, PAID, CANCELED, FULFILLED. You can track orders in the Dashboard and with the API.

๐Ÿ“˜

Object definition

Order object reference

Mapping your order workflow

We designed the order entity so that it helps you map your e-commerce process. Go through these concepts to understand how you can integrate orders into your workflow:

  • Similarly to the customer object, orders can be identified by your internal id; to do so, use source_id field.
  • An order can be created in two ways:
  1. By passing order as payload in redemption.
  2. With order endpoint. You can later link this order to a corresponding redemption with id or source_id. In this case, it's not necessary to provide the payload again โ€“ if you do so, however, the object will be upserted.
  • If you provide the status field in the redemption payload, it will override a linked order status.
  • If a redemption request is successful, Voucherify will set a related order to PAID.
  • Otherwise, the status will remain the same or will get the value from the request payload.
  • A successful rollback operation will set the order to CANCELED.
  • If this behavior is not expected, you should pass the status field (e.g. PAID) in the request body of the rollback request.

Order-based validation rules

Validation rules can work with orders twofold:

  • Introduce thresholds on cart structure and a total amount.
  • Count the number of purchases in a timeframe or total amount of these purchases.

See validation rules for more details.

Updated 5 days ago

Orders


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.