SpareSpare Docs
GuidesAPI Reference

Customers

Create, list, retrieve, update, and delete customer records.

POST
/api/v1.0/ais/Customer/Create
Authorization
Body
*object

Request Body

application/json

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1.0/ais/Customer/Create" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com",    "fullName": "string",    "type": "Retail"  }'
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "fullName": "string",    "phone": "string",    "email": "string",    "nationalId": "string",    "registrationNumber": "string",    "type": "Retail",    "externalId": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "archived": true  }}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
Empty
GET
/api/v1.0/ais/Customer/List
Authorization
Query

Page number

Number of items per page maximum allow is 500 per page

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1.0/ais/Customer/List"
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "fullName": "string",      "phone": "string",      "email": "string",      "nationalId": "string",      "registrationNumber": "string",      "type": "Retail",      "externalId": "string",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "archived": true    }  ],  "meta": {    "currentPageNumber": 0,    "pageSize": 0,    "totalNumberOfPages": 0,    "totalItems": 0  }}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
Empty
GET
/api/v1.0/ais/Customer/Get
Authorization
Query

Customer id

Customer external id

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1.0/ais/Customer/Get"
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "fullName": "string",    "phone": "string",    "email": "string",    "nationalId": "string",    "registrationNumber": "string",    "type": "Retail",    "externalId": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "archived": true  }}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
Empty
PATCH
/api/v1.0/ais/Customer/Update
Authorization
Query

Customer id

Body
*object

Request Body

application/json

Customer model

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/v1.0/ais/Customer/Update?id=497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com"  }'
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "fullName": "string",    "phone": "string",    "email": "string",    "nationalId": "string",    "registrationNumber": "string",    "type": "Retail",    "externalId": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "archived": true  }}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
Empty
DELETE
/api/v1.0/ais/Customer/Delete
Authorization
Query

Customer id

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/api/v1.0/ais/Customer/Delete?id=497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
{  "error": "INVALID_DATA",  "errorDescription": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "data": null}
Empty