For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create a bulk voucher code

Manually adds a single voucher code to a basket offer, optionally assigning it to a user.

The code is always created in active status; a status value sent in the request is ignored.

Business rules:

  • The code value must be unique across all bulk voucher codes (promotion_100_2).

  • A user can hold at most one code per basket offer; assigning a second code to the same user for the same offer is rejected (promotion_100_6).

post
/bulk_voucher_codes/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Body

The payload accepted when creating or updating a bulk voucher code.

codestring · max: 32Required

The voucher code value. Must be unique across all bulk voucher codes.

basket_offerintegerRequired

Identifier of the parent basket offer.

statusstring · enumRequired

The lifecycle status of a voucher code.

  • active — the code can be redeemed; new codes always start here
  • passive — the code is disabled
  • used — the code has been redeemed and can no longer be updated
  • revoked — the code has been withdrawn
Possible values:
userinteger · nullableOptional

Identifier of the user the code is assigned to, when any. A user can hold at most one code per basket offer.

Responses
201

The created voucher code.

application/json

A bulk voucher code as returned by the API.

pkintegerOptional

Unique voucher code identifier.

codestringOptional

The voucher code value.

basket_offerintegerOptional

Identifier of the parent basket offer.

statusstring · enumOptional

The lifecycle status of a voucher code.

  • active — the code can be redeemed; new codes always start here
  • passive — the code is disabled
  • used — the code has been redeemed and can no longer be updated
  • revoked — the code has been withdrawn
Possible values:
userinteger · nullableOptional

Identifier of the user the code is assigned to, when any.

user_emailstring · nullableOptional

Email address of the assigned user, when any.

post/bulk_voucher_codes/
POST /api/remote/1/bulk_voucher_codes/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 62

{
  "code": "text",
  "basket_offer": 1,
  "status": "active",
  "user": null
}
{
  "pk": 1041,
  "code": "KOTON9AB3FF76",
  "basket_offer": 35763,
  "status": "active",
  "user": 20518,
  "user_email": "customer@example.com"
}

Last updated

Was this helpful?