Bulk add voucher codes
POST
/shops/{id}/vouchers/batches/{batch_id}/codes
const url = 'https://example.com/shops/example/vouchers/batches/example/codes';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '[{"code":"example","link":"example"}]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/shops/example/vouchers/batches/example/codes \ --header 'Content-Type: application/json' \ --data '[ { "code": "example", "link": "example" } ]'Add voucher codes to a batch in bulk. Accepts an array of { code, link? } objects. A plain array of code strings is also accepted but deprecated — migrate to the object form, which lets you attach a per-code link. The response echoes the shape you sent.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
batch_id
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
Any of:
Deprecated: send an array of { code, link? } objects instead. A plain array of code strings is still accepted for older clients.
Array<string>
Examplegenerated
[ { "code": "example", "link": "example" }]