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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.dintero.com/feedback

```json
{
  "path": "/docs/checkout/discount-metadata",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Adding discount metadata to sessions

> Pass per-item or full-order discount details on a Dintero Checkout session using order.items[].discount_lines and order.discount_lines metadata fields.

When creating sessions with discounted items, you should write the price *after* discounts, as this is what the customer is paying.

If you want to add metadata to the sessions to signal that a discount has been given, you can use `order.items[*].discount_lines` if the discount is connected to a particular item or `order.discount_lines` if the discount is on the full order.

See the [api spec](https://docs.dintero.com/payments-api.html#tag/session/operation/checkout_session_profile_post) for more details.

## Example 1: Discount added per item

```json theme={null}
{
    "amount": 20000,
    "items": [
        {
            "id": "item-1",
            "vat": 25,
            "amount": 10000,
            "line_id": "1",
            "quantity": 1,
            "description": "Item 1",
            "discount_lines": [
                {
                    "amount": 2000,
                    "line_id": 1,
                    "description": "Manually added 20 kroner off. // Original price 12000",
                    "discount_id": "manual-20-kroner-off",
                    "discount_type": "manual"
                }
            ]
        },
        {
            "id": "item-2",
            "vat": 25,
            "amount": 10000,
            "line_id": "2",
            "quantity": 2,
            "description": "Item 2",
            "discount_lines": [
                {
                    "amount": 2500,
                    "line_id": 1,
                    "percentage": 20,
                    "description": "New customer 20% on item 2. // Original price 12500", 
                    "discount_id": "new-customer-20-item-2",
                    "discount_type": "customer"
                }
            ]
        }
    ]
}
```

## Example 2: Discount added on the order

```json theme={null}
{
    "amount": 20000,
    "items": [
        {
            "id": "item-1",
            "vat": 25,
            "amount": 10000,
            "line_id": "1",
            "quantity": 1,
            "description": "Item 1"
        },
        {
            "id": "item-2",
            "vat": 25,
            "amount": 10000,
            "line_id": "2",
            "quantity": 2,
            "description": "Item 2"
        }
    ],
    "discount_lines": [
        {
            "amount": 5000,
            "line_id": "dl1",
            "percentage": 20,
            "description": "20% off on the first order // The original sum was 25000",
            "discount_id": "first-order-20-percent",
            "discount_type": "customer"
        }
    ]
}
```
