Skip to main content
POST
/
v1
/
customers
/
metadata
/
async
Update Customers' Metadata in Bulk
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/customers/metadata/async \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '{
  "source_ids": [
    "source_123",
    "source_456"
  ],
  "metadata": {
    "lang": "en",
    "test": false
  }
}'
{
  "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

application/json

List the source_ids of the customers you would like to update with the metadata key/value pairs.

Request body schema for POST v1/customers/metadata/async.

source_ids
string[]
required

An array of customer source_id's.

metadata
object
required

Metadata key value pairs to be updated. A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.

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/customers/metadata/async. Response to requests that are processed asynchronously.

async_action_id
string
required

The ID of the scheduled asynchronous action.

Example:

"aa_0a875d56c805df6601"

I