Customer: update and creation

How to create, update, and delete a customer using our API

Our API offers a specialized endpoint to manage the creation and modification of customer and loyalty data. This endpoint supports a range of updates at the same API call.

It uses the email as the primary identifier of the customer and an enum to specify which part of the customer's information needs to be updated.

Endpoint

To handle the customers, you have the same endpoint to add multiple customers at the same time and to delete them one by one.

POST https://api.jericommerce.com/v1/programs/{programId}/integrations/api

You should replace the {programId} for your real program id that you could find on jericommerce settings > technical.

This endpoint is secured by an authorization header. Please review our documentation.


Create and Update

To create or add customers, we use a POST request that accepts an array of objects.
This allows you to send up to 100 customers with a single API call.

If one of the customers works well, return a 201. If all of them fail, return a 404.

The main keys for each object are the customer's email and the feature name, which is always "users" and the payload that includes the information to add or update for a customer.

Here is the structure of the JSON:

1[
2  {
3    "email": "string",
4    "feature": "users",
5    "payload": {
6      "externalCustomerId": "string",
7      "name": "string",
8      "phone": "string",
9      "emailVerified": boolean,
10      "email": "string"
11    }
12  }
13]


Let's explain the fields of the payload one by one.

email

This field is typically filled when the customer's email needs to be updated.
If you change the email, the next API request should use this new email as the identifier.
The email property inside the payload is normally not present for each update.

externalCustomerId

This is the identifier outside of Jericommerce, normally the identifier from an external database.
Is required for each update or creation.

name

Name of the customer, displayed on the wallet pass.
Is a nullable value.

phone

Phone of the customer
By default, the value is null. If you don't send any data, the field will not be changed.

emailVerified

The customer's email address has been validated.
By default, the value is false. If you want to update it, you can send the correct value. If no change is required, you can avoid sending it.

Delete Customer

To delete a customer, use the same API endpoint but with the DELETE HTTP verb.
To delete customers you need to delete one-by-one, and you should send the email of the customer to delete by query params.

DELETE https://api.jericommerce.com/v1/programs/{programId}/integrations/api?email={customerEmail}

If everything goes well, you will receive a 201 response.

Topics

Integrations