Vouchers

A voucher is a discount offer — a percentage or a fixed amount off the basket, with an optional minimum amount and validity period — together with the codes your customers type at checkout to use it. When you move from another tool, import your running vouchers and the codes you have already sent so that they keep working in your shop, then read each voucher back to check it.

Both endpoints need a key holding the promotion:read (read) or promotion:write (import) scope.

Endpoints

MethodPathScopeBatch limit
POST/v1/voucher/importpromotion:write50 vouchers and 500 codes per request
GET/v1/voucher/importpromotion:readOne voucher

The voucher object

FieldTypeDescription
idstringThe voucher's identifier in your shop, prefixed prom_.
objectstringAlways promotion.
external_idstringThe voucher's reference in your former system.
projectstringYour shop's identifier.
statusstringdraft, scheduled, activated, paused, expired or archived; deleted once deleted in your workspace.
namestringThe voucher's name.
typestringpercentage or fixed_amount.
valuestringThe discount: a percentage or an amount, as a decimal string such as "15.00".
currencystringThe currency code of a fixed amount, such as EUR.
min_amountstringThe minimum basket amount, as a decimal string. "0.00" for none.
audiencestringall, segment or consumer.
starts_atintegerStart of validity, in Unix seconds. 0 for none.
ends_atintegerEnd of validity, in Unix seconds. 0 for none.
created_atintegerCreation time, in Unix seconds.
updated_atintegerLast change, in Unix seconds.
codesarrayEvery code of the voucher, sorted by code.

Each entry of codes:

FieldTypeDescription
idstringThe code's identifier in your shop, prefixed prco_.
objectstringAlways promotion_code.
external_idstringThe code's reference in your former system; empty for a code created in your workspace.
statusstringactivated, or deleted once deleted in your workspace.
codestringThe code the customer types.
customerstringThe identifier in your shop of the customer the code is reserved for (cust_…); empty for a public code.
usage_limitintegerHow many times the code can be used. 0 means unlimited.
usage_countintegerHow many times the code has been used.
starts_atintegerStart of validity, in Unix seconds. 0 for none.
expires_atintegerExpiry, in Unix seconds. 0 for none.
created_atintegerCreation time, in Unix seconds.
updated_atintegerLast change, in Unix seconds.

Import vouchers

POST /v1/voucher/import creates or updates up to 50 vouchers per request, each with its codes. It follows the shared import contract described in Your first API call: items, dry_run, a line-by-line report.

Voucher fields

FieldTypeRequiredDescription
external_idstringYesYour reference for the voucher, up to 50 characters, unique in the batch. The voucher is recognised by it on every later import.
namestringNoUp to 190 characters.
typestringNopercentage or fixed_amount.
valuenumber or stringNoThe discount, zero or more, with up to 2 decimals. At most 100 for a percentage voucher.
min_amountnumber or stringNoThe minimum basket amount, zero or more.
currencystringNoA currency code of 3 to 10 letters, such as EUR.
starts_atintegerNoStart of validity, in Unix seconds.
ends_atintegerNoEnd of validity, in Unix seconds.
audiencestringNoall, segment or consumer.
statusstringNodraft, scheduled, activated, paused, expired or archived. A new voucher without a status is created as draft; an existing one keeps its status.
created_atintegerNoThe original creation time, in Unix seconds. Kept as sent and never changed by a later import.
codesarrayNoThe voucher's codes (see below).

Code fields

FieldTypeRequiredDescription
external_idstringYesYour reference for the code, up to 50 characters, unique in the whole batch.
codestringYesThe code the customer types, 1 to 190 characters. A code is unique across the shop, without regard to case or accents.
customer_external_idstringNoThe external_id of an already imported customer, to reserve the code for that customer. Leave it out for a public code.
usage_limitintegerNoHow many times the code can be used; 0 (the default) means unlimited.
usage_countintegerNoHow many times the code has already been used. Left unchanged when you leave it out.
starts_atintegerNoStart of validity, in Unix seconds.
expires_atintegerNoExpiry, in Unix seconds.
statusstringNoOnly activated is accepted.
created_atintegerNoThe original creation time, in Unix seconds.

An invalid code refuses its whole voucher, and a voucher is saved together with all its codes or not at all. Codes you leave out of a later import are never removed: to send a voucher with more than 500 codes, split its codes over several requests that repeat the voucher's external_id.

Important — Import the customers first: a code whose customer_external_id matches no customer of your shop is refused with Import the customers first. See Orders & logistics.

The import report

Each accepted entry of data adds two fields to the shared report:

FieldTypeDescription
codesobjectThe number of the voucher's codes created, updated and unchanged.
codes_detailarrayOne entry per code: its external_id, its action and its id (null for a creation in a dry run).

A refused entry carries only the eight shared fields. A code already held by another code of the shop refuses its voucher with code 409. A voucher whose codes changed is reported as updated, even if its own fields did not.

Example

curl
curl https://api.ultineo.com/v1/voucher/import \
  -H "Authorization: Bearer sk-project-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dry_run": false,
    "items": [
      {
        "external_id": "SPRING-2026",
        "name": "Spring sale",
        "type": "percentage",
        "value": 15,
        "min_amount": "50.00",
        "currency": "EUR",
        "audience": "all",
        "status": "activated",
        "starts_at": 1774998000,
        "ends_at": 1777590000,
        "codes": [
          { "external_id": "SPRING-2026-PUBLIC", "code": "SPRING15", "usage_limit": 0, "usage_count": 42 },
          { "external_id": "SPRING-2026-C1001", "code": "SPRING15-MARTIN", "customer_external_id": "C1001", "usage_limit": 1 }
        ]
      }
    ]
  }'
application/json
{
  "code": 200,
  "title": "OK",
  "response": {
    "object": "list",
    "resource": "promotion",
    "dry_run": false,
    "data": [
      {
        "index": 0,
        "external_id": "SPRING-2026",
        "action": "created",
        "id": "prom_8d2c5e41a0b7f39e6c14",
        "code": null,
        "title": null,
        "reason": null,
        "notice": [],
        "codes": { "created": 2, "updated": 0, "unchanged": 0 },
        "codes_detail": [
          { "external_id": "SPRING-2026-PUBLIC", "action": "created", "id": "prco_1f6a93c0d4e8b2a75e31" },
          { "external_id": "SPRING-2026-C1001", "action": "created", "id": "prco_7b04e2d9a6c1f835b0d2" }
        ]
      }
    ],
    "created": 1,
    "updated": 0,
    "unchanged": 0,
    "refused": 0,
    "total": 1
  }
}

Read a voucher

GET /v1/voucher/import returns one voucher with all its codes, including how many times each code has been used.

ParameterInDescription
external_idqueryThe voucher's reference in your former system. Takes precedence over id.
idqueryThe voucher's identifier in your shop, prefixed prom_.

Give one of the two; with neither, the call answers 400 Missing required parameter: external_id. A voucher that is not in your shop answers 404 Promotion not found.

curl
curl "https://api.ultineo.com/v1/voucher/import?external_id=SPRING-2026" \
  -H "Authorization: Bearer sk-project-YOUR_KEY"
application/json
{
  "code": 200,
  "title": "OK",
  "response": {
    "id": "prom_8d2c5e41a0b7f39e6c14",
    "object": "promotion",
    "external_id": "SPRING-2026",
    "project": "proj_5a91c7e03d2b48f6a1e9",
    "status": "activated",
    "name": "Spring sale",
    "type": "percentage",
    "value": "15.00",
    "currency": "EUR",
    "min_amount": "50.00",
    "audience": "all",
    "starts_at": 1774998000,
    "ends_at": 1777590000,
    "created_at": 1774998000,
    "updated_at": 1791745200,
    "codes": [
      {
        "id": "prco_1f6a93c0d4e8b2a75e31",
        "object": "promotion_code",
        "external_id": "SPRING-2026-PUBLIC",
        "status": "activated",
        "code": "SPRING15",
        "customer": "",
        "usage_limit": 0,
        "usage_count": 42,
        "starts_at": 0,
        "expires_at": 0,
        "created_at": 1774998000,
        "updated_at": 1791745200
      },
      {
        "id": "prco_7b04e2d9a6c1f835b0d2",
        "object": "promotion_code",
        "external_id": "SPRING-2026-C1001",
        "status": "activated",
        "code": "SPRING15-MARTIN",
        "customer": "cust_c3e9a1074b5d28f6e0a7",
        "usage_limit": 1,
        "usage_count": 0,
        "starts_at": 0,
        "expires_at": 0,
        "created_at": 1774998000,
        "updated_at": 1791745200
      }
    ]
  }
}

Note — Only percentage and fixed-amount vouchers are imported. Free shipping, gifts, product or segment targeting and the history of each use of a code are managed in your workspace and are not available through the API. The API does not delete a voucher or a code either.