curl --request POST \
--url https://{cluster}.voucherify.io/v1/campaigns/{campaignId}/import \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
[
{
"code": "CODE7",
"category": "First",
"redemption": {
"quantity": 1
},
"metadata": {
"season": "Fall"
},
"additional_info": "secret-code1",
"active": true
},
{
"code": "CODE8",
"category": "Second",
"redemption": {
"quantity": 18
},
"metadata": {
"season": "Fall"
},
"additional_info": "secret-code1",
"active": true
},
{
"code": "CODE9",
"redemption": {
"quantity": 4
},
"metadata": {
"season": "Fall"
},
"additional_info": "secret-code1",
"active": true
}
]
'{
"async_action_id": "aa_0a875d56c805df6601"
}Import Vouchers to Campaign
Imports vouchers to an existing campaign.
This API request starts a process that affects Voucherify data in bulk.
In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window.
The result will return the async ID. You can verify the status of your request via this API request.
curl --request POST \
--url https://{cluster}.voucherify.io/v1/campaigns/{campaignId}/import \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
[
{
"code": "CODE7",
"category": "First",
"redemption": {
"quantity": 1
},
"metadata": {
"season": "Fall"
},
"additional_info": "secret-code1",
"active": true
},
{
"code": "CODE8",
"category": "Second",
"redemption": {
"quantity": 18
},
"metadata": {
"season": "Fall"
},
"additional_info": "secret-code1",
"active": true
},
{
"code": "CODE9",
"redemption": {
"quantity": 4
},
"metadata": {
"season": "Fall"
},
"additional_info": "secret-code1",
"active": true
}
]
'{
"async_action_id": "aa_0a875d56c805df6601"
}Authorizations
Scopes
Path Parameters
Body
Discount type, expiration date and the remaining attributes will be taken from the Campaign settings.
- Voucher Import Loyalty Card
- Voucher Import Gift
- Voucher Import Discount
Object model for gift card object being imported.
Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.
Activation timestamp presented in the ISO 8601 format. Voucher is inactive before this date. Start date defines when the code starts to be active. Allowed date formats are:
- YYYY-MM-DD
- YYYY-MM-DDTHH
- YYYY-MM-DDTHH:mm
- YYYY-MM-DDTHH:mm:ss
- YYYY-MM-DDTHH:mm:ssZ
- YYYY-MM-DDTHH:mm:ss.SSSZ
"2020-12-28T12:49:16.272Z"
Expiration date defines when the code expires. Expiration timestamp is presented in the ISO 8601 format. Voucher is inactive after this date. Allowed date formats are:
- YYYY-MM-DD
- YYYY-MM-DDTHH
- YYYY-MM-DDTHH:mm
- YYYY-MM-DDTHH:mm:ss
- YYYY-MM-DDTHH:mm:ssZ
- YYYY-MM-DDTHH:mm:ss.SSSZ
"2053-12-28T12:49:16.272Z"
Response
Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the vouchers will be imported to the repository asynchronously. To check the status and result, copy the async_action_id from the response and pass it using Get Async Action endpoint.

