# Payment Methods Endpoint

## Payment Methods

<mark style="color:blue;">`GET`</mark> `https://api-stg.directa24.com/v3/payment_methods?country={country}`

The **`payment_methods`** endpoint allows you to retrieve the complete list of payment methods you have available for the country specified, along with its payment method's type, code, logos and more.

#### Query Parameters

| Name    | Type   | Description      |
| ------- | ------ | ---------------- |
| country | string | Country ISO code |

#### Headers

| Name          | Type   | Description                   |
| ------------- | ------ | ----------------------------- |
| Authorization | string | "Bearer " + Read-Only API Key |

{% tabs %}
{% tab title="200 Payment methods successfully retrieved" %}

```java
[
    {
        "country": "BR",
        "code": "BB",
        "name": "Banco do Brasil",
        "type": "BANK_DEPOSIT",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/BB.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "BZ",
        "name": "Banco Original",
        "type": "VOUCHER",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/BZ.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "UL",
        "name": "Banrisul AM",
        "type": "BANK_TRANSFER",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/UL.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "BL",
        "name": "Boleto",
        "type": "VOUCHER",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/BL.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "B",
        "name": "Bradesco",
        "type": "BANK_DEPOSIT",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/B.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "CA",
        "name": "Caixa",
        "type": "BANK_TRANSFER",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/CA.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "I",
        "name": "Itau",
        "type": "BANK_DEPOSIT",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/I.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "LC",
        "name": "Loterias Caixa",
        "type": "VOUCHER",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/LC.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "PP",
        "name": "Picpay",
        "type": "VOUCHER",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/PP.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "SB",
        "name": "Santander",
        "type": "BANK_TRANSFER",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/SB.svg",
        "daily_average": 5,
        "monthly_average": 5
    }
]
```

{% endtab %}

{% tab title="400 The country specified was incorrect" %}

```
```

{% endtab %}

{% tab title="401 Invalid credentials error" %}

```java
{
    "code": 100,
    "description": "Invalid credentials"
}
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
Please find all the country codes in the [Countries Specifications](https://docs.pandablue.com/specifications/countries-specifications#details) section.
{% endhint %}

## Description

The **`payment_methods`** endpoint will show you all the payment methods your account has enabled for the country specified as **query params** in the request.

It will also show details about each payment method like the `payment method code`, the `payment method name`, the[`payment method type`](#payment-types) as well as the `payment method logo` and others.

{% hint style="info" %}
In case of integrating the [OneShot Experience](https://docs.pandablue.com/api-documentation/deposits-api/deposit-creation-endpoint#full-request-streamline) and displaying the payment methods on your cashier, make sure you check the **payment methods** with this API multiple times per day to make sure that in case a new payment method becomes available or unavailable, you will also automatically update it on your cashier without requiring manual intervention from either side.
{% endhint %}

## Request

In order to start using the payment methods endpoint, you need to:

1. Send the request with **GET** method.
2. Specify a [valid country code](https://docs.pandablue.com/specifications/countries-specifications#countries-and-currencies) in the request as **QUERY PARAMS**.
3. Send the **Authorization** header with your read-only API Key as Bearer as follows:

> Authorization: Bearer *your\_read\_only\_key\_here*

### Example request

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://api-stg.directa24.com/v3/payment_methods?country=BR' \
--header 'Authorization: Bearer your_read_only_key_here'


```

{% endtab %}

{% tab title="JAVA" %}

```java
import java.io.*;
import okhttp3.*;

public class main {
  public static void main(String []args) throws IOException{
    OkHttpClient client = new OkHttpClient().newBuilder()
      .build();
    Request request = new Request.Builder()
      .url("https://api-stg.directa24.com/v3/payment_methods?country=BR")
      .method("GET", null)
      .addHeader("Authorization", "Bearer your_read_only_key_here")
      .build();
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
  }
}


```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using RestSharp;

namespace HelloWorldApplication {
    class HelloWorld {
        static void Main(string[] args) {
            var client = new RestClient("https://api-stg.directa24.com/v3/payment_methods?country=BR");
            client.Timeout = -1;
            var request = new RestRequest(Method.GET);
            request.AddHeader("Authorization", "Bearer your_read_only_key_here");
            IRestResponse response = client.Execute(request);
            Console.WriteLine(response.Content);
        }
    }
}


```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api-stg.directa24.com/v3/payment_methods?country=BR",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer your_read_only_key_here"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;


```

{% endtab %}
{% endtabs %}

## Example response

```java
[
    {
        "country": "BR",
        "code": "BB",
        "name": "Banco do Brasil",
        "type": "BANK_DEPOSIT",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/BB.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "BL",
        "name": "Boleto",
        "type": "VOUCHER",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/BL.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "B",
        "name": "Bradesco",
        "type": "BANK_DEPOSIT",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/B.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "PP",
        "name": "Picpay",
        "type": "VOUCHER",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/PP.svg",
        "daily_average": 5,
        "monthly_average": 5
    },
    {
        "country": "BR",
        "code": "SB",
        "name": "Santander",
        "type": "BANK_TRANSFER",
        "status": "OK",
        "logo": "https://resources.directa24.com/cashin/payment_method/square/SB.svg",
        "daily_average": 5,
        "monthly_average": 5
    }
]
    
```

### Response Fields

The response will return an object different for each payment method. You should be able to iterate though it no matter how many payment methods are returned.

| Field             | Format | Description                                                                                                                                                                                                   |
| ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `country`         | String | [Country code](https://docs.pandablue.com/specifications/countries-specifications#countries-and-currencies)                                                                                                   |
| `code`            | String | Payment method code that should be used when creating a [deposit request](https://docs.pandablue.com/api-documentation/deposits-api/endpoints/deposit-creation-endpoint)                                      |
| `name`            | String | Payment method name                                                                                                                                                                                           |
| `type`            | String | Payment method type. Check the [Payment Types](https://docs.pandablue.com/api-documentation/deposits-api/payment-methods) section for further details                                                         |
| `status`          | String | Status of the payment method. It will be updated in case a payment methods becomes momentaneously unavailable                                                                                                 |
| `logo`            | String | URL containing the payment method logo                                                                                                                                                                        |
| `daily_average`   | Number | Daily average time for the approval of the deposits with this payment method in seconds. \*Note that in case the method is new, we may not have daily average information so this field won't be returned     |
| `monthly_average` | Number | Monthly average time for the approval of the deposits with this payment method in seconds. \*Note that in case the method is new, we may not have monthly average information so this field won't be returned |

{% hint style="warning" %}
We may add more fields to this response's object in the future. Please develop your integration considering that it will ignore new fields and continue working fine no matter if we add new fields.
{% endhint %}

## Payment types

| payment\_type     | Description                     | Icon                                                                           |
| ----------------- | ------------------------------- | ------------------------------------------------------------------------------ |
| *`BANK_DEPOSIT`*  | Bank deposits                   | <https://resources.directa24.com/cashin/payment_method_type/BANK_DEPOSIT.png>  |
| *`BANK_TRANSFER`* | Electronic Funds Transfer (TEF) | <https://resources.directa24.com/cashin/payment_method_type/BANK_TRANSFER.png> |
| *`CREDIT_CARD`*   | Credit and Debit card methods   | <https://resources.directa24.com/cashin/payment_method_type/CREDIT_CARD.png>   |
| *`VOUCHER`*       | Cash solutions                  | <https://resources.directa24.com/cashin/payment_method_type/VOUCHER.png>       |

## Payment Methods

Check the Payment Methods page for the full list of payment methods.

{% content-ref url="../payment-methods" %}
[payment-methods](https://docs.pandablue.com/api-documentation/deposits-api/payment-methods)
{% endcontent-ref %}
