Upsert a customer

Creates or updates (upserts) a customer with a specified ID.

If the customer already has an identifier within your system, and you want to create a customer with a specified ID — use this operation to prevent duplicate customers. For more information, see Prevent duplicate customers.

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

ID of the resource.

Request Body schema: application/json

Customer resource.

websiteId
string <= 50 characters

ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID.

paymentToken
string

Write-only payment token. If supplied, the token is converted into a payment instrument and set as the defaultPaymentInstrument value. If both are supplied, the value of this property overrides the defaultPaymentInstrument value. The token expires after first use.

(Vaulted instrument (object or null)) or (Alternative instrument (object or null)) or (Cash (object or null)) or (Check (object or null))

Default payment instrument information.

customFields
object (ResourceCustomFields)
Default: {}

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

object or null

Customer's primary address.

isEddRequired
boolean
Default: false

Specifies if Enhanced Due Diligence (EDD) is enabled for this customer. For more information, see Enhanced Due Diligence.

Array of objects or null (TaxNumber)

Tax numbers of the customer.

Responses
200

Customer.

Response Schema: application/json
id
string <= 50 characters

ID of the customer.

email
string or null <email>

Customer's email address.

firstName
string or null

Customer's first name.

lastName
string or null

Customer's last name.

websiteId
string <= 50 characters

ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID.

(Vaulted instrument (object or null)) or (Alternative instrument (object or null)) or (Cash (object or null)) or (Check (object or null))

Default payment instrument information.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

customFields
object (ResourceCustomFields)
Default: {}

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

object or null

Customer's primary address.

object or null (Company)

Company information that is associated with the customer's primary email address domain.

This is a paid feature, to enable it contact Rebilly.

object (CustomerAverageValue)

Average customer value.

paymentCount
integer

Total number of approved payments made by the customer.

lastPaymentTime
string or null <date-time>

Time and date of the customer's last approved payment.

object (CustomerLifetimeRevenue)

Customer's lifetime revenue.

invoiceCount
integer

Total number of invoices issued to the customer. This value is auto-incrementing. If this value is 0, the record relates to a lead. A lead is a customer who has not made a payment yet. If this value is greater than or equal to 1 the record relates to a customer.

Array of objects (Tag)

List of customer tags.

revision
integer

Number of times the customer's data has been modified.

Use this value when analyzing webhook data to determine if a change must take precedence over the current representation.

isEddRequired
boolean
Default: false

Specifies if Enhanced Due Diligence (EDD) is enabled for this customer. For more information, see Enhanced Due Diligence.

hasFulfilledKyc
boolean

Specifies if the customer has accepted and reviewed identity and address documents, or an accepted credit file document.

organizationId
string <= 50 characters

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Array of objects or null (TaxNumber)

Tax numbers of the customer.

Array of objects

Related links.

object

Embedded objects that are requested using the expand query string parameter.

201

Customer with a specified ID created.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
id
string <= 50 characters

ID of the customer.

email
string or null <email>

Customer's email address.

firstName
string or null

Customer's first name.

lastName
string or null

Customer's last name.

websiteId
string <= 50 characters

ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID.

(Vaulted instrument (object or null)) or (Alternative instrument (object or null)) or (Cash (object or null)) or (Check (object or null))

Default payment instrument information.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

customFields
object (ResourceCustomFields)
Default: {}

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

object or null

Customer's primary address.

object or null (Company)

Company information that is associated with the customer's primary email address domain.

This is a paid feature, to enable it contact Rebilly.

object (CustomerAverageValue)

Average customer value.

paymentCount
integer

Total number of approved payments made by the customer.

lastPaymentTime
string or null <date-time>

Time and date of the customer's last approved payment.

object (CustomerLifetimeRevenue)

Customer's lifetime revenue.

invoiceCount
integer

Total number of invoices issued to the customer. This value is auto-incrementing. If this value is 0, the record relates to a lead. A lead is a customer who has not made a payment yet. If this value is greater than or equal to 1 the record relates to a customer.

Array of objects (Tag)

List of customer tags.

revision
integer

Number of times the customer's data has been modified.

Use this value when analyzing webhook data to determine if a change must take precedence over the current representation.

isEddRequired
boolean
Default: false

Specifies if Enhanced Due Diligence (EDD) is enabled for this customer. For more information, see Enhanced Due Diligence.

hasFulfilledKyc
boolean

Specifies if the customer has accepted and reviewed identity and address documents, or an accepted credit file document.

organizationId
string <= 50 characters

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Array of objects or null (TaxNumber)

Tax numbers of the customer.

Array of objects

Related links.

object

Embedded objects that are requested using the expand query string parameter.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

409

Conflict.

422

Invalid data sent.

put/customers/{id}
Request samples
application/json
{
  • "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
  • "paymentToken": "string",
  • "defaultPaymentInstrument": {
    },
  • "customFields": {
    },
  • "primaryAddress": {
    },
  • "isEddRequired": false,
  • "taxNumbers": [
    ]
}
Response samples
application/json
{
  • "id": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
  • "email": "user@example.com",
  • "firstName": "string",
  • "lastName": "string",
  • "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
  • "defaultPaymentInstrument": {
    },
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "customFields": {
    },
  • "primaryAddress": {
    },
  • "company": {
    },
  • "averageValue": {
    },
  • "paymentCount": 0,
  • "lastPaymentTime": "2019-08-24T14:15:22Z",
  • "lifetimeRevenue": {
    },
  • "invoiceCount": 0,
  • "tags": [
    ],
  • "revision": 0,
  • "isEddRequired": false,
  • "hasFulfilledKyc": true,
  • "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8",
  • "taxNumbers": [
    ],
  • "_links": [
    ],
  • "_embedded": {
    }
}