---
updatedAt: 2025-09-22T23:05:25.000Z
agentTools:
  projectIndex: https://developers.conekta.com/v2.1.0/llms.txt
---

# Cargo recurrente

Esta modalidad de Pago Recurrente con Efectivo te permitirá crear órdenes que tus clientes podrán pagar directamente en un punto de venta autorizado por Conekta de manera física, generando referencias que podrán reutilizarse todas las veces que se desee.

Conekta cuenta con dos redes de puntos de venta que se habilitan de forma automática teniendo en cuenta el giro de tu negocio:

![](https://files.readme.io/16b753bfe84c9eaae80745a69e9d49b5d60a0424d909e558813d5ef3cca4c23a-image.png)

<br />

* **Conekta efectivo** con más de **10,000** puntos de venta (**7 eleven, Farmacias del Ahorro, Tiendas Extra, Círculo K, Farmacia Benavides, Soriana,  Waldo´s, Eleczion, Grupo RFP, Super Kiosko, Farmacias Bazar, Wolworth y del Sol, Yepas y Al super**).

> 🚧 NOTA
>
> Tu negocio podrá operar con nuestras redes de efectivo de acuerdo a la información que proporcionaste en el proceso de onboarding.

## Características

* Es necesario registrar/almacenar un cliente en Conekta.
* La referencia nacerá sin expiración pero permitirá configurar vencimiento desde 1 día a 365 días.
* Cada vez que un cliente quiera realizar un pago en tu negocio, podrá utilizar la misma referencia.
* Se enviarán notificaciones del pago en un máximo de 10 minutos a través de Webhooks y vía mail al usuario final.

## Flujo de pago

![](https://files.readme.io/0d4bb7e-Pagos_-_Flujos-pago_recurrente.drawio.png)

Copia tus llaves **privadas** de pruebas. Si aún no las tienes, puedes obtenerlas en el siguiente enlace: panel Conekta]\(<https://panel.conekta.com/developers>).

## 1. Crea tu orden de pago recurrente

CUSTOM\_REFERENCE\_RETURNED​ se refiere a su ​referencia personalizada ​y barcode\_url es la imagen del código de barras generada.

```curl cURL
curl --request POST \
  --url https://api.conekta.io/customers \
  --header 'accept: application/vnd.conekta-v2.1.0+json' \
  -u key_eYvWV7gSDkNYXsmr: \
  --header 'content-type: application/json' \
  --data '{
      "name": "Fulanito",
      "email": "fulanito@test.com",
      "phone": "+5218181818181",
      "payment_sources": [{
        "type": "cash_recurrent",
        "expires_at": 1686255136
	    }]
  }'

#Respuesta json de API
{
    "livemode": true,
    "name": "test",
    "email": "mauriciocarrero15@gmail.com",
    "phone": "3143159054",
    "national_id": "10902357102",
    "date_of_birth": "24/07/1992",
    "id": "cus_2xHJayvPVd3BpmdC7",
    "object": "customer",
    "created_at": 1736431274,
    "corporate": false,
    "custom_reference": "",
    "payment_sources": {
        "object": "list",
        "has_more": false,
        "total": 1,
        "data": [
            {
                "id": "off_ref_2xHJayvPVd3BpmdC8",
                "object": "payment_source",
                "provider": "Cash",
                "store_names": [
                    "7 Eleven",
                    "Farmacias del Ahorro",
                    "CIRCLE K",
                    "Tiendas Extra",
                    "Farmacia Benavides",
                    "Soriana",
                    "WALDO'S",
                    "ELECZION",
                    "Super Kiosko",
                    "Farmacias Bazar",
                    "Wolworth",
                    "Del Sol",
                    "Yepas",
                    "Farmacias De Dios",
                    "Farmacias Nosarco",
                    "Farmacias Santa Cruz",
                    "Farmacentro",
                    "Farmacias GyM",
                    "Farmacias San Francisco de Asis",
                    "Farmacias Union",
                    "Farmacias Zapotlan",
                    "Farmatodo",
                    "Al Super",
                    "BBVA ATM"
                ],
                "type": "cash_recurrent",
                "reference": "10001432529593700513",
                "barcode": "10001432529593700513",
                "barcode_url": "https://barcode/url.png",
                "expires_at": 0,
                "created_at": 1736431274,
                "parent_id": "cus_2xHJayvPVd3BpmdC7"
            }
        ]
    }
}
```
```ruby Ruby
begin
  customer = Conekta::Customer.create({
        name: "Fulanito",
        email: "fulanito@test.com",
        phone: "52134659439",
        payment_sources: [ {
            type: "cash_recurrent"
        }]
  })
rescue Conekta::Error => error
  for error_detail in error.details do
    puts error_detail.message
  end
end
```
```php PHP
use Conekta\Api\CustomersApi;
use Conekta\ApiException;
use \Conekta\Configuration;
use Conekta\Model\Customer;

 protected static CustomersApi $apiInstance;
 $config = Configuration::getDefaultConfiguration()->setAccessToken("key_xxxxxxxxxx");
 self::$apiInstance = new CustomersApi(null, $config);
 $customer = new Customer([
            'name' => 'emilio lopez',
            'email' => 'emilio@gmail.com',
            'phone' => '52134659439',
            'payment_sources' => [
                [
                    'type' => 'cash_recurrent'
                ]
            ]
        ]);
 $result = self::$apiInstance->createCustomer($customer);

#Respuesta json de API
{
    "livemode": true,
    "name": "test",
    "email": "mauriciocarrero15@gmail.com",
    "phone": "3143159054",
    "national_id": "10902357102",
    "date_of_birth": "24/07/1992",
    "id": "cus_2xHJayvPVd3BpmdC7",
    "object": "customer",
    "created_at": 1736431274,
    "corporate": false,
    "custom_reference": "",
    "payment_sources": {
        "object": "list",
        "has_more": false,
        "total": 1,
        "data": [
            {
                "id": "off_ref_2xHJayvPVd3BpmdC8",
                "object": "payment_source",
                "provider": "Cash",
                "store_names": [
                    "7 Eleven",
                    "Farmacias del Ahorro",
                    "CIRCLE K",
                    "Tiendas Extra",
                    "Farmacia Benavides",
                    "Soriana",
                    "WALDO'S",
                    "ELECZION",
                    "Super Kiosko",
                    "Farmacias Bazar",
                    "Wolworth",
                    "Del Sol",
                    "Yepas",
                    "Farmacias De Dios",
                    "Farmacias Nosarco",
                    "Farmacias Santa Cruz",
                    "Farmacentro",
                    "Farmacias GyM",
                    "Farmacias San Francisco de Asis",
                    "Farmacias Union",
                    "Farmacias Zapotlan",
                    "Farmatodo",
                    "Al Super",
                    "BBVA ATM"
                ],
                "type": "cash_recurrent",
                "reference": "10001432529593700513",
                "barcode": "10001432529593700513",
                "barcode_url": "https://pt-common-s3-stg.s3.us-east-1.amazonaws.com/cash/cashin/10001432529593700513.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA3UN6375MIUQIEPPR%2F20250109%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250109T140114Z&X-Amz-Expires=604800&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEKb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIQDnUMdfgBMDfvGu3EUHtr2eLSE8RaxnTG65UjlIRKlc6QIg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-Signature=746f21ee99456086a032355da8ec083f382bcf57f4d56298c23eecbaf5aade75",
                "expires_at": 0,
                "created_at": 1736431274,
                "parent_id": "cus_2xHJayvPVd3BpmdC7"
            }
        ]
    }
}
```
```python Python
try:
  customer = conekta.Customer.create({
      "name": "Fulanito",
      "email": "fulanito@test.com",
      "phone": "+5218181818181",
      "payment_sources":[ {
        "type": "cash_recurrent"
      }]
  })
except conekta.ConektaError as e:
  print e.message

#Respuesta json de API
{
    "livemode": true,
    "name": "test",
    "email": "mauriciocarrero15@gmail.com",
    "phone": "3143159054",
    "national_id": "10902357102",
    "date_of_birth": "24/07/1992",
    "id": "cus_2xHJayvPVd3BpmdC7",
    "object": "customer",
    "created_at": 1736431274,
    "corporate": false,
    "custom_reference": "",
    "payment_sources": {
        "object": "list",
        "has_more": false,
        "total": 1,
        "data": [
            {
                "id": "off_ref_2xHJayvPVd3BpmdC8",
                "object": "payment_source",
                "provider": "Cash",
                "store_names": [
                    "7 Eleven",
                    "Farmacias del Ahorro",
                    "CIRCLE K",
                    "Tiendas Extra",
                    "Farmacia Benavides",
                    "Soriana",
                    "WALDO'S",
                    "ELECZION",
                    "Super Kiosko",
                    "Farmacias Bazar",
                    "Wolworth",
                    "Del Sol",
                    "Yepas",
                    "Farmacias De Dios",
                    "Farmacias Nosarco",
                    "Farmacias Santa Cruz",
                    "Farmacentro",
                    "Farmacias GyM",
                    "Farmacias San Francisco de Asis",
                    "Farmacias Union",
                    "Farmacias Zapotlan",
                    "Farmatodo",
                    "Al Super",
                    "BBVA ATM"
                ],
                "type": "cash_recurrent",
                "reference": "10001432529593700513",
                "barcode": "10001432529593700513",
                "barcode_url": "https://pt-common-s3-stg.s3.us-east-1.amazonaws.com/cash/cashin/10001432529593700513.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA3UN6375MIUQIEPPR%2F20250109%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250109T140114Z&X-Amz-Expires=604800&X-Amz-Security-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laq%2FMnczQvK03Yg292G7qBmjRwmiwfdvU8Meht09aDg%2Faq%2BzD5V22rOXBLkw0%2BZXmqtR9qUJtT0G3MouF9mQ4%3D&X-Amz-SignedHeaders=host&x-id=GetObject&X-Amz-Signature=746f21ee99456086a032355da8ec083f382bcf57f4d56298c23eecbaf5aade75",
                "expires_at": 0,
                "created_at": 1736431274,
                "parent_id": "cus_2xHJayvPVd3BpmdC7"
            }
        ]
    }
}
```
```javascript
customer = conekta.Customer.create({
    "name": "Fulanito",
    "email": "fulanito@test.com",
    "phone": "+5218181818181",
    "payment_sources":[ {
      "type": "cash_recurrent"
    }]
}, function(err, res) {
    console.log(res.toObject());
});

//Respuesta json de API
{
    "livemode": true,
    "name": "test",
    "email": "mauriciocarrero15@gmail.com",
    "phone": "3143159054",
    "national_id": "10902357102",
    "date_of_birth": "24/07/1992",
    "id": "cus_2xHJayvPVd3BpmdC7",
    "object": "customer",
    "created_at": 1736431274,
    "corporate": false,
    "custom_reference": "",
    "payment_sources": {
        "object": "list",
        "has_more": false,
        "total": 1,
        "data": [
            {
                "id": "off_ref_2xHJayvPVd3BpmdC8",
                "object": "payment_source",
                "provider": "Cash",
                "store_names": [
                    "7 Eleven",
                    "Farmacias del Ahorro",
                    "CIRCLE K",
                    "Tiendas Extra",
                    "Farmacia Benavides",
                    "Soriana",
                    "WALDO'S",
                    "ELECZION",
                    "Super Kiosko",
                    "Farmacias Bazar",
                    "Wolworth",
                    "Del Sol",
                    "Yepas",
                    "Farmacias De Dios",
                    "Farmacias Nosarco",
                    "Farmacias Santa Cruz",
                    "Farmacentro",
                    "Farmacias GyM",
                    "Farmacias San Francisco de Asis",
                    "Farmacias Union",
                    "Farmacias Zapotlan",
                    "Farmatodo",
                    "Al Super",
                    "BBVA ATM"
                ],
                "type": "cash_recurrent",
                "reference": "10001432529593700513",
                "barcode": "10001432529593700513",
                "barcode_url": "https://pt-common-s3-stg.s3.us-east-1.amazonaws.com/cash/cashin/10001432529593700513.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA3UN6375MIUQIEPPR%2F20250109%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250109T140114Z&X-Amz-Expires=604800&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEKb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIQDnUMdfgBMDfvGu3EUHtr2eLSE8RaxnTG65UjlIRKlc6QIgMgdOunLOiZulAHLSb6iLKN7jgQdnlQ3xesyorPPRr%2F0q%2FgMIj%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARADGgw3OTk4MDEwODE2ODgiDAdq0uwghuOV16l3BirSA%2FcOvgp7mhcN76odCknkxTrBRlcIgP%2Bv%2B2w0YJyOSIvPj5eg3%2FhUp1AC6VwR5q7QKWe1IHE60cEx6%2FmX47Yoku2MWS67hkkOUNpbZ3XPyRas3DG7JAN5dweXyK056wDPfw%2BB8vffZBmB86nVkTN9h%2BLgLKpDVObCX7sNKpBlYK5fQVl90md0TsOwmBKyI9FvQypT5rkYc%2FMKXkH9W%2BlEO5uwLUUdmLqSwxroHuRp8geYtH6je2NEIrZDKLDvHbysMkK6oCaHJ%2Bd%2FCFiPic1IEJEykJHGVqA4PCSYnIn7MUsrxDErPDOljLSYg5t4Nr9%2BsJqWACQad%2FcN4QdCXKfbiJqX%2BocC74owsIYyureTWmLyuyt9NvIChXHKJaiySXsX8Au3oAY9D1tc%2FsUem5aleE1C5P7q65TFzE%2B6Bd%2Fjm9eBvPM2gSW5stvRW4zP7B7nZ4S3%2B3CW8%2FbiLafC0QxHwgbewO7E8PWh8WLH%2B0ydAyH9J0DTDrQhFdpJtDSUcTnswz9vYQFA2cqztOFBdWFMuMfeELiIq0Yq7cf2NHNU2xX994d27Odt475ee5CJAtpaK3LGLH5W1jznD8%2Bbs0AHf6JfYkEoF5%2BaT2TDEmQtXdhMxvYwt6f%2FuwY6pQEdeaiUTUG8gBHztXReVZeTrdYX423PEDK5NFLXtvXiPlHoKux%2BRONGwhGQ%2Bjisf0Qt5AO3EGw2pzwS7heuafndZgyT%2FZI8CW0W3zxyluTqx8qfXP3E5Srvg5f%2B%2Bu7xglk9hfO%2FUOlaq%2FMnczQvK03Yg292G7qBmjRwmiwfdvU8Meht09aDg%2Faq%2BzD5V22rOXBLkw0%2BZXmqtR9qUJtT0G3MouF9mQ4%3D&X-Amz-SignedHeaders=host&x-id=GetObject&X-Amz-Signature=746f21ee99456086a032355da8ec083f382bcf57f4d56298c23eecbaf5aade75",
                "expires_at": 0,
                "created_at": 1736431274,
                "parent_id": "cus_2xHJayvPVd3BpmdC7"
            }
        ]
    }
}
```
```java Java
try{
  Customer customer = Customer.create(
    new JSONObject("{"
        + "'name': 'Fulanito',"
        + "'email': 'fulanito@test.com',"
        + "'phone': '+5218181818181',"
        + "'payment_sources':[ {"
          + "'type': 'cash_recurrent',"
        + "}]"
    + "}"
    )
  );
}catch (Conekta::Error e) {
   System.out.println(e.details.get(0).message);
}

//Respuesta json de API
{
    "livemode": true,
    "name": "test",
    "email": "mauriciocarrero15@gmail.com",
    "phone": "3143159054",
    "national_id": "10902357102",
    "date_of_birth": "24/07/1992",
    "id": "cus_2xHJayvPVd3BpmdC7",
    "object": "customer",
    "created_at": 1736431274,
    "corporate": false,
    "custom_reference": "",
    "payment_sources": {
        "object": "list",
        "has_more": false,
        "total": 1,
        "data": [
            {
                "id": "off_ref_2xHJayvPVd3BpmdC8",
                "object": "payment_source",
                "provider": "Cash",
                "store_names": [
                    "7 Eleven",
                    "Farmacias del Ahorro",
                    "CIRCLE K",
                    "Tiendas Extra",
                    "Farmacia Benavides",
                    "Soriana",
                    "WALDO'S",
                    "ELECZION",
                    "Super Kiosko",
                    "Farmacias Bazar",
                    "Wolworth",
                    "Del Sol",
                    "Yepas",
                    "Farmacias De Dios",
                    "Farmacias Nosarco",
                    "Farmacias Santa Cruz",
                    "Farmacentro",
                    "Farmacias GyM",
                    "Farmacias San Francisco de Asis",
                    "Farmacias Union",
                    "Farmacias Zapotlan",
                    "Farmatodo",
                    "Al Super",
                    "BBVA ATM"
                ],
                "type": "cash_recurrent",
                "reference": "10001432529593700513",
                "barcode": "10001432529593700513",
                "barcode_url": "https://pt-common-s3-stg.s3.us-east-1.amazonaws.com/cash/cashin/10001432529593700513.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA3UN6375MIUQIEPPR%2F20250109%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250109T140114Z&X-Amz-Expires=604800&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEKb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIQDnUMdfgBMDfvGu3EUHtr2eLSE8RaxnTG65UjlIRKlc6QIgMgdOunLOiZulAHLSb6iLKN7jgQdnlQ3xesyorPPRr%2F0q%2FgMIj%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARADGgw3OTk4MDEwODE2ODgiDAdq0uwghuOV16l3BirSA%2FcOvgp7mhcN76odCknkxTrBRlcIgP%2Bv%2B2w0YJyOSIvPj5eg3%2FhUp1AC6VwR5q7QKWe1IHE60cEx6%2FmX47Yoku2MWS67hkkOUNpbZ3XPyRas3DG7JAN5dweXyK056wDPfw%2BB8vffZBmB86nVkTN9h%2BLgLKpDVObCX7sNKpBlYK5fQVl90md0TsOwmBKyI9FvQypT5rkYc%2FMKXkH9W%2BlEO5uwLUUdmLqSwxroHuRp8geYtH6je2NEIrZDKLDvHbysMkK6oCaHJ%2Bd%2FCFiPic1IEJEykJHGVqA4PCSYnIn7MUsrxDErPDOljLSYg5t4Nr9%2BsJqWACQad%2FcN4QdCXKfbiJqX%2BocC74owsIYyureTWmLyuyt9NvIChXHKJaiySXsX8Au3oAY9D1tc%2FsUem5aleE1C5P7q65TFzE%2B6Bd%2Fjm9eBvPM2gSW5stvRW4zP7B7nZ4S3%2B3CW8%2FbiLafC0QxHwgbewO7E8PWh8WLH%2B0ydAyH9J0DTDrQhFdpJtDSUcTnswz9vYQFA2cqztOFBdWFMuMfeELiIq0Yq7cf2NHNU2xX994d27Odt475ee5CJAtpaK3LGLH5W1jznD8%2Bbs0AHf6JfYkEoF5%2BaT2TDEmQtXdhMxvYwt6f%2FuwY6pQEdeaiUTUG8gBHztXReVZeTrdYX423PEDK5NFLXtvXiPlHoKux%2BRONGwhGQ%2Bjisf0Qt5AO3EGw2pzwS7heuafndZgyT%2FZI8CW0W3zxyluTqx8qfXP3E5Srvg5f%2B%2Bu7xglk9hfO%2FUOlaq%2FMnczQvK03Yg292G7qBmjRwmiwfdvU8Meht09aDg%2Faq%2BzD5V22rOXBLkw0%2BZXmqtR9qUJtT0G3MouF9mQ4%3D&X-Amz-SignedHeaders=host&x-id=GetObject&X-Amz-Signature=746f21ee99456086a032355da8ec083f382bcf57f4d56298c23eecbaf5aade75",
                "expires_at": 0,
                "created_at": 1736431274,
                "parent_id": "cus_2xHJayvPVd3BpmdC7"
            }
        ]
    }
}
```
```csharp
try{
  conekta.Customer customer = new conekta.Customer ().create(@"{
      ""name"": ""Fulanito"",
      ""email"": ""fulanito@test.com"",
      ""phone"": ""+5218181818181"",
      ""payment_sources"": [{
        ""type"": ""cash_recurrent"",
      }]
  }");
} catch (ConektaException e) {
  foreach (JObject obj in e.details) {
    System.Console.WriteLine("\n [ERROR]:\n");
    System.Console.WriteLine("message:\t" + obj.GetValue("message"));
    System.Console.WriteLine("debug:\t" + obj.GetValue("debug_message"));
    System.Console.WriteLine("code:\t" + obj.GetValue("code"));
  }
}

//Respuesta json de API
{
{
    "livemode": true,
    "name": "test",
    "email": "mauriciocarrero15@gmail.com",
    "phone": "3143159054",
    "national_id": "10902357102",
    "date_of_birth": "24/07/1992",
    "id": "cus_2xHJayvPVd3BpmdC7",
    "object": "customer",
    "created_at": 1736431274,
    "corporate": false,
    "custom_reference": "",
    "payment_sources": {
        "object": "list",
        "has_more": false,
        "total": 1,
        "data": [
            {
                "id": "off_ref_2xHJayvPVd3BpmdC8",
                "object": "payment_source",
                "provider": "Cash",
                "store_names": [
                    "7 Eleven",
                    "Farmacias del Ahorro",
                    "CIRCLE K",
                    "Tiendas Extra",
                    "Farmacia Benavides",
                    "Soriana",
                    "WALDO'S",
                    "ELECZION",
                    "Super Kiosko",
                    "Farmacias Bazar",
                    "Wolworth",
                    "Del Sol",
                    "Yepas",
                    "Farmacias De Dios",
                    "Farmacias Nosarco",
                    "Farmacias Santa Cruz",
                    "Farmacentro",
                    "Farmacias GyM",
                    "Farmacias San Francisco de Asis",
                    "Farmacias Union",
                    "Farmacias Zapotlan",
                    "Farmatodo",
                    "Al Super",
                    "BBVA ATM"
                ],
                "type": "cash_recurrent",
                "reference": "10001432529593700513",
                "barcode": "10001432529593700513",
                "barcode_url": "https://pt-common-s3-stg.s3.us-east-1.amazonaws.com/cash/cashin/10001432529593700513.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA3UN6375MIUQIEPPR%2F20250109%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250109T140114Z&X-Amz-Expires=604800&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEKb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIQDnUMdfgBMDfvGu3EUHtr2eLSE8RaxnTG65UjlIRKlc6QIgMgdOunLOiZulAHLSb6iLKN7jgQdnlQ3xesyorPPRr%2F0q%2FgMIj%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARADGgw3OTk4MDEwODE2ODgiDAdq0uwghuOV16l3BirSA%2FcOvgp7mhcN76odCknkxTrBRlcIgP%2Bv%2B2w0YJyOSIvPj5eg3%2FhUp1AC6VwR5q7QKWe1IHE60cEx6%2FmX47Yoku2MWS67hkkOUNpbZ3XPyRas3DG7JAN5dweXyK056wDPfw%2BB8vffZBmB86nVkTN9h%2BLgLKpDVObCX7sNKpBlYK5fQVl90md0TsOwmBKyI9FvQypT5rkYc%2FMKXkH9W%2BlEO5uwLUUdmLqSwxroHuRp8geYtH6je2NEIrZDKLDvHbysMkK6oCaHJ%2Bd%2FCFiPic1IEJEykJHGVqA4PCSYnIn7MUsrxDErPDOljLSYg5t4Nr9%2BsJqWACQad%2FcN4QdCXKfbiJqX%2BocC74owsIYyureTWmLyuyt9NvIChXHKJaiySXsX8Au3oAY9D1tc%2FsUem5aleE1C5P7q65TFzE%2B6Bd%2Fjm9eBvPM2gSW5stvRW4zP7B7nZ4S3%2B3CW8%2FbiLafC0QxHwgbewO7E8PWh8WLH%2B0ydAyH9J0DTDrQhFdpJtDSUcTnswz9vYQFA2cqztOFBdWFMuMfeELiIq0Yq7cf2NHNU2xX994d27Odt475ee5CJAtpaK3LGLH5W1jznD8%2Bbs0AHf6JfYkEoF5%2BaT2TDEmQtXdhMxvYwt6f%2FuwY6pQEdeaiUTUG8gBHztXReVZeTrdYX423PEDK5NFLXtvXiPlHoKux%2BRONGwhGQ%2Bjisf0Qt5AO3EGw2pzwS7heuafndZgyT%2FZI8CW0W3zxyluTqx8qfXP3E5Srvg5f%2B%2Bu7xglk9hfO%2FUOlaq%2FMnczQvK03Yg292G7qBmjRwmiwfdvU8Meht09aDg%2Faq%2BzD5V22rOXBLkw0%2BZXmqtR9qUJtT0G3MouF9mQ4%3D&X-Amz-SignedHeaders=host&x-id=GetObject&X-Amz-Signature=746f21ee99456086a032355da8ec083f382bcf57f4d56298c23eecbaf5aade75",
                "expires_at": 0,
                "created_at": 1736431274,
                "parent_id": "cus_2xHJayvPVd3BpmdC7"
            }
        ]
    }
}
```
```go
payment := &conekta.PaymentSourceCreateParams{
    PaymentType: "cash_recurrent",
}

cus := &conekta.CustomerParams{}
cus.Name = "fulanito"
cus.Email = "fulanito@test.com"
cus.Phone = "+5215555555555"
cus.PaymentSources = append(cus.PaymentSources, payment)

res, err := customer.Create(cus)

//Respuesta de API
{
{
    "livemode": true,
    "name": "test",
    "email": "mauriciocarrero15@gmail.com",
    "phone": "3143159054",
    "national_id": "10902357102",
    "date_of_birth": "24/07/1992",
    "id": "cus_2xHJayvPVd3BpmdC7",
    "object": "customer",
    "created_at": 1736431274,
    "corporate": false,
    "custom_reference": "",
    "payment_sources": {
        "object": "list",
        "has_more": false,
        "total": 1,
        "data": [
            {
                "id": "off_ref_2xHJayvPVd3BpmdC8",
                "object": "payment_source",
                "provider": "Cash",
                "store_names": [
                    "7 Eleven",
                    "Farmacias del Ahorro",
                    "CIRCLE K",
                    "Tiendas Extra",
                    "Farmacia Benavides",
                    "Soriana",
                    "WALDO'S",
                    "ELECZION",
                    "Super Kiosko",
                    "Farmacias Bazar",
                    "Wolworth",
                    "Del Sol",
                    "Yepas",
                    "Farmacias De Dios",
                    "Farmacias Nosarco",
                    "Farmacias Santa Cruz",
                    "Farmacentro",
                    "Farmacias GyM",
                    "Farmacias San Francisco de Asis",
                    "Farmacias Union",
                    "Farmacias Zapotlan",
                    "Farmatodo",
                    "Al Super",
                    "BBVA ATM"
                ],
                "type": "cash_recurrent",
                "reference": "10001432529593700513",
                "barcode": "10001432529593700513",
                "barcode_url": "https://pt-common-s3-stg.s3.us-east-1.amazonaws.com/cash/cashin/10001432529593700513.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA3UN6375MIUQIEPPR%2F20250109%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250109T140114Z&X-Amz-Expires=604800&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEKb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIQDnUMdfgBMDfvGu3EUHtr2eLSE8RaxnTG65UjlIRKlc6QIgMgdOunLOiZulAHLSb6iLKN7jgQdnlQ3xesyorPPRr%2F0q%2FgMIj%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARADGgw3OTk4MDEwODE2ODgiDAdq0uwghuOV16l3BirSA%2FcOvgp7mhcN76odCknkxTrBRlcIgP%2Bv%2B2w0YJyOSIvPj5eg3%2FhUp1AC6VwR5q7QKWe1IHE60cEx6%2FmX47Yoku2MWS67hkkOUNpbZ3XPyRas3DG7JAN5dweXyK056wDPfw%2BB8vffZBmB86nVkTN9h%2BLgLKpDVObCX7sNKpBlYK5fQVl90md0TsOwmBKyI9FvQypT5rkYc%2FMKXkH9W%2BlEO5uwLUUdmLqSwxroHuRp8geYtH6je2NEIrZDKLDvHbysMkK6oCaHJ%2Bd%2FCFiPic1IEJEykJHGVqA4PCSYnIn7MUsrxDErPDOljLSYg5t4Nr9%2BsJqWACQad%2FcN4QdCXKfbiJqX%2BocC74owsIYyureTWmLyuyt9NvIChXHKJaiySXsX8Au3oAY9D1tc%2FsUem5aleE1C5P7q65TFzE%2B6Bd%2Fjm9eBvPM2gSW5stvRW4zP7B7nZ4S3%2B3CW8%2FbiLafC0QxHwgbewO7E8PWh8WLH%2B0ydAyH9J0DTDrQhFdpJtDSUcTnswz9vYQFA2cqztOFBdWFMuMfeELiIq0Yq7cf2NHNU2xX994d27Odt475ee5CJAtpaK3LGLH5W1jznD8%2Bbs0AHf6JfYkEoF5%2BaT2TDEmQtXdhMxvYwt6f%2FuwY6pQEdeaiUTUG8gBHztXReVZeTrdYX423PEDK5NFLXtvXiPlHoKux%2BRONGwhGQ%2Bjisf0Qt5AO3EGw2pzwS7heuafndZgyT%2FZI8CW0W3zxyluTqx8qfXP3E5Srvg5f%2B%2Bu7xglk9hfO%2FUOlaq%2FMnczQvK03Yg292G7qBmjRwmiwfdvU8Meht09aDg%2Faq%2BzD5V22rOXBLkw0%2BZXmqtR9qUJtT0G3MouF9mQ4%3D&X-Amz-SignedHeaders=host&x-id=GetObject&X-Amz-Signature=746f21ee99456086a032355da8ec083f382bcf57f4d56298c23eecbaf5aade75",
                "expires_at": 0,
                "created_at": 1736431274,
                "parent_id": "cus_2xHJayvPVd3BpmdC7"
            }
        ]
    }
}
```

### Parámetros Opcionales

| Parámetro                    | Descripción                                                                                                      | Tipo |
| :--------------------------- | :--------------------------------------------------------------------------------------------------------------- | :--- |
| payment\_sources.expires\_at | Fecha de expiración (Es la hora medida en número de segundos en formato [UNIX](https://www.epochconverter.com/)) | Int  |

### Presentar la ficha de pago

La siguiente ficha, es una forma sugerida para mostrar a tus clientes la referencia de pago en efectivo con la información más relevante, además de presentar los pasos necesarios para completar el proceso en el punto de venta elegido.

Recomendamos que la incluyas en tu Checkout o enviarla por algún medio de comunicación para mejorar la experiencia con tu cliente.

* Ficha de pago para [Red Alterna ](https://github.com/conekta/red-alterna-stub)

<br />

### Servicio de Notificaciones

Conekta dispone de un servicio de notificaciones a usuario final que se activarán por default enviando mails a la dirección de correo del customer del cargo asociado de pago en efectivo.

*Notificaciones que se envían:* \*

| Notificación | Descripción                                                                                  | Vía   |
| :----------- | :------------------------------------------------------------------------------------------- | :---- |
| Pago exitoso | Cuando el usuario final ha pagado la referencia en cualquier tienda de conveniencia del país | Email |

Ejemplo de ficha con **Pago exitoso** en Efectivo

![](https://files.readme.io/1acb043-Referencia_paga.png)

En este [link](https://drive.google.com/drive/folders/11JoO5U9pU-4V1v4q3206pzm9r7JLAV7P) puedes descargar los logos de nuestra **Red de Efectivo**.

## 3. Crea un Webhook

Recuerda que Conekta debe estar en constante comunicación con tu sitio a través de *Webhooks* para:

1\)​ Validar que la referencia del usuario sea correcta y pueda hacer pagos\
2\)​ Aprobar la cantidad que el usuario quiere pagar\
3\)​ Notificar un pago\
Un “Webhook” es un sistema de notificaciones, donde tu sitio debe definir una dirección o URL, para que nuestra API mande peticiones HTTP y pueda notificarte de los eventos que se van a realizar en tu sitio. Por ello, deberás crear un “Webhook” desde tu perfil de administrador con los siguientes pasos:

Abre el menú principal de tu cuenta, ubicado en la esquina superior derecha, y selecciona la sección “​Webhooks”.

## 3.1 Crear un Webhook Sincrónico para Aprobar Pagos

En el caso de pagos recurrentes, vas a recibir eventos especiales para poder aprobar o declinar los pagos de forma dinámica.  Estas peticiones te van a llegar en tiempo real y tienes un máximo de dos segundos para contestarlas o se va declinar el pago.  En el Perfil de Administrador abre el menú principal de tu cuenta, ubicado en la esquina superior derecha, y selecciona *Desarrollador​*

![](https://files.readme.io/9f3ce552771dce7e1abbc543120d4228da75cf769036ee4544c994eaafa90c21-image.png)

luego la opción **Revisar webhooks**

![](https://files.readme.io/6d5afd86018bcdca280829896d606465d10114535a1c3f16825b4de41a579321-image.png)

<br />

Selecciona la opción “​Crear Webhook” al presionarlo se abrirá una ventana con un formulario en donde deberás colocar la dirección o URL del “Webhook” donde deseas recibir las notificaciones de los pagos recurrentes en efectivo con Conekta.

![](https://files.readme.io/93a6fee7cd193dc2b7191f0edf2dd283e56e2fe9f7d19b60f6eda09bb570570c-image.png)

selecciona los siguientes eventos y da clic en “Crear webhook”

![](https://files.readme.io/1ff833a31bac1063394408d94e081e043cc3be03b26584bfa1c10720447f336d-image.png)

<br />

Ya estás listo para recibir pagos recurrentes desde tu sitio.

## 3.2 Crea un Webhook asincrónico para recibir notificaciones de pagos

Adicional al primer Webhook, tendrías que armar *endpoint* para escuchar notificaciones asincrónicas de pago.  A diferencia de las notificaciones anteriores, Conekta va reintentar las notificaciones en caso de que fallen y vas a recibir mayor carga de otras notificaciones por eso que es importante ocupar otro endpoint.

Cuando creas este Webhook, no tendrías que indicar que es para pagos recurrentes.

## 4. Responder a Webhooks

A diferencia de métodos de pago en línea, como tarjetas, los usuarios tienen que realizar acciones offline para hacer pagos en efectivo así que flujo es asincrónico y el procesamiento y seguridad de notificaciones es fundamental para tu flujo.

## 4.1 Responder a Consultas

El primer evento, es una notificación sincrónica de consulta y con el tipo de evento: `
inbound_payment.lookup`.

```json
{
  "data":{
    "object": {
      "payment_method": {
        "service_name": "Cash",
        "barcode_url": "https://barcode/url.png",
        "object": "cash_payment",
        "type": "cash",
        "expires_at": 1541289600,
        "reference": "8400003726321"
      },
      "charge_id": "5bb675388a268e0ef4a56a42",
      "livemode": true,
      "created_at": 0,
      "object": "inbound_payment",
      "amount": 0,
      "currency": "MXN",
      "customer_id": "cus_2jP5P8huCTWqcTtrn"
    },
    "previous_attributes": {}
  },
  "livemode": true,
  "webhook_status": "not_applicable",
  "webhook_logs": [],
  "id": "5b438f82583eb80d50b4652c",
  "object": "event",
  "type": "inbound_payment.lookup",
  "created_at": 1531154306
}
```

Para aprobar el pago tendrías que contestar en JSON, indicar que *payable* es true, y el rango de cantidades en centavos.

```json
{
    "payable": true,
    "min_amount": 5000,
    "max_amount": 1000000
}
```

En caso que quieras declinar un pago, puedes indicar *payable: false* y un código de rechazo.  Puedes consultar la lista completa de códigos de rechazo al [final del tutorial](https://developers.conekta.com/page/pagos-recurrentes-en-efectivo#addendum---c%C3%B3digos-de-rechazo).

```json
{
    "payable": false,
    "failure_code": "15"
}
```

## 4.2 Responder a confirmaciones de Pago

La segunda notificación a responder, es una notificación sincrónica de confirmación del monto que se está intentando pagar y con el tipo de evento: `
inbound_payment.payment_attempt`.

```json
{
  "data": {
  "object": {
    "payment_method": {
        "service_name":"Cash",
        "barcode_url": "https://s3.amazonaws.com/cash_payment_barcodes/84000045432316.png",
        "object": "cash_payment",
        "type": "cash",
        "expires_at": 1541289600,
        "reference": "84000045432316"
      },
      "charge_id": "5bb6755d8a268e0ed9a56acb", "livemode": true,
      "created_at": 1538684253,
      "object": "inbound_payment",
      "amount": 110700,
      "currency": "MXN",
      "customer_id": "cus_2jHUgfTB4pYmjmHpB"
    },
    "previous_attributes": {}
  },
  "livemode": true,
  "webhook_status": "not_applicable",
  "webhook_logs": [],
  "id": "5b439072583eb80d50b46534",
  "object": "event",
  "type": "inbound_payment.payment_attempt",
  "created_at": 1531154546
}
```

Para aprobar el pago tendrías que contestar en JSON, indicando nuevamente que *payable es true*

```json
{
    "payable": true
}
```

En caso que quieras declinar un pago, puedes indicar *payable: false* y un código de rechazo.  Puedes consultar la lista completa de códigos de rechazo al [fin del tutorial](https://developers.conekta.com/page/pagos-recurrentes-en-efectivo#addendum---c%C3%B3digos-de-rechazo).

```json
{
    "payable": false,
    "failure_code": "15"
}
```

## 5. Pagos en Bbva

Si cuenta con Bbva como proveedor cash, tu referencia te permitirá pagar en las practi-cajas o banca móvil usando el numero de referencia y numero de convenio

```json
{
   "next_page_url":null,
   "previous_page_url":null,
   "has_more":false,
   "object":"list",
   "data":[
      {
         "id":"off_ref_2xS8j15kfkNvW1UnZ",
         "object":"payment_source",
         "provider":"Cash",
         "store_names":[
            "7 Eleven",
            "Farmacias del Ahorro",
            "CIRCLE K",
            "Tiendas Extra",
            "Farmacia Benavides",
            "Soriana",
            "WALDO'S",
            "ELECZION",
            "Super Kiosko",
            "Farmacias Bazar",
            "Wolworth",
            "Del Sol",
            "Yepas",
            "Farmacias De Dios",
            "Farmacias Nosarco",
            "Farmacias Santa Cruz",
            "Farmacentro",
            "Farmacias GyM",
            "Farmacias San Francisco de Asis",
            "Farmacias Union",
            "Farmacias Zapotlan",
            "Farmatodo",
            "Al Super",
            "BBVA ATM"
         ],
         "type":"cash_recurrent",
         "reference":"10001151504365701311",
         "barcode":"10001151504365701311",
         "barcode_url":"https://s3.amazonaws.com/cash_payment_barcodes/84000045432316.png",
         "expires_at":1741143600,
         "created_at":1738764902,
         "parent_id":"cus_2xS8j15kfkNvW1UnY",
         "agreements":[
            {
               "provider":"bbva_cash_in",
               "agreement":"2409526"
            }
         ]
      }
   ]
}
```

<br />

## 6. Recibir confirmaciones de pago

La última notificación a recibir es una notificación asincrónica de pago con el tipo de evento: `
charge.paid`.  Para incrementar la seguridad es importante [verificar la firma de notificaciones](https://dash.readme.com/project/conekta-dev-center/v1.0/page/webhook-authentication).  El siguiente ejemplo pertenece a una notificación de pago:

```json
{
  "data": {
    "object": {
      "id": "5c0968098a268e02ab8aa3f7",
      "livemode": true,
      "created_at": 1544120329,
      "currency": "MXN",
      "description": null,
      "reference_id": null,
      "failure_code": null,
      "failure_message": null,
      "monthly_installments": null,
      "device_fingerprint": null,
      "refunds": [],
      "payment_method": {
        "barcode": "XXXXXXXXX",
        "reference": "XXXXXXXXX",
        "barcode_url": "https://s3.amazonaws.com/cash_payment_barcodes/XXXXXXXXX.png",
        "object": "cash_payment",
        "type": "cash",
        "expires_at": 1546732800,
        "store_name": "XXXX"
      },
      "details": {
        "name": "Juan Perez",
        "phone": null,
        "email": "juan_perez@conekta.com",
        "line_items": [],
        "coupons": [],
        "object": "details"
      },
      "object": "charge",
      "status": "paid",
      "amount": 350000,
      "paid_at": 1544120362,
      "fee": 10150,
      "customer_id": "cus_2j35ehQaF1jZEcWH7",
      "subscription_id": "",
      "amount_refunded": null
      },
    "previous_attributes": {}
  },
  "livemode": true,
  "webhook_status": "not_applicable",
  "webhook_logs": [],
  "id": "5b439072583eb80d50b46534",
  "object": "event",
  "type": "charge.paid",
  "created_at": 1531154546
}
```

## 7. Flujos de prueba

Tienes disponibles *endpoints* para que para que puedas probar el flujo de pagos end-to-end antes de hacer pruebas. Recuerda que todo se puede probar apuntando al endpoint de `https://api.conekta.io/payment_test`

Para comenzar a probar los flujos de cash de prueba tienes que habilitar tu negocio en modo pruebas

<Image title="WhatsApp Image 2023-01-24 at 3.29.49 PM.jpeg" alt={1280} align="center" src="https://files.readme.io/ba1c0dd-WhatsApp_Image_2023-01-24_at_3.29.49_PM.jpeg">
  Modo pruebas - Mi negocio
</Image>

## 7.1 Pruebas de Consultas

El siguiente payload va lanzar la notificación a tu endpoint de consulta.

```json
{
  "event_type": "inbound_payment.lookup",
  "reference": "99000000001273"
}
```

Por ejemplo

```curl
curl --request POST \
  --url https://api.conekta.io/payment_test \
  --header 'accept: application/vnd.conekta-v2.1.0+json' \
  -u YOUR_PRIVATE_SANDBOX_API_KEY: \
  --header 'content-type: application/json' \
  --data '{ "event_type": "inbound_payment.lookup", "reference": "99000000001273" }'
```

Ejemplo de payload enviado de conekta hacia tu webhook

```json
{
	"payment_method": {
		"service_name": "Cash",
		"barcode_url": "https://pt-common-s3-stg.s3.amazonaws.com/sandbox_reference.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA3UN6375MIKAOP76P%2F20230117%2Fus-east-1%2F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4d9eZg4OSpsUAfA99%2FidsGwEr9fAJ9TpEZe4A0CV4pEblHjDsE6kZnrWmjgf3m0y%2BU2pq5EtUa4Yb4JYvSIBwf4tpUkOZ0LTP5gzYOlp05MrwVXJ1o%3D&X-Amz-SignedHeaders=host&X-Amz-Signature=f73dfc292d77d11fd698e86700f3b8528b0cff3c695c279fa7cc5e2a826f195a",
		"object": "cash_payment",
		"type": "cash",
		"expires_at": 1676592000,
		"reference": "33300000001256"
	},
	"charge_id": "63c6eb7ee24e880001b5ab2e",
	"livemode": false,
	"created_at": 0,
	"object": "inbound_payment",
	"amount": 0,
	"currency": "MXN",
	"fee": 143144,
	"customer_id": "cus_2tD12wMqvpRGTgK9i"
}
```

## 7.2 Pruebas de confirmaciones de pago

El siguiente payload te enviará una notificación de confirmación de pago a tu Webhook.

```json
{
  "event_type": "inbound_payment.payment_attempt",
  "reference": "99000000001273",
  "amount": "10000"
}
```

Por ejemplo

```curl
curl --request POST \
  --url https://api.conekta.io/payment_test \
  --header 'accept: application/vnd.conekta-v2.1.0+json' \
  -u YOUR_PRIVATE_SANDBOX_API_KEY: \
  --header 'content-type: application/json' \
  --data '{ "event_type": "inbound_payment.payment_attempt", "reference": "99000000001273", "amount": "10000" }'
```

Recibirás el siguiente payload en la petición de conekta hacia tu webhook

```json inbound_payment.payment_attempt
{
	"payment_method": {
		"service_name": "Cash",
		"barcode_url": "https://xxxx.s3.amazonaws.com/sandbox_reference.png",
		"object": "cash_payment",
		"type": "cash",
		"expires_at": 1677110400,
		"reference": "33300000001274"
	},
	"charge_id": "63cec65e01b900000132912e",
	"livemode": false,
	"created_at": 1674495582,
	"object": "inbound_payment",
	"amount": 20000,
	"currency": "MXN",
	"fee": 905,
	"customer_id": "cus_2tExAUj4NRYiM5Vuq"
}
```

## 7.3 Pruebas de reversos de pago

El siguiente payload va lanzar una notificación de reverso de pago a tu Webhook.

```json
{
  "event_type": "inbound_payment.reverse",
  "reference": "99000000001273"
}
```

Por ejemplo

```curl
curl --request POST \
  --url https://api.conekta.io/payment_test \
  --header 'accept: application/vnd.conekta-v2.1.0+json' \
  -u YOUR_PRIVATE_SANDBOX_API_KEY: \
  --header 'content-type: application/json' \
  --data '{ "event_type": "inbound_payment.reverse", "reference": "99000000001273" }'
```

Recibirás los siguientes eventos de conekta hacia tu webhook.\
charge.reversed\
order.reversed

```json charge.reversed
{
	"id": "63cec71b01b9000001329149",
	"livemode": false,
	"created_at": 1674495771,
	"currency": "MXN",
	"description": null,
	"reference_id": null,
	"failure_code": null,
	"failure_message": null,
	"monthly_installments": null,
	"device_fingerprint": null,
	"channel": null,
	"refunds": [],
	"payment_method": {
		"barcode": "33300000001276",
		"reference": "33300000001276",
		"barcode_url": "https://xxxx.s3.amazonaws.com/sandbox_reference.png",
		"store": null,
		"auth_code": 66685306,
		"object": "cash_payment",
		"type": "cash",
		"expires_at": 1677110400,
		"store_name": "XXXX"
	},
	"details": {
		"name": "Jorge",
		"phone": "8181818181",
		"email": "customer@conekta.com",
		"line_items": [],
		"coupons": [],
		"object": "details"
	},
	"object": "charge",
	"status": "reversed",
	"amount": 20000,
	"paid_at": null,
	"fee": 905,
	"customer_id": "cus_2tExCqJdhJgj33GYr",
	"subscription_id": "",
	"amount_refunded": null,
	"customer_custom_reference": null
}
```

```json
{
	"livemode": false,
	"amount": 20000,
	"currency": "MXN",
	"payment_status": "reversed",
	"amount_refunded": 0,
	"customer_info": {
		"email": "customer@conekta.com",
		"phone": "818181818181",
		"name": "Jorge",
		"corporate": false,
		"customer_id": "cus_2tExCqJdhJgj33GYr",
		"object": "customer_info"
	},
	"object": "order",
	"id": "ord_2tExCzuHTu1AAYtvL",
	"metadata": {},
	"is_refundable": false,
	"created_at": 1674495771,
	"updated_at": 1674495771,
	"charges": {
		"object": "list",
		"has_more": false,
		"total": 1,
		"data": [
			{
				"id": "63cec71b01b9000001329149",
				"livemode": false,
				"created_at": 1674495771,
				"currency": "MXN",
				"payment_method": {
					"service_name": "Cash",
					"barcode_url": "https://xxxx.s3.amazonaws.com/sandbox_reference.png",
					"auth_code": 66685306,
					"object": "cash_payment",
					"type": "cash",
					"expires_at": 1677110400,
					"store_name": "XXXX",
					"reference": "33300000001276"
				},
				"object": "charge",
				"status": "reversed",
				"amount": 20000,
				"fee": 905,
				"customer_id": "cus_2tExCqJdhJgj33GYr",
				"order_id": "ord_2tExCzuHTu1AAYtvL"
			}
		]
	}
}
```

## Códigos de rechazo

Te compartimos los siguientes códigos de rechazo para que puedes comunicar fallas a tus clientes en cajero

| failure\_code | Descripción                     |
| :------------ | :------------------------------ |
| 01            | Referencia no encontrada        |
| 02            | Cantidad inválida               |
| 03            | Referencia expirada             |
| 10            | Referencia sin deuda            |
| 13            | Referencia inactiva             |
| 14            | Referencia cancelada            |
| 15            | Usuario bloqueado               |
| 16            | Cantidad no permitida           |
| 18            | Comercio fuera de horario       |
| 19            | No autorizado                   |
| 35            | Monto fuera del rango permitido |
| 36            | Referencia ya pagada            |