Documentation
  • Documentation
  • Requirements
    • API Settings
  • Web SDKs and APIs
    • Components
    • Form (redirect)
      • Introduction
        • Demo Client (Test Client)
        • 3D Secure
      • Variables - names, lengths and formats
        • How to calculate digest
        • Supported Card Issuers
        • Form Rules
        • Installments
        • Tokenize Brands
        • Custom Params
        • Custom Attributes
        • Supported Payment Methods
        • Transaction Types
      • Notifications
    • LightBox
  • eCommerce Plugins
    • WooCommerce
    • Magento
    • Prestashop
  • Mobile SDKs
  • API Documentation
    • API v1
      • Direct API
      • Transaction management
    • API v2
      • Requirements - API v2
      • Payment API
      • Pay By Link API
      • Payment Method API
      • Token API
      • Customers API
      • Card on File Payment
      • Subscriptions
        • Create Subscription
        • Update Subscription
        • Create/Update/Get Response
      • Customer Subscription
        • Create Customer Subscription
        • Update Customer Subscription
        • Create/Update/Get Response
      • Recurring payments
    • Notifications
    • List of response codes
  • WebRisk
  • 🟣Knowledge Center
    • Payments
    • WebPay Account
Powered by GitBook
On this page
  • Create a customer
  • Request
  • Response
  • Retrieve a customer
  • Request
  • Response
  • Retrieve a customer via merchant_customer_id
  • Request
  • Response
  • Update a customer
  • Request
  • Response
  • Delete a customer
  • Request
  • Response
  • List all customers
  • Request
  • Response
  • List all payment methods
  • Request
  • Response
  1. API Documentation
  2. API v2

Customers API

Create a customer

Request

To create a Customer you'll need to provide:

  • Valid Authorization header (see above how to create one)

  • Valid request

Request endpoint details

name
value
description

path

v2/customers

This path is used for create action

method

POST

We are creating resource, hence POST method

Request body:

field
length
type
required
description

merchant_customer_id

1-100

String

NO

Merchant's customer id

description

1-200

String

NO

The Customer description

email

1-200

String

NO

Customer’s email address.

name

1-50

String

NO

Customer’s full name or business name.

phone

1-30

String

NO

Customer's phone

metadata

predefined

Dictionary

NO

Set of key-value pairs. Useful for storing additional data about the object

zip_code

1-9

String

NO

Customer's ZIP or postal code.

city

3-30

String

NO

Customer's city, district, suburb, town, or village.

address

3-100

String

NO

Customer's address

country

2

String

NO

Response

field
length
type
description

status

enum

String

approved, invalid-request or error

uuid

predefined

String

Customer's uuid - use this value for operations with customer

merchant_customer_id

100

String

Merchant's customer id

description

1-200

String

The Customer description

email

1-200

String

Customer’s email address.

name

1-50

String

Customer’s full name

phone

1-30

String

Customer's phone

metadata

predefined

Dictionary

Set of key-value pairs. Useful for storing additional data about the object

zip_code

1-9

String

Customer's ZIP or postal code.

city

3-30

String

Customer's city

address

3-100

String

Customer's address

country

2

String

deleted

predefined

Boolean

True if customer is deleted

created_at

predefined

DateTime

Created at

updated_at

predefined

DateTime

Created at

deleted_at

predefined

DateTime

Nullable, set if customer is deleted

Example of response:

{
  "uuid": "4b281da4-d145-4233-b957-2018cf9aa0fb",
  "merchant_customer_id": "customer-id-1234",
  "description": "Customer",
  "email": "email@email.com",
  "name": "Test",
  "phone": null,
  "status": "approved",
  "deleted": false,
  "city": null,
  "country": "BA",
  "zip_code": "71000",
  "address": null,
  "metadata": {
    "key": "value"
  },
  "created_at": "2019-02-12T11:22:33Z",
  "updated_at": "2019-02-12T11:22:33Z",
  "deleted_at": null
}

Retrieve a customer

To retrieve previously created customer you'll need to provide:

  • Valid Authorization header (see above how to create one)

  • Create resource beforehand

  • Provide valid resource uuid

Request

name
value
description

path

/v2/customers/:uuid

uuid of previously created resource

method

GET

Response

Response is the same as the one for create


Retrieve a customer via merchant_customer_id

To retrieve previously created customer you'll need to provide:

  • Valid Authorization header (see above how to create one)

  • Create resource beforehand

  • Provide valid merchant_customer_id

Request

name
value
description

path

/v2/merchants/customers/:merchant_customer_id

merchant_customer_id of previously created resource

method

GET

Response

Response is the same as the one for create

Update a customer

To update previously created customer you'll need to provide:

  • Valid Authorization header (see above how to create one)

  • Create resource beforehand

  • Provide valid resource uuid

Request

name
value
description

path

/v2/customers/:uuid

uuid of previously created resource

method

POST

We are updating resource, hence POST method

Request body:

  • Updates the specified customer by setting the values of the parameters passed.

  • Any parameters not provided will be left unchanged.

  • Fields available for create are also available for update.

  • Setting key to null in metadata will unset value for that key.

Response

Response is the same as the one for create


Delete a customer

To delete previously created customer you'll need to provide:

  • Valid Authorization header (see above how to create one)

  • Create resource beforehand

  • Provide valid resource uuid

Request

name
value
description

path

/v2/customers/:uuid

uuid of previously created resource

method

DELETE

Response

field
length
type
description

status

enum

String

approved, invalid-request or error

id

20

String

Customer's id

deleted

predefined

Boolean

True if customer is deleted

Example of response:

{
  "status": "approved",
  "id": "4b281da4-d145-4233-b957-2018cf9aa0fb",
  "deleted": true
}

List all customers

To list previously created customers you'll need to provide:

  • Valid Authorization header (see above how to create one)

Request

name
value
description

path

/v2/customers

uuid of previously created resource

method

GET

We are retrieving resources, thus GET

query

limit

Limit number of objects listed, default limit is 50. Must be valid number.

query

offset

If you need to skip values set offset to non 0 value, objects are sorted by created_at DESC. Must be valid number.

Response

|field| length | type |description| |status| enum | String |approved, invalid-request or error| |data|20 |Array<Dictionary> | An array of customers |

{
  "status": "approved",
  "data": [
    {
      "id": "4b281da4-d145-4233-b957-2018cf9aa0fb",
      "description": "Customer",
      "email": "email@email.com",
      "name": "Test",
      "phone": null,
      "status": "approved",
      "deleted": false,
      "city": null,
      "country": "BA",
      "zip_code": "71000",
      "address": null,
      "metadata": {
        "key": "value"
      },
      "created_at": "2019-02-12T11:22:33Z",
      "updated_at": "2019-02-12T11:22:33Z",
      "deleted_at": null
    }
  ]
}

List all payment methods

To list previously created customers you'll need to provide:

  • Valid Authorization header (see above how to create one)

Request

name
value
description

path

/v2/customers/:uuid/payment-methods

uuid of previously created resource

method

GET

We are retrieving resources, thus GET

query

limit

Limit number of objects listed, default limit is 50. Must be valid number.

query

offset

If you need to skip values set offset to non 0 value, objects are sorted by created_at DESC. Must be valid number.

Response

field
length
type
description

status

enum

String

approved, invalid-request or error

data

20

Array<Dictionary>

An array of customers

{
  "status": "approved",
  "data": [
    {
      "status": "approved",
      "id": "00c1eb1a4a0b61d1c2921c8d3a3f4570801da3f3f087c280e832cb4876a5e633",
      "masked_pan": "405840******0005",
      "expiration_date": "2025-12-31",
      "keep_until": "2024-12-31T23:00:00Z",
      "created_at": "2019-02-12T11:22:33Z",
      "updated_at": "2019-02-12T11:22:33Z",
      "customer_uuid": "4b281da4-d145-4233-b957-2018cf9aa0fb",
      "token": "00c1eb1a4a0b61d1c2921c8d3a3f4570801da3f3f087c280e832cb4876a5e633",
      "expired": false
    }
  ]
}
PreviousToken APINextCard on File Payment

Last updated 2 years ago

Two-letter country code, see

Two-letter country code, see

ISO 3166-1 alpha-2
ISO 3166-1 alpha-2