Customers API (LATEST)

API Integration Support: integration@dintero.com License: UNLICENSED

API for managing customers

Changelog

All notable changes to the API.

2021-03-01

2021-02-01

Extend customer enrolled_by.type to allow any string value, not just url, store and custom.

Add support for removing customer terms and include_deleted when getting list of all terms.

2021-01-01

Add support for limited access to customer details with user:customers:/customer/details

Add support for logging on without MFA even if configured with MFA

2020-12-01

new Support filter users with type query parameter.

2020-11-01

new Support filter user tokens with include_deleted query parameter.

new Support filter and search on sales locations

new Extend SalesLocation with address.latitude, address.longitude, chain, mcc, gln and franchise. The account_id will be included in any SalesLocation responses.

2020-05-01

Add setting for require verification when updating user phone_number. Prevent all update of user phone_number without completing a verification via SMS.

2020-04-01

Adds proxy to enhetsregisteret.

2020-03-10

Add support for attributes_keys and attributes_values query parameters for filtering customer users

2020-02-28

Add support for enabling automatic tokens when phone numbers or emails change

2019-09-31

Extends settings with support for configuring users customer_id_format.

Extends the TokenEvent definition with `expires_at read only property.

Extends settings with support for configuring token events expiry

2019-07-31

#

2019-07-31

Extend user Address, add support for latitude, longitude and comment properties.

2019-07-31

Add new endpoint for deleting a tag

2019-06-31

The scope required for accessing endpoint has changed, we will continue to support the old scopes but they was removed from the documentation

2019-05-31

Make type and company property optional when updating a customer user

2019-01-31

Support new customer type employee.

2018-06-04

Adding tokens to deleted customers will now fail with BAD_REQUEST.

Duplication control of customer.email is now case insensitive. email case will be ignore on Search and login.

Add support for query parameter total on GET user/token lists. Includes a total-count header in the response when enabled..

2018-04-11

Add support for delete_token_events parameter when creating

Add support for filtering token events by since_datetime.

Delete customer and all tokens owed by the customer in one request when using delete_tokens query parameter.

Token event status. The status in response will now be set to customer.status if a customer with status is included in the response.

2018-02-15

2018-02-02

Add type property to the customer. Support multiple customer types, add support for Company type for additional properties

Move endpoints for retrieving/updating token (events), use one endpoint for both retrieving and updating details about a token

Authentication

JWT

Authorization by using the Bearer schema The content of the header should look like the following:

Authorization: Bearer {access_token}

where the token is JSON Web Tokens (JWT).

Security Scheme Type API Key
Header parameter name: Authorization

users

Create new Customer

Create a new customer, customer_id, email and phone_number must be unique if specified.

scopes:

  • admin:customers
  • write:customers
  • create:customers:/users
Authorizations:
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

Request Body schema: application/json

customer to create

type
required
string
Default: "customer"
Enum: "customer" "company" "employee" "other"

Describe type of an user.

  • company property is required when using the type company
  • company property is only supported for users with type other or company
  • Creating or updating user with type employee or other requires admin:customers or write:customers scope.
  • User login is only available for users with type customer or company
metadata
object

A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format. You can unset an individual key by setting its value to null and then saving. To clear all keys, set metadata to null

first_name
string Nullable
last_name
string Nullable
email
string Nullable

customer email, case insensitive duplication control prevents multiple user with same type to have equal email

customer@example.com is equal to CUStOMer@EXAMPLE.com

phone_number
string <^\+?[1-9]\d{1,14}$> Nullable

A phone number in E.164 number formatting.

attributes
object

Custom attributes

status
string Nullable

Status of the customer

favorite_store
string Nullable

customer favorite store

object

discribe where customers was recruit from

object

Customers consent for marketing in different channels

Array of objects (CustomerAddress)
object (CustomerTerm)
object

Company details, supported when type is Company

gender
string Nullable
date_of_birth
string <date> Nullable
customer_id
string <= 255 characters

The customer id you have defined for the customer. (must not have trailing or leading spaces) An auto-generated customer_id will be created if no customer_id is provided.

password
string [ 8 .. 255 ] characters

The customer password. The caller must have scope write:accounts:/auth/users when password is included in the body

pin
string 6 characters ^\d{6}$

6 digit customer pin, can only used for MFA login. The caller must have scope write:accounts:/auth/users when pin is included in the body

Responses

Request samples

Content type
application/json
{
  • "metadata": {
    },
  • "first_name": "John",
  • "last_name": "Doe",
  • "email": "customer@example.com",
  • "phone_number": "+4799999999",
  • "attributes": { },
  • "status": "string",
  • "favorite_store": "string",
  • "enrolled_by": {},
  • "marketing_consent": {
    },
  • "type": "customer",
  • "addresses": [
    ],
  • "term": {
    },
  • "company": {
    },
  • "gender": "male",
  • "date_of_birth": "1990-09-20",
  • "customer_id": "string",
  • "password": "stringst",
  • "pin": "string"
}

Response samples

Content type
application/json
{
  • "metadata": {
    },
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "created_at": "2019-08-24T14:15:22Z",
  • "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "deleted_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
  • "deleted_at": "2019-08-24T14:15:22Z",
  • "first_name": "John",
  • "last_name": "Doe",
  • "email": "customer@example.com",
  • "phone_number": "+4799999999",
  • "attributes": { },
  • "status": "string",
  • "favorite_store": "string",
  • "enrolled_by": {},
  • "marketing_consent": {
    },
  • "type": "customer",
  • "addresses": [