Try it

Upsert a customer with predefined ID

Create or update (upsert) a customer with predefined identifier string. Read our guide to preventing duplicates to understand more.

Authorizations:
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Request Body schema: application/json

Customer resource.

websiteId
string <= 50 characters

The website's ID.

paymentToken
string

A write-only payment token; if supplied, it will be converted into a payment instrument and be set as the defaultPaymentInstrument. The value of this property will override the defaultPaymentInstrument in the case that both are supplied. The token may only be used once before it is expired.

defaultPaymentInstrument
VaultedInstrument (object) or AlternativePaymentInstrument (object) or CashInstrument (object) or CheckInstrument (object) (PaymentInstrument)
customFields
object (ResourceCustomFields)
Default: {}

Custom Fields list as a map {"custom field name": "custom field value", ...}. The format must follow the saved format (see Custom Fields section for the formats).

primaryAddress
object (ContactObject)

Responses

200

Customer.

201

Customer.

401

Unauthorized access, invalid credentials was used.

403

Access forbidden.

409

Conflict.

422

Invalid data was sent.

put /customers/{id}

Sandbox Server.

https://api-sandbox.rebilly.com/customers/{id}

Live Server.

https://api.rebilly.com/customers/{id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "websiteId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "paymentToken": "string",
  • "defaultPaymentInstrument":
    {
    },
  • "customFields":
    {
    },
  • "primaryAddress":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "websiteId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "defaultPaymentInstrument":
    {
    },
  • "createdTime": "2021-01-25T19:24:38Z",
  • "updatedTime": "2021-01-25T19:24:38Z",
  • "customFields":
    {
    },
  • "primaryAddress":
    {
    },
  • "averageValue":
    {
    },
  • "paymentCount": 0,
  • "lastPaymentTime": "2021-01-25T19:24:38Z",
  • "lifetimeRevenue":
    {
    },
  • "invoiceCount": 0,
  • "tags":
    [
    ],
  • "revision": 0,
  • "_links":
    [
    ],
  • "_embedded":
    [
    ]
}