v1

latestOpenAPI 3.0.1MIT2026-07-263151,3912.3 MB
Customers

Create Customer

Creates a customer object.

📘 Upsert Mode

If you pass an id or a source_id that already exists in the customer database, Voucherify will return a related customer object with updated fields.

post/v1/customers

Request body

idstring

The ID of an existing customer.

source_idstring

A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored.

namestring

Customer's first and last name.

descriptionstring

An arbitrary string that you can attach to a customer object.

emailstring

Customer's email address.

phonestring

Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel.

birthdaystring date

Deprecated. Customer's birthdate; format YYYY-MM-DD.

birthdatestring date

Customer's birthdate; format YYYY-MM-DD.

metadataobject

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.

idstring

The ID of an existing customer that will be linked to redemption in this request.

source_idstring

A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored.

system_metadataobject

Object used to store system metadata information.

created_atstring date-time

Timestamp representing the date and time when the customer was created. The value is shown in the ISO 8601 format.

updated_atstring date-time

Timestamp representing the date and time when the customer was updated. The value is shown in the ISO 8601 format.

object'customer' required

The type of the object represented by JSON.

namestring

Customer's first and last name.

descriptionstring

An arbitrary string that you can attach to a customer object.

emailstring

Customer's email address.

phonestring

Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel.

birthdaystring date

Deprecated. Customer's birthdate; format YYYY-MM-DD.

birthdatestring date

Customer's birthdate; format YYYY-MM-DD.

metadataobject

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.

Example response

{
  "summary": {
    "orders": {
      "last_order_date": "2022-08-30T11:51:08.029Z"
    }
  },
  "referrals": {
    "campaigns": [
      {
        "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal",
        "referrer_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi",
        "related_object_id": "r_0b9d4cc4aa164dd073",
        "date": "2022-08-30T10:19:39.196Z"
      }
    ]
  },
  "created_at": "2022-08-30T06:32:07.380Z",
  "updated_at": "2022-08-31T06:32:07.380Z"
}