curl --request PUT \
--url https://{cluster}.voucherify.io/v1/customers/{customerId} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "Alice McDonald",
"email": "alice.mdconald@email.com",
"description": "Updating customer data",
"phone": "+1 (132) 222-2222",
"address": {
"city": "New York",
"country": "United States",
"line_1": "123 Main St.",
"line_2": "APT 3 BLG 4",
"postal_code": "10001",
"state": "NY"
},
"metadata": {
"lang": "en",
"test": true
},
"birthdate": "2022-01-01",
"birthday": "2022-01-02"
}
'{
"id": "cust_T849EgzNVVmn5icJ2FAkT2rO",
"source_id": "alice@morgan.com",
"name": "Alice McDonald",
"description": "Updating customer data",
"email": "alice.mdconald@email.com",
"phone": "+1 (132) 222-2222",
"birthday": "2022-01-02",
"birthdate": "2022-01-01",
"address": {
"city": "New York",
"state": "NY",
"line_1": "123 Main St.",
"line_2": "APT 3 BLG 4",
"country": "United States",
"postal_code": "10001"
},
"summary": {
"redemptions": {
"total_redeemed": 2,
"total_failed": 0,
"total_succeeded": 2,
"total_rolled_back": 0,
"total_rollback_failed": 0,
"total_rollback_succeeded": 0,
"gift": {
"redeemed_amount": 0,
"amount_to_go": 0
},
"loyalty_card": {
"redeemed_points": 0,
"points_to_go": 4428
}
},
"orders": {
"total_amount": 203900,
"total_count": 2,
"average_amount": 101950,
"last_order_amount": 3900,
"last_order_date": "2022-07-26T14:59:52.814Z"
}
},
"loyalty": {
"points": 3403,
"referred_customers": 0,
"campaigns": {
"Summer Campaign": {
"points": 0,
"referred_customers": 0
},
"Spring Campaign": {
"points": 50,
"referred_customers": 0
},
"Fall Campaign": {
"points": 50,
"referred_customers": 0
},
"Winter Campaign": {
"points": 3303,
"referred_customers": 0
}
}
},
"referrals": {
"total": 0,
"campaigns": []
},
"metadata": {
"lang": "en",
"test": true
},
"system_metadata": {},
"created_at": "2022-02-07T08:28:23.644Z",
"updated_at": "2022-08-31T09:58:30.475Z",
"object": "customer"
}{
"code": 404,
"key": "not_found",
"message": "Resource not found",
"details": "Cannot find customer with id alice2@morgan.com",
"request_id": "v-0b9e924dd243bf26e2",
"resource_id": "alice2@morgan.com",
"resource_type": "customer"
}Update Customer
Updates the specified customer by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.
curl --request PUT \
--url https://{cluster}.voucherify.io/v1/customers/{customerId} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "Alice McDonald",
"email": "alice.mdconald@email.com",
"description": "Updating customer data",
"phone": "+1 (132) 222-2222",
"address": {
"city": "New York",
"country": "United States",
"line_1": "123 Main St.",
"line_2": "APT 3 BLG 4",
"postal_code": "10001",
"state": "NY"
},
"metadata": {
"lang": "en",
"test": true
},
"birthdate": "2022-01-01",
"birthday": "2022-01-02"
}
'{
"id": "cust_T849EgzNVVmn5icJ2FAkT2rO",
"source_id": "alice@morgan.com",
"name": "Alice McDonald",
"description": "Updating customer data",
"email": "alice.mdconald@email.com",
"phone": "+1 (132) 222-2222",
"birthday": "2022-01-02",
"birthdate": "2022-01-01",
"address": {
"city": "New York",
"state": "NY",
"line_1": "123 Main St.",
"line_2": "APT 3 BLG 4",
"country": "United States",
"postal_code": "10001"
},
"summary": {
"redemptions": {
"total_redeemed": 2,
"total_failed": 0,
"total_succeeded": 2,
"total_rolled_back": 0,
"total_rollback_failed": 0,
"total_rollback_succeeded": 0,
"gift": {
"redeemed_amount": 0,
"amount_to_go": 0
},
"loyalty_card": {
"redeemed_points": 0,
"points_to_go": 4428
}
},
"orders": {
"total_amount": 203900,
"total_count": 2,
"average_amount": 101950,
"last_order_amount": 3900,
"last_order_date": "2022-07-26T14:59:52.814Z"
}
},
"loyalty": {
"points": 3403,
"referred_customers": 0,
"campaigns": {
"Summer Campaign": {
"points": 0,
"referred_customers": 0
},
"Spring Campaign": {
"points": 50,
"referred_customers": 0
},
"Fall Campaign": {
"points": 50,
"referred_customers": 0
},
"Winter Campaign": {
"points": 3303,
"referred_customers": 0
}
}
},
"referrals": {
"total": 0,
"campaigns": []
},
"metadata": {
"lang": "en",
"test": true
},
"system_metadata": {},
"created_at": "2022-02-07T08:28:23.644Z",
"updated_at": "2022-08-31T09:58:30.475Z",
"object": "customer"
}{
"code": 404,
"key": "not_found",
"message": "Resource not found",
"details": "Cannot find customer with id alice2@morgan.com",
"request_id": "v-0b9e924dd243bf26e2",
"resource_id": "alice2@morgan.com",
"resource_type": "customer"
}Authorizations
Scopes
Path Parameters
Body
Specify the parameters to be updated.
Request body schema for PUT v1/customers/{customerId}.
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 a customer object if updates were successful.
Response body schema for PUT v1/customers/{customerId}.
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.

