> ## Documentation Index
> Fetch the complete documentation index at: https://wpay-feat-edp-guide.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Step 2: Get a list of payment options

Next, you can use the payment options endpoint to determine which payment
options can be shown at checkout for the combination of `amount`, `currency`, `country`, `cart_items`
and `metadata` should be displayed in your checkout.

The [payment options API endpoint](/reference/payment-options/list-payment-options) makes it
easy to get a list of payment options.

<CodeGroup>
  ```bash cURL
  curl -i -X POST "https://api.example.gr4vy.app/payment-options" \
      -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIi..." \
      -H "Content-Type: application/json" \
      -d '{
      	"currency":"AUD",
      	"country":"AU",
      	"amount":1000,
      	"metadata":{
      		"TypeOfPayment":"purchase",
      		"Carbon_FootPrint":"10"
      	},
      	"cart_items":[
      		{
      			"name":"Aloe",
      			"unit_amount":1000,
      			"quantity":1,
      			"sku":"aloe"
      		}
      	],
      	"locale":"en"
      }'
  ```

  ```js Node
  const paymentOptionsRequest = new PaymentOptionsRequest()
  paymentOptionsRequest.country = 'AU'
  paymentOptionsRequest.currency = 'AUD'
  paymentOptionsRequest.amount = 1000
  paymentOptionsRequest.metadata = { TypeOfPayment: 'purchase', Carbon_FootPrint: "10" }

  const paymentOptions = await client
    .postListPaymentOptions(paymentOptionsRequest)
    .catch((error) => {
      console.dir(error.response.body) // the parsed JSON of the error
      console.dir(error.response.statusCode) // the status code of the error
      throw new Error('an error occurred while listing the payment options')
    })

  console.log(paymentOptions)
  ```

  ```py Python
  payment_options_request = {
      "currency":"AUD",
      "country":"AU",
      "amount":1000,
      "metadata":{
          "TypeOfPayment":"purchase",
          "Carbon_FootPrint":"10"
      }
  }
  payment_options = client.post_list_payment_options(**payment_options_request)
  ```

  ```php PHP
  $config = new Gr4vyConfig(self::$gr4vyId, self::$privateKeyLocation);
  $payment_options_request = array(
      "country"=>"AU",
      "currency"=>"AUD",
      "amount"=>1000,
      "metadata"=>array(
          "TypeOfPayment"=>"purchase",
          "Carbon_FootPrint"=>"10"
      )
  );

  $result = $config->postListPaymentOptions($payment_options_request);
  ```

  ```php Java
  Gr4vyClient client = new Gr4vyClient("spider", "private_key.pem", "sandbox");
  PaymentOptionsApi api = new PaymentOptionsApi(client.getClient());

  String country = null;
  String currency = null;
  Integer amount = null;
  String metadata = null;
  String locale = null;
  PaymentOptions response = api.listPaymentOptions(country, currency, amount, metadata, locale);

  System.out.println(response);
  ```
</CodeGroup>

<br />

<Info>
  This API will automatically use your checkout Flow rules
  to limit these results.
</Info>

Each payment option will include the `method`, `icon_url`, `label` and other useful information
on supported features that you can use to display the options on your checkout.

```bash
{
    "items": [
        {
            "type": "payment-option",
            "method": "card",
            "icon_url": "https://api.sandbox.example.gr4vy.app/assets/icons/payment-methods/card.svg",
            "mode": "card",
            "label": "Card",
            "can_store_payment_method": true,
            "can_delay_capture": true,
            "context": {
                "approval_ui": {
                    "height": "589px",
                    "width": "500px"
                },
                "required_fields": {}
            }
        },
        {
            "type": "payment-option",
            "method": "paypal",
            "icon_url": "https://api.sandbox.example.gr4vy.app/assets/icons/payment-methods/paypal.svg",
            "mode": "redirect",
            "label": "PayPal",
            "can_store_payment_method": true,
            "can_delay_capture": true,
            "context": {
                "approval_ui": {
                    "height": "589px",
                    "width": "500px"
                },
                "required_fields": {}
            }
        },
        {
            "type": "payment-option",
            "method": "alipay",
            "icon_url": "https://api.sandbox.example.gr4vy.app/assets/icons/payment-methods/alipay.svg",
            "mode": "redirect",
            "label": "Alipay",
            "can_store_payment_method": true,
            "can_delay_capture": false,
            "context": {
                "approval_ui": {
                    "height": "589px",
                    "width": "500px"
                },
                "required_fields": {}
            }
        }
    ]
}
```

<Note>
  This API supports an optional `locale` that can be set to get the `label` in your local language.
</Note>

Your application can now display these payment options on your checkout page.
To display the available options and allow your customer to checkout, use each label and icon, and then handle
the transaction according to the next step.

<Warning>
  We recommend using [Secure Fields](/guides/payments/secure-fields) when working with cards as it reduces the PCI scope of your integration. If you intend to use our API directly for card payments without Secure Fields then you will have to go through your own PCI-DSS level 1 certification.
</Warning>

By implementing the payment options in this way you can fully utilize payment orchestration
while having all the flexibility on the design and layout.

## Summary

In this step you:

* Called the payment options endpoint
* Displayed the payment options on your checkout
