POST /v1/promotion_codes

A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/x-www-form-urlencoded"

Request body fields

Name Type Required Description
customer String No

The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers.

restrictions Object No

Settings that restrict the redemption of the promotion code.

restrictions.minimum_amount_currency String No
restrictions.currency_options Object No
restrictions.currency_options.name Object No
restrictions.currency_options.name.minimum_amount Integer No
restrictions.first_time_transaction Boolean No
restrictions.minimum_amount Integer No
active Boolean No

Whether the promotion code is currently active.

expand[] Array No

Specifies which fields in the response should be expanded.

max_redemptions Integer No

A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified a max_redemptions, then this value cannot be greater than the coupon's max_redemptions.

coupon String Yes

The coupon for this promotion code.

metadata Object No

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

code String No

The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9).

If left blank, we will generate one automatically.

expires_at Integer No

The timestamp at which this promotion code will expire. If the coupon has specified a redeems_by, then this value cannot be after the coupon's redeems_by.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.