POST

/payment-options

curl --request POST \
  --url https://api.sandbox.{gr4vy_id}.gr4vy.app/payment-options \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json'
{
  "items": [
    {
      "can_delay_capture": "boolean",
      "can_store_payment_method": "boolean",
      "context": {
        "approval_ui": {
          "height": "300px",
          "width": "300px"
        },
        "gateway": "string",
        "gateway_merchant_id": "string",
        "merchant_name": "string",
        "required_fields": {
          "address": {
            "city": "boolean",
            "country": "boolean",
            "house_number_or_name": "boolean",
            "line1": "boolean",
            "postal_code": "boolean",
            "state": "boolean"
          },
          "email_address": "boolean",
          "first_name": "boolean",
          "last_name": "boolean",
          "phone_number": "boolean",
          "tax_id": "boolean"
        },
        "supported_schemes": [
          "string"
        ]
      },
      "icon_url": "https://cdn.gr4vy.app/card.svg",
      "label": "Pay by Card",
      "method": "card",
      "mode": "card",
      "type": "payment-option"
    }
  ]
}

This endpoint requires the payment-options.read or embed scope.

Authorizations

Authorizationheaderrequired
string

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
amount
integer | null

The monetary amount to create an authorization for, in the smallest currency unit for the given currency, for example 1299 cents to create an authorization for $12.99.

If the intent is set to capture, an amount greater than zero must be supplied.

cart_items
object[] | null

An array of cart items that represents the line items of a transaction.

country
string | null

Filters the results to only the items which support this country code. A country is formatted as 2-letter ISO country code.

currency
string | null

A supported ISO-4217 currency code.

For redirect requests, this value must match the one specified for currency in payment_method.

locale
Default: "en"
string | null

An ISO 639-1 Language Code and optional ISO 3166 Country Code. This locale determines the language for the labels returned for every payment option.

metadata
object | null

Used by the Flow engine to filter available options based on various client-defined parameters. If present, this must be a string representing a valid JSON dictionary.

Response

200 - application/json
items
object[]