# Payment options

Payment options can be associated with an [order](/core-api-reference/orders.md#payment-options) to extend the information we send to the payment gateway at the moment of the payment creation. That information must be provided using the `data` object in a valid JSON format. The `data` key/value pairs will be merged into the root of the payload sent to the gateway and used to properly create the payment itself. The provided payment options won't override information we already send to the gateway, only new attributes will be added to the payload (for some gateways — e.g. [Adyen](#adyen) — you can also enrich the information sent by default).

Payment options are **payment source type-specific** and may vary based on the different payment gateway). Make sure to carefully read the gateway documentation so that you can build the `data` JSON object properly, otherwise the gateway might return an error.

{% hint style="info" %}
For security reasons, payment options can be managed using [integration](/core/api-credentials.md#integration) API credentials only.
{% endhint %}

{% hint style="warning" %}
Remember to associate the payment options to the order before the payment source creation to ensure they are properly injected into the payload we send to the gateway. Similarly, if for any reason the payment source associated with the order should change (e.g. changing the gateway type), make sure to remove the old payment options association or update them to the ones requested by the new payment source type, otherwise the gateway might not accept the payment.
{% endhint %}

## Adyen

In addition to adding information not automatically sent to the gateway by the Commerce Layer integration, when specifying payment options for [Adyen](/core-api-reference/adyen_payments.md), you're allowed to enrich some information already provided by default, including:

* `additionalData` — pass an object containing one or more of the [supported fields](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-additionalData).
* `lineItems` — pass an array of objects, each of them must specify ID of the line item for which you want to inject new attributes (e.g. the SKU code — see example below).

<pre class="language-json"><code class="lang-json">"data": {
  "type": "payment_options",
  "attributes": {
    "payment_source_type": "adyen_payments",
    "data": {
<strong>      "additionalData": {
</strong>        "airline": {
          "agency_invoice_number": "000567",
          "agency_plan_name": "Ryanair",
          "airline_code": "FR"
        }
      },
<strong>      "lineItems": [
</strong>        {
          "id": "aGKdfVClyj",
          "sku": "SKU000XY"
        },
        {
          "id": "fSXweDxKJq",
          "sku": "SKU000WZ"
        }
      ],
<strong>      "riskData": {
</strong>        "clientData": "y0ur-cl13nt-D4ta",
        "fraudOffset": 2
      }
    }
  },
  "relationships": {
    "order": {
      "data": {
        "type": "orders",
        "id": "ABCRtyUpBa"
      }
    }
  }
}
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.commercelayer.io/core-api-reference/payment_options.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
