Skip to content

Customers

Your customers, identified by the same shop_customer_id you send on their orders.

Create a customer

Request

Creates a customer so you can open a reward for them before they have ever ordered. shop_customer_id is required, along with at least one of first_name, last_name, email or phone_number. The orders Onward later ingests for that customer update this same record instead of creating another.

A customer that already exists returns 409 with no body, and nothing is written. Treat 201 and 409 alike: both mean the customer now exists. Read it with GET /customers/{shopCustomerId} if you need the record after a 409.

Security
api_key
Headers
Content-Typestringrequired

Content-Type must be application/json

Example:application/json
Acceptstringrequired

Accept must be application/json

Example:application/json
Bodyapplication/jsonrequired
shop_customer_idstring, <= 255 charactersrequired

Your unique identifier for the Customer. For a Shopify shop, the numeric Shopify customer ID (6072418623), not the GID. Must be unique across your customers and stable over time — Onward uses it to look up and de-duplicate customers, so the same value must always refer to the same customer.

Example:"6072418623"
first_namestring or null, <= 255 characters
Example:"Sally"
last_namestring or null, <= 255 characters
Example:"Loo"
emailstring or null, (email), <= 255 characters
Example:"sally@example.com"
phone_numberstring or null, (phone), <= 255 characters
Example:"+13105551234"
curl -i -X POST \
  https://app.useonward.com/api/v1/customers \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -d '{
    "shop_customer_id": "6072418623",
    "first_name": "Sally",
    "last_name": "Loo",
    "email": "sally@example.com",
    "phone_number": "+13105551234"
  }'

Responses

The customer was created.

Bodyapplication/json
shop_customer_idstring, <= 255 charactersrequired

Your unique identifier for the Customer. For a Shopify shop, the numeric Shopify customer ID (6072418623), not the GID. Must be unique across your customers and stable over time — Onward uses it to look up and de-duplicate customers, so the same value must always refer to the same customer.

Example:"6072418623"
first_namestring or null, <= 255 characters
Example:"Sally"
last_namestring or null, <= 255 characters
Example:"Loo"
emailstring or null, (email), <= 255 characters
Example:"sally@example.com"
phone_numberstring or null, (phone), <= 255 characters
Example:"+13105551234"
rewardsArray of objects(Reward)required

Every reward this customer holds. Empty when they hold none.

Response
{ "shop_customer_id": "6072418623", "first_name": "Sally", "last_name": "Loo", "email": "sally@example.com", "phone_number": "+13105551234", "rewards": [ { … } ] }