---
description: Fire this api to create a new billing address for logged in user.
---

# Create billing address (02/02)

<mark style="color:blue;">`GET`</mark> `https://castleindia.in/emart/public /api/create-billing-address /api/create-billing-address`

#### Headers

| Name           | Type   | Description                              |
| -------------- | ------ | ---------------------------------------- |
| Accept         | String | application/json                         |
| Authentication | String | Bearer { bearer token without brackets } |

#### Request Body

| Name        | Type   | Description                                     |
| ----------- | ------ | ----------------------------------------------- |
| type        | String | Eg: Office,Work,Home or it can be set as blank. |
| city\_id    | String | City id from the city list.                     |
| state\_id   | String | State id from the state list.                   |
| country\_id | String | Country id from the list of country.            |
| pincode     | String | Pincode eg: 110011                              |
| phone       | String | Phone no. of the user.                          |
| address     | String | Billing address of the user.                    |
| email       | String | Email of the user.                              |
| name        | String | Name of the user                                |

{% tabs %}
{% tab title="200: OK Upon successful response you will get the following" %}
```
{
    "msg": "Billing address created successfully",
    "billingaddress": {
        "name": "John Doe",
        "email": "johndoe@example.com",
        "address": "Sample Billing Address",
        "type": "Office",
        "phone": "7894561230",
        "pincode": "311001",
        "country": {
            "id": 101,
            "name": "India"
        },
        "state": {
            "id": 33,
            "name": "Rajasthan"
        },
        "city": {
            "id": 3327,
            "name": "Bhilwara"
        }
    },
    "status": "success"
}
```
{% endtab %}
{% endtabs %}

### IF response fail

```
{
    "msg": "The name field is required.",
    "status": "fail"
}
```
