GET
/
payment-options
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.{gr4vy_id}.gr4vy.app/payment-options"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
{
  "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.

Query Parameters

country
string

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

Example:

"US"

currency
string

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

Example:

"USD"

amount
integer

Used by the Flow engine to filter the results based on the transaction amount.

Example:

500

metadata
string

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:

"{\"restricted_items\": \"True\"}"

locale
string
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.

Example:

"en-US"

Response

200
application/json

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

A list of payment options.