> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bitgpt.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Metadata

> Attach custom key-value data to invoices and products for flexible integrations.

We support attaching **metadata** to resources such as **invoices** and **products**.\
This feature allows you to include **custom key-value data** when creating or updating objects and retrieve it later through the API or webhooks.

This data is stored alongside the object but **does not affect its behavior** in the system.

Typical use cases include:

* Linking an order to an internal **customer ID**
* Storing an **external reference number** for reconciliation
* Adding **contextual notes** for internal tracking
* Passing information required by **third-party systems**

## Structure

Metadata is sent as a JSON object:

```json theme={"system"}
"metadata": {
  "customer_id": "123456",
  "campaign": "summer_promo",
  "priority": "high"
}
```

<Card title="Accept a payment" icon="cash-register" href="/recipes/accept-payment" arrow="true">
  Use metadata when accepting a payment to add custom information to an invoice
</Card>
