Customers API

A customer in the Inveterate system is anyone that has purchased an Inveterate subscription product from this merchant's store.

A customer is represented as an object with the following structure:

{
  accountState: String, // from Shopify
  contractId: Number,
  createdAt: String,
  credit: Number,
  customerId: String,
  email: String,
  firstName: String,
  lastName: String,
  orderCount: Number,
  orderIds: Array[Number]
  merchantId: String,
  status: String, // status of Inveterate subscription
  totalSpend: Number,
  updatedAt: String
}

Endpoints & Methods

Get a single customer

GET https://public.inveterateapi.com/customers/{customerId}

Gets a single customer.

Path Parameters

Name
Type
Description

customerId*

String

The Shopify ID for a specific customer.

Headers

Name
Type
Description

X-Inveterate-Api-Key*

String

Required to access all protected endpoints on this API. Obtained from merchant's Inveterate dashboard.

Get all customers

GET https://api.inveterate.com/2022-01/customers

Query Parameters

Name
Type
Description

limit

Int

Amount of customers to return per request. Default is no limit. Max is 100.

lastCustomerId

Int

Used to determine the index offset of which customers to return.

Headers

Name
Type
Description

X-Inveterate-Api-Key*

String

Required to access all protected endpoints on this API. Obtained from merchant's Inveterate dashboard.

Get Customers (Paginated)

Optionally using the limit and lastCustomerId query string parameters, you can "paginate" through the customer records returned.

For the first page, just add the limit parameter. The response for this will include the lastCustomerId, which needs to be added as a query string parameter to the request for page 2.

Page 1 request example

Page 1 response example

Page 2 request example

Page 2 response example

Cancel Customer Subscription

Request customer cancellation

POST https://public.inveterateapi.com/customers/{customerId}/cancel

Step 1 of the customer's subscription cancellation process. A successful request to this endpoint submits a customer cancellation request. Customer will receive an email with a link to confirm cancellation of their subscription.

Request Body

Name
Type
Description

merchantId*

String

Last updated

Was this helpful?