Skip to main content
POST
/
v1
/
vouchers
/
importCSV
Import Vouchers using CSV
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/vouchers/importCSV \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --form webhooks_enable=true \
  --form file=@example-file
{
  "async_action_id": "aa_0a875d56c805df6601"
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

multipart/form-data

The file path is stored in the form file header.

Request body schema for POST v1/vouchers/importCSV. Request body schema for importing data using a CSV file.

file
file
required

File path.

webhooks_enable
boolean

Triggers a webhook sendout for new and updated vouchers if the voucher created and voucher updated webhooks are configured in Project settings.

Response

Returns ID of the scheduled async action. The response informs you that your request has been accepted and vouchers will be added to the repository asynchronously. To check the import status and result, copy the async_action_id from the response and pass it using the <!-- [Get Async Action](OpenAPI.json/paths/~1async-actions~1{asyncActionId}/get) -->Get Async Action endpoint.

Response body schema for POST v1/vouchers/importCSV. Response to requests that are processed asynchronously.

async_action_id
string
required

The ID of the scheduled asynchronous action.

Example:

"aa_0a875d56c805df6601"

I