Create a customer with the Integrator's customer ID

Allow the integrator to create a reference to a newly created customer.

๐Ÿ“˜

NOTE:

To avoid creating duplicated customer details, Integrators can make use of the reference code to add the integrators Customer Id. This allow Integrator to use their Customer Id a search reference in the GET Customer List

1. Create Customer with Integrator Customer Id

API Endpoint: [POST] https://api-sandbox.ezypay.com/v2/billing/customers/

๐Ÿ“˜

Important:

The important field here is the "referenceCode" parameter.

{
  "firstName": "TestJust",
  "lastName": "TestJust",
  "email": "[email protected]",
  "referenceCode": "CUST112233"
}
{
    "id": "db489a39-ce0f-4581-af07-1d45e892e8e5",
    "number": "EZY133985",
    "referenceCode": "CUST112233",
    "firstName": "TestJust",
    "lastName": "TestJust",
    "email": "[email protected]",
    "companyName": null,
    "mobilePhone": null,
    "homePhone": null,
    "gender": null,
    "dateOfBirth": null,
    "createdOn": "2019-07-25T03:10:30.181",
    "address": null,
    "metadata": null
}

2. Search Customer List using the Integrator Customer Id

API Endpoint: [GET] https://api-sandbox.ezypay.com/v2/billing/customers?referenceCode={{Integrator Customer Id}}

Continuing from the example above:
{{Integrator Customer Id}} = CUST112233

{
    "data": [
        {
            "id": "db489a39-ce0f-4581-af07-1d45e892e8e5",
            "number": "EZY133985",
            "referenceCode": "CUST112233",
            "firstName": "TestJust",
            "lastName": "TestJust",
            "email": "[email protected]",
            "companyName": null,
            "mobilePhone": null,
            "homePhone": null,
            "gender": null,
            "dateOfBirth": null,
            "createdOn": "2019-07-25T03:10:30.181",
            "address": null,
            "metadata": null
        }
    ],
    "paging": {
        "nextUrl": null,
        "nextCursor": 0,
        "limit": 0,
        "totalCount": 1
    }
}