Skip to main content
POST
/
payment-options
List payment options with POST
using RestSharp;


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/payment-options");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);
{
  "items": [
    {
      "type": "payment-option",
      "method": "card",
      "icon_url": "https://cdn.gr4vy.app/card.svg",
      "mode": "card",
      "label": "Pay by Card",
      "can_store_payment_method": true,
      "can_delay_capture": true,
      "context": {
        "gateway": "<string>",
        "gateway_merchant_id": "<string>",
        "merchant_name": "<string>",
        "supported_schemes": [
          "<string>"
        ],
        "approval_ui": {
          "height": "300px",
          "width": "300px"
        },
        "required_fields": {
          "first_name": true,
          "last_name": true,
          "email_address": true,
          "phone_number": true,
          "address": {
            "city": true,
            "country": true,
            "postal_code": true,
            "state": true,
            "house_number_or_name": true,
            "line1": true
          },
          "tax_id": true
        }
      }
    }
  ]
}
This endpoint requires the payment-options.read or embed scope.

Authorizations

Authorization
string
header
required

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

Body

application/json

A request to get list of payment options.

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.

Example:

1299

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.

Pattern: ^[a-z]{2}(?:-[A-Z]{2})?$
Example:

"en-US"

currency
string | null

A supported ISO-4217 currency code.

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

Example:

"USD"

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.

Example:

"US"

metadata
object

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.

Example:
{ "key": "value" }
cart_items
Cart Item · object[] | null

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

Maximum array length: 249

Response

Returns a list of available payment options for the given query parameters.

A list of payment options.

items
Payment option · object[]