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

Export voucher codes to Excel

Starts an asynchronous Excel export of the voucher codes of a basket offer and returns a cache_key that is polled on GET /bulk_voucher_codes/excel_export_status/ until the file is ready.

Any list filters (for example status or code) may be passed as additional query parameters and are applied to the exported queryset. In the resulting worksheet, the code column is titled voucher_code and the user__email column is titled user_email.

get
/bulk_voucher_codes/excel_export/
Authorizations
AuthorizationstringRequired

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

Query parameters
basket_offerintegerRequired

The identifier of the basket offer whose codes are exported. When missing, the request is rejected with 404.

limitintegerOptional

The maximum number of codes to export. Non-numeric values fall back to the default.

Default: 10
fieldsstring[]Optional

The code fields to include as worksheet columns. May be repeated (_fields is accepted as an alias). Defaults to code, status, and user__email.

Default: ["code","status","user__email"]
Responses
200

The export job was queued.

application/json

The status envelope of an asynchronous Excel export.

cache_keystring · uuidOptional

The job key used to poll the export status.

is_readybooleanOptional

Whether the export file is ready for download.

urlstring · nullableOptional

The download URL of the generated file, present once is_ready is true.

error_messagestring · nullableOptional

A human-readable error message when the export failed or was not found.

get/bulk_voucher_codes/excel_export/
GET /api/remote/1/bulk_voucher_codes/excel_export/?basket_offer=1 HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Accept: */*
{
  "cache_key": "123e4567-e89b-12d3-a456-426614174000",
  "is_ready": true,
  "url": null,
  "error_message": null
}

Last updated

Was this helpful?