Skip to main content
POST
/
external
/
customers
/
upsert
Upsert customer
curl --request POST \
  --url https://platform.runonatlas.com/external/customers/upsert \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "externalId": "external-customer-id-123",
  "billingAddress1": "123 Main St",
  "billingAddress2": "Apt 1",
  "billingCity": "Anytown",
  "billingCountry": "US",
  "billingState": "CA",
  "billingZipCode": "12345",
  "shippingAddress1": "123 Main St",
  "shippingAddress2": "Apt 1",
  "shippingCity": "Anytown",
  "shippingCountry": "US",
  "shippingState": "CA",
  "shippingZipCode": "12345",
  "email": "[email protected]",
  "name": "John Doe",
  "quickBooksId": "quickbooks-customer-id-123",
  "stripeId": "stripe-customer-id-123"
}
'
{
  "createdAt": "2021-01-01T00:00:00.000Z",
  "id": "atlas-internal-customer-id-123",
  "updatedAt": "2021-01-01T00:00:00.000Z",
  "merchantId": "atlas-internal-merchant-id-123",
  "billingAddress1": "123 Main St",
  "billingAddress2": "Apt 1",
  "billingCity": "Anytown",
  "billingCountry": "US",
  "billingState": "CA",
  "billingZipCode": "12345",
  "shippingAddress1": "123 Main St",
  "shippingAddress2": "Apt 1",
  "shippingCity": "Anytown",
  "shippingCountry": "US",
  "shippingState": "CA",
  "shippingZipCode": "12345",
  "email": "[email protected]",
  "externalId": "external-customer-id-123",
  "name": "John Doe",
  "quickBooksId": "quickbooks-customer-id-123",
  "stripeId": "stripe-customer-id-123"
}

Authorizations

x-api-key
string
header
required

You can obtain this key from the Atlas dashboard. It must be of type secret

Body

application/json
externalId
string
required

The external ID of the customer (e.g. the customer ID in your system)

Minimum string length: 1
Example:

"external-customer-id-123"

billingAddress1
string | null

Billing address line 1

Minimum string length: 1
Example:

"123 Main St"

billingAddress2
string | null

Billing address line 2

Minimum string length: 1
Example:

"Apt 1"

billingCity
string | null

Billing city

Minimum string length: 1
Example:

"Anytown"

billingCountry
string | null

Billing country

Minimum string length: 1
Example:

"US"

billingState
string | null

Billing state

Minimum string length: 1
Example:

"CA"

billingZipCode
string | null

Billing zip code. Must be 5 digits or 5+4 format.

Example:

"12345"

shippingAddress1
string | null

Shipping address line 1

Minimum string length: 1
Example:

"123 Main St"

shippingAddress2
string | null

Shipping address line 2

Minimum string length: 1
Example:

"Apt 1"

shippingCity
string | null

Shipping city

Minimum string length: 1
Example:

"Anytown"

shippingCountry
string | null

Shipping country

Minimum string length: 1
Example:

"US"

shippingState
string | null

Shipping state

Minimum string length: 1
Example:

"CA"

shippingZipCode
string | null

Shipping zip code. Must be 5 digits or 5+4 format.

Example:

"12345"

email
string<email> | null

The email of the customer

Minimum string length: 1
name
string | null

The name of the customer

Minimum string length: 1
Example:

"John Doe"

quickBooksId
string | null

The QuickBooks ID of the customer

Minimum string length: 1
Example:

"quickbooks-customer-id-123"

stripeId
string | null

The Stripe ID of the customer

Minimum string length: 1
Example:

"stripe-customer-id-123"

Response

The customer that has been upserted.

createdAt
string<date>
required

The date and time the customer was created

Example:

"2021-01-01T00:00:00.000Z"

id
string
required

The Atlas customer ID

Minimum string length: 1
Example:

"atlas-internal-customer-id-123"

updatedAt
string<date>
required

The date and time the customer was last updated

Example:

"2021-01-01T00:00:00.000Z"

merchantId
string
required

The Atlas merchant ID

Minimum string length: 1
Example:

"atlas-internal-merchant-id-123"

billingAddress1
string | null

Billing address line 1

Minimum string length: 1
Example:

"123 Main St"

billingAddress2
string | null

Billing address line 2

Minimum string length: 1
Example:

"Apt 1"

billingCity
string | null

Billing city

Minimum string length: 1
Example:

"Anytown"

billingCountry
string | null

Billing country

Minimum string length: 1
Example:

"US"

billingState
string | null

Billing state

Minimum string length: 1
Example:

"CA"

billingZipCode
string | null

Billing zip code. Must be 5 digits or 5+4 format.

Example:

"12345"

shippingAddress1
string | null

Shipping address line 1

Minimum string length: 1
Example:

"123 Main St"

shippingAddress2
string | null

Shipping address line 2

Minimum string length: 1
Example:

"Apt 1"

shippingCity
string | null

Shipping city

Minimum string length: 1
Example:

"Anytown"

shippingCountry
string | null

Shipping country

Minimum string length: 1
Example:

"US"

shippingState
string | null

Shipping state

Minimum string length: 1
Example:

"CA"

shippingZipCode
string | null

Shipping zip code. Must be 5 digits or 5+4 format.

Example:

"12345"

email
string<email> | null

The email of the customer

Minimum string length: 1
externalId
string | null

The external ID of the customer (e.g. the customer ID in your system)

Minimum string length: 1
Example:

"external-customer-id-123"

name
string | null

The name of the customer

Minimum string length: 1
Example:

"John Doe"

quickBooksId
string | null

The QuickBooks ID of the customer

Minimum string length: 1
Example:

"quickbooks-customer-id-123"

stripeId
string | null

The Stripe ID of the customer

Minimum string length: 1
Example:

"stripe-customer-id-123"