POST
/
payment-options
curl --request POST \
  --url https://api.{gr4vy_id}.gr4vy.app/payment-options \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "amount": 1299,
  "cart_items": [
    {
      "categories": [
        "<string>"
      ],
      "discount_amount": 123,
      "external_identifier": "item-789123",
      "image_url": "https://example.com/images/items/gopro.png",
      "name": "GoPro HERO9 Camcorder",
      "product_type": "physical",
      "product_url": "https://example.com/items/gopro",
      "quantity": 1,
      "sku": "sku-789123",
      "tax_amount": 123,
      "unit_amount": 37999
    }
  ],
  "country": "US",
  "currency": "USD",
  "locale": "en-US",
  "metadata": {
    "key": "value"
  }
}'
{
  "items": [
    {
      "can_delay_capture": true,
      "can_store_payment_method": true,
      "context": {
        "approval_ui": {
          "height": "300px",
          "width": "300px"
        },
        "gateway": "<string>",
        "gateway_merchant_id": "<string>",
        "merchant_name": "<string>",
        "required_fields": {
          "address": {
            "city": true,
            "country": true,
            "house_number_or_name": true,
            "line1": true,
            "postal_code": true,
            "state": true
          },
          "email_address": true,
          "first_name": true,
          "last_name": true,
          "phone_number": true,
          "tax_id": true
        },
        "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

Authorization
string
headerrequired

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
string | null
default: en

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[]