Skip to main content
POST
/
v1
/
vouchers
/
bulk
/
async
Update Vouchers in Bulk
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/vouchers/bulk/async \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '[
  {
    "code": "example_code",
    "metadata": {
      "lang": "en",
      "test": false,
      "MetadataTest": "Update metadata",
      "update_value": 1,
      "next_update_date": "2022-11-11T09:00:00.000Z"
    }
  },
  {
    "code": "example_code2",
    "metadata": {
      "lang": "pl",
      "test": false,
      "MetadataTest": "Update metadata",
      "update_value": 2
    }
  }
]'
{
  "async_action_id": "aa_0ab2df092385be5ca5"
}

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

application/json Β· Vouchers Update In Bulk Request Body Item Β· object[]

List the codes to be updated with the metadata key/value pairs for that code.

Request body schema for POST v1/vouchers/bulk/async.

code
string
required

Unique voucher code.

metadata
object
required

The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format.

Response

Returns the ID of the scheduled asynchronous action. The response informs you that the request has been accepted and the resources will be updated in the repository asynchronously. To check the status and result, copy the async_action_id from the response and use it as a query parameter in the GET Async Action endpoint.

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

async_action_id
string
required

The ID of the scheduled asynchronous action.

Example:

"aa_0a875d56c805df6601"

⌘I