# Customers

These keys are specified to use as defined in docs, they are case-sensitive. Any change in these keys may cause issues during data sync&#x20;

### Authentication&#x20;

\
Use your token provided inside converted.in after on boarding process to authenticate the request using form-data body

![](https://1119750375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7X1MfKrY7KCRp85qrV%2Fuploads%2FovE8PJt7rWXRMhvR6np4%2Fimage.png?alt=media\&token=80296795-f353-4fc8-b49b-7280c02c3737)

<mark style="color:green;">`POST`</mark> `YOUR_BASEURL/convertedin/customers`

#### Request Body

| Name                                        | Type    | Description                  |
| ------------------------------------------- | ------- | ---------------------------- |
| par\_page<mark style="color:red;">\*</mark> | integer | limit per page (default 100) |
| page<mark style="color:red;">\*</mark>      | integer | page number                  |
| token<mark style="color:red;">\*</mark>     | string  |                              |

{% tabs %}
{% tab title="200 " %}

```
{
    "current_page": 1,
    "data":  [
        {
            "id": 1739,
            "email": "salehmoharam@gmail.com",
            "first_name": "صالح",
            "last_name": "عادل",
            "orders_count": 23,
            "total_spent": 184,
            "currency": "EGP",
            "phone": "01000000001",
            "registered_at": "2020-10-12 10:00:00",
            "gender": "male" // male, female, unknown
        }
    ],
    "from": 1,
    "last_page": 25,
    "per_page": 100,
    "to": 100,
    "total": 2442
}
```

{% endtab %}
{% endtabs %}

| key            | Description                                                              | Validation Rules              |
| -------------- | ------------------------------------------------------------------------ | ----------------------------- |
| id             | customer id on your database linked to his orders                        | **Required**                  |
| email          | customer unique email                                                    | **Required**                  |
| first\_name    | customer first name                                                      | **Required**                  |
| last\_name     | customer last/family name                                                | **Required**                  |
| orders\_count  | customer successful orders count                                         | **Required**                  |
| total\_spent   | customer total money spent on orders                                     | **Required**                  |
| currency       | customer currency in ISO code (USD, EUR)                                 | **Required**                  |
| phone          | customer phone number                                                    | Not required                  |
| registered\_at | customer registration date, Format: Y-m-d H:i:s, ex: 2020-12-15 19:00:00 | **Required**                  |
| gender         | customer gender ('male','female','unknown')                              | Not required, **Recommended** |

### Response

```json
{
    "data": [
        {
            "id": 207119551,
            "email": "bob.norman@hostmail.com",
            "accepts_marketing": false,
            "created_at": "2021-10-01T16:52:26-04:00",
            "updated_at": "2021-10-01T16:52:26-04:00",
            "first_name": "Bob",
            "last_name": "Norman",
            "orders_count": 1,
            "state": "disabled",
            "total_spent": "199.65",
            "last_order_id": 450789469,
            "verified_email": true,
            "phone": "+16136120707",
            "last_order_name": "#1001",
            "currency": "USD",
            "addresses": [
                {
                    "id": 207119551,
                    "customer_id": 207119551,
                    "first_name": null,
                    "last_name": null,
                    "company": null,
                    "address1": "Chestnut Street 92",
                    "address2": "",
                    "city": "Louisville",
                    "province": "Kentucky",
                    "country": "United States",
                    "zip": "40202",
                    "phone": "555-625-1199",
                    "name": "",
                    "province_code": "KY",
                    "country_code": "US",
                    "country_name": "United States",
                    "default": true
                }
            ],
            "default_address": {
                "id": 207119551,
                "customer_id": 207119551,
                "first_name": null,
                "last_name": null,
                "company": null,
                "address1": "Chestnut Street 92",
                "address2": "",
                "city": "Louisville",
                "province": "Kentucky",
                "country": "United States",
                "zip": "40202",
                "phone": "555-625-1199",
                "name": "",
                "province_code": "KY",
                "country_code": "US",
                "country_name": "United States",
                "default": true
            }
        }
    ],
    "total": 1000,
    "per_page": 100,
    "current_page": 1,
    "last_page": 10,
    "from": 1,
    "to": 100
}
```
