> For the complete documentation index, see [llms.txt](https://dev.ucommerce.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ucommerce.net/readme/headless/reference/billing.md).

# Billing

You can enable a mini cart view in the following requests to show changes to the cart immediately. Find out more in the [Views for Cart modifying operations](/readme/headless/reference/views-for-cart-modifying-operations.md)

### Prerequisites

* `access_token` from [Headless API Authentication](/readme/headless/headless-api-authentication.md)
* `cartId` from [Cart](/readme/headless/reference/cart.md#create-a-cart)
* `countryId` from [Countries](/readme/headless/reference/countries.md)

## Add billing information

### Request

```bash
curl -D- -X POST <base_url>/api/v1/carts/<cartId>/billing-address \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \
    -d '{
        "city": "<City>",
        "firstName": "<firstName>",
        "lastName": "<lastName>",
        "postalCode": "<postalCode>",
        "line1": "<addressLine1>",
        "line2": "<addressLine2>",
        "countryId": "<countryId>",
        "email":"<email>",
        "state":"<state>",
        "mobileNumber":"<mobileNumber>",
        "attention":"<attention>",
        "companyName":"<companyName>"
    }'
```

### Response

```json
{
"success": "true"
}
```

### Error Handling

| Error              | Description                                                                                                       |
| ------------------ | ----------------------------------------------------------------------------------------------------------------- |
| BadRequest (400)   | Missing or incorrect access token; Country not found; Bad or missing request data; pipeline execution fails; etc. |
| Unauthorized (401) | The token is expired.                                                                                             |
| Forbidden (403)    | The token does not have access to this endpoint.                                                                  |
| NotFound (404)     | Cart not found; Country not found.                                                                                |

Error Response Example

```json
{
"errors":
    [
        {
            "error-description": "Country not found.",
            "error": "NotFound"
        }
    ]
}
```

## Related Articles

{% content-ref url="/pages/OKRcu1Dp3gn5Y38w55HD" %}
[Error Handling](/readme/headless/error-handling.md)
{% endcontent-ref %}
