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.
Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.
The identifier of the basket offer whose codes are exported. When missing, the request is rejected with 404.
The maximum number of codes to export. Non-numeric values fall back to the default.
10The code fields to include as worksheet columns. May be repeated (_fields is accepted as an alias). Defaults to code, status, and user__email.
["code","status","user__email"]The export job was queued.
The status envelope of an asynchronous Excel export.
The job key used to poll the export status.
Whether the export file is ready for download.
The download URL of the generated file, present once is_ready is true.
A human-readable error message when the export failed or was not found.
Authentication credentials were not provided or are invalid.
The authenticated user does not have administrator privileges.
The basket_offer query parameter was not provided.
GET /api/v1/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?

