Recibiendo notificaciones de pagos por medio de Webhooks

Esta es una referencia sobre notificaciones en Conekta y de cómo manejarlas.

¿Qué son Webhooks?

Un Webhook es una notificación de eventos por medio de HTTP POST, podrías pensarlo como un HTTP callback. Cuando algo sucede en Conekta, por ejemplo, un cargo fue pagado, el mecanismo notifica a tu servidor por medio de un HTTP POST (Webhook). Mientras tu puedes recibir notificaciones por correo, tu servidor típicamente procesa eventos por medio de esta forma de comunicación entre servidores.


¿Qué hacen los Webhooks?

Puedes usar los Webhooks para recibir notificaciones de cualquier evento en tu cuenta. La configuración de webhooks es flexible, y puedes recibir estas notificaciones en tantos servidores quieras. Si tu servidor no puede ser localizado cuando el webhook es enviado, el servidor volverá a intentar.

Con webhooks puedes:

  1. Recibir notificaciones de compras exitosas de cualquier método de pago.

  2. Actualizar aplicaciones o servicios no conectados al API.

  3. Recibir notificaciones de actualizaciones de negocios como contracargos y eventos de cargos recurrentes, que no son generados por llamadas al API.


¿Cómo configurar Webhooks?

Al crear tu cuenta, puedes configurar los webhooks en la sección de Desarrolladores / Webhooks en el admin. En esta sección puedes agregar, borrar modificar urls para recibir notificaciones. Puedes limitar los webhooks a que sean de producción o de pruebas y enviar notificaciones de prueba para probar que puedan responder tus listeners.


La notificación será enviada a todos los URLs que asignaste en la sección de Webhooks la cual permitirá que tus aplicaciones respondan a eventos de pago. Las notificaciones serán hechas con peticiones post a tu listener, aquí hay algunos ejemplos que puedes usar para recibir notificaciones.

$ gem install ultrahook
$ echo "api_key: my-ultrahook-api-hey" > ~/.ultrahook
$ ultrahook webhook-test 5000

Authenticated as conekta
Forwarding activated...
http://webhook-test.conekta.ultrahook.com -> http://localhost:5000
# N/A
require 'json'

#example in sinatra
post '/my/webhook/url' do

  #Analizar la información del evento en forma de json
  event_json = JSON.parse(request.body.read)

  case event_json['type']
  when 'charge.paid'
    
  #Hacer algo con la información como actualizar los atributos de la orden en tu base de datos
      
  #charge = Charge.find(event_json['object']['id'])

  end
end
// Analizar la información del evento en forma de json
$body = @file_get_contents('php://input');
$event_json = json_decode($body);
http_response_code(200); // Return 200 OK

if ($event_json->type == 'charge.paid'){
 
 //Hacer algo con la información como actualizar los atributos de la orden en tu base de datos
 
 //charge = $this->Charge->find('first', array(
 
 //  'conditions' => array('Charge.id' => $event_json->object->id)
 
 //))
}
import json

# Analizar la información del evento en forma de json en Django
event_json = json.loads(HttpRequest.body)

if event_json.type == 'charge.paid':
  
#Hacer algo con la información como actualizar los atributos de la orden en tu base de datos
  
#charge = EcommerceCharge.objects.get(pk=event_json['object']['id'])
// Analizar la información del evento en forma de json en javascript
event_json = typeof req.body == 'string' ? JSON.parse(req.body) : req.body;

if (event_json.type == 'charge.paid') {
   //Hacer algo con la información como actualizar los atributos de la orden en tu base de datos
}
import org.json.JSONObject;
  protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
      BufferedReader get_body = request.getReader();
     
      //Parsear JSON y manejar respuesta
    }
// Analizar la información del evento en forma de json
var event = JObject.Parse('req.body');

if (event['type'] == 'charge.paid') {
   //Hacer algo con la información como actualizar los atributos de la orden en tu base de datos
}

Si tu servidor cuenta con alguna restricción mediante Firewall debes añadir la IP de nuestro servidor de eventos 52.200.151.182. Además, puedes seleccionar un puerto específico para tus webhooks. Los puertos que soportamos son el 80, 443 y el rango del 1025 al 10001.


¿Cómo responder a un Webhook?

Para confirmar de que ya has recibido una notificación de un webhook correctamente, tu servidor debe regresar un código 200 de HTTP.


Cargo creado con tarjeta

Regresar a la lista de ejemplos

{
  "data": {
    "object": {
      "id": "5511d4ce2412294cf6000081",
      "livemode": false,
      "created_at": 1427231950,
      "status": "pending_payment",
      "currency": "MXN",
      "description": "Stogies",
      "reference_id": "9839-wolf_pack",
      "failure_code": null,
      "failure_message": null,
      "monthly_installments": null,
      "object": "charge",
      "amount": 20000,
      "paid_at": null,
      "fee": 963,
      "customer_id": "",
      "refunds": [],
      "payment_method": {
        "name": "Jorge Lopez",
        "exp_month": "12",
        "exp_year": "19",
        "auth_code": null,
        "object": "card_payment",
        "last4": "4242",
        "brand": "visa"
      },
      "details": {
        "name": null,
        "phone": null,
        "email": null,
        "line_items": []
      }
    },
    "previous_attributes": {}
  },
  "livemode": false,
  "webhook_status": "pending",
  "id": "5511d4ce2412294cf6000084",
  "object": "event",
  "type": "charge.created",
  "created_at": 1427231950,
  "webhook_logs": [
    {
      "id": "webhl_nPzGMBeQmMUu7aQ",
      "url": "http://requestb.in/1em0jsx1",
      "failed_attempts": 0,
      "last_http_response_status": -1,
      "object": "webhook_log",
      "last_attempted_at": 0
    }
  ]
}

Cargo pagado con tarjeta

Regresar a la lista de ejemplos

{
  "data": {
    "object": {
      "id": "5511d4ce2412294cf6000081",
      "livemode": false,
      "created_at": 1427231950,
      "status": "paid",
      "currency": "MXN",
      "description": "Stogies",
      "reference_id": "9839-wolf_pack",
      "failure_code": null,
      "failure_message": null,
      "monthly_installments": null,
      "object": "charge",
      "amount": 20000,
      "paid_at": 1427231952,
      "fee": 963,
      "customer_id": "",
      "refunds": [],
      "payment_method": {
        "name": "Jorge Lopez",
        "exp_month": "12",
        "exp_year": "19",
        "auth_code": "000000",
        "object": "card_payment",
        "last4": "4242",
        "brand": "visa"
      },
      "details": {
        "name": null,
        "phone": null,
        "email": null,
        "line_items": []
      }
    },
    "previous_attributes": {
      "payment_method": {}
    }
  },
  "livemode": false,
  "webhook_status": "pending",
  "id": "5511d4d02412294cf6000088",
  "object": "event",
  "type": "charge.paid",
  "created_at": 1427231952,
  "webhook_logs": [
    {
      "id": "webhl_m5kgkhmgETe6Y4s",
      "url": "http://requestb.in/1em0jsx1",
      "failed_attempts": 0,
      "last_http_response_status": -1,
      "object": "webhook_log",
      "last_attempted_at": 0
    }
  ]
}

Cargo de OXXO creado

Regresar a la lista de ejemplos

{
  "data": {
    "object": {
      "id": "5514803f241229981e0022e6",
      "livemode": false,
      "created_at": 1427406911,
      "status": "pending_payment",
      "currency": "MXN",
      "description": "Stogies",
      "reference_id": "9839-wolf_pack",
      "failure_code": null,
      "failure_message": null,
      "monthly_installments": null,
      "object": "charge",
      "amount": 20000,
      "paid_at": null,
      "fee": 812,
      "customer_id": "",
      "refunds": [],
      "payment_method": {
        "barcode": "38100000000042290121213001160013",
        "barcode_url": "http://s3.amazonaws.com/cash_payment_barcodes/38100000000042290121213001160013.png",
        "object": "cash_payment",
        "type": "oxxo",
        "expires_at": 1430006400,
        "store_name": "OXXO"
      },
      "details": {
        "name": "Wolverine",
        "phone": "403-342-0642",
        "email": "logan@x-men.org",
        "line_items": []
      }
    },
    "previous_attributes": {}
  },
  "livemode": false,
  "webhook_status": "pending",
  "id": "5514803f241229981e0022e9",
  "object": "event",
  "type": "charge.created",
  "created_at": 1427406911,
  "webhook_logs": [
    {
      "id": "webhl_PBmYvkfdNDYKezJ",
      "url": "http://requestb.in/u3n4ywu3",
      "failed_attempts": 0,
      "last_http_response_status": -1,
      "object": "webhook_log",
      "last_attempted_at": 0
    }
  ]
}

Cargo de OXXO pagado

Regresar a la lista de ejemplos

{
  "data": {
    "object": {
      "id": "5514803f241229981e0022e6",
      "livemode": false,
      "created_at": 1427406911,
      "status": "paid",
      "currency": "MXN",
      "description": "Stogies",
      "reference_id": "9839-wolf_pack",
      "failure_code": null,
      "failure_message": null,
      "monthly_installments": null,
      "object": "charge",
      "amount": 20000,
      "paid_at": 1427406913,
      "fee": 812,
      "customer_id": "",
      "refunds": [],
      "payment_method": {
        "barcode": "38100000000042290121213001160013",
        "barcode_url": "http://s3.amazonaws.com/cash_payment_barcodes/38100000000042290121213001160013.png",
        "object": "cash_payment",
        "type": "oxxo",
        "expires_at": 1430006400,
        "store_name": "OXXO"
      },
      "details": {
        "name": "Wolverine",
        "phone": "403-342-0642",
        "email": "logan@x-men.org",
        "line_items": []
      }
    },
    "previous_attributes": {
      "status": "pending_payment"
    }
  },
  "livemode": false,
  "webhook_status": "pending",
  "id": "55148042241229d4fb00b58a",
  "object": "event",
  "type": "charge.paid",
  "created_at": 1427406914,
  "webhook_logs": [
    {
      "id": "webhl_yYes9gx41vAj6ag",
      "url": "http://requestb.in/151xj4r1",
      "failed_attempts": 0,
      "last_http_response_status": -1,
      "object": "webhook_log",
      "last_attempted_at": 1427406984
    }
  ]
}

Cargo de SPEI creado

Regresar a la lista de ejemplos

{
  "data": {
    "object": {
      "id": "551499322412292eec002159",
      "livemode": false,
      "created_at": 1427413298,
      "status": "pending_payment",
      "currency": "MXN",
      "description": "Stogies",
      "reference_id": "9839-wolf_pack",
      "failure_code": null,
      "failure_message": null,
      "monthly_installments": null,
      "object": "charge",
      "amount": 20000,
      "paid_at": null,
      "fee": 928,
      "customer_id": "",
      "refunds": [],
    "payment_method": {
      "clabe": "646180111800012432",
      "bank": "STP",
      "issuing_account_holder": null,
      "issuing_account_tax_id": null,
      "issuing_account_bank": null,
      "issuing_account_number": null,
      "receiving_account_holder": null,
      "receiving_account_tax_id": null,
      "receiving_account_number": "646180111800012432",
      "receiving_account_bank": "STP",
      "reference_number": null,
      "description": null,
      "tracking_code": null,
      "executed_at": null,
      "object": "bank_transfer_payment",
      "type": "spei",
      "expires_at": 1435189298
    },
    "details": {
      "name": "Wolverine",
      "phone": "403-342-0642",
      "email": "logan@x-men.org",
      "line_items": []
    }
  },
  "previous_attributes": {}
  },
  "livemode": false,
  "webhook_status": "pending",
  "id": "551499322412292eec00215c",
  "object": "event",
  "type": "charge.created",
  "created_at": 1427413298,
  "webhook_logs": [
    {
      "id": "webhl_ENPXoFkKWyDqTAt",
      "url": "http://requestb.in/151xj4r1",
      "failed_attempts": 0,
      "last_http_response_status": -1,
      "object": "webhook_log",
      "last_attempted_at": 1427413285
    }
  ]
}

Cargo de SPEI pagado

Regresar a la lista de ejemplos

{
  "data": {
    "object": {
      "id": "551499322412292eec002159",
      "livemode": false,
      "created_at": 1427413298,
      "status": "paid",
      "currency": "MXN",
      "description": "Stogies",
      "reference_id": "9839-wolf_pack",
      "failure_code": null,
      "failure_message": null,
      "monthly_installments": null,
      "object": "charge",
      "amount": 20000,
      "paid_at": 1427413301,
      "fee": 928,
      "customer_id": "",
      "refunds": [],
      "payment_method": {
        "clabe": "646180111800012432",
        "bank": "STP",
        "issuing_account_holder": null,
        "issuing_account_tax_id": null,
        "issuing_account_bank": null,
        "issuing_account_number": null,
        "receiving_account_holder": null,
        "receiving_account_tax_id": null,
        "receiving_account_number": "646180111800012432",
        "receiving_account_bank": "STP",
        "reference_number": null,
        "description": null,
        "tracking_code": null,
        "executed_at": null,
        "object": "bank_transfer_payment",
        "type": "spei",
        "expires_at": 1435189298
      },
      "details": {
        "name": "Wolverine",
        "phone": "403-342-0642",
        "email": "logan@x-men.org",
        "line_items": []
      }
    },
    "previous_attributes": {
      "status": "pending_payment"
    }
  },
  "livemode": false,
  "webhook_status": "pending",
  "id": "551499352412299fd600b5ce",
  "object": "event",
  "type": "charge.paid",
  "created_at": 1427413301,
  "webhook_logs": [
    {
      "id": "webhl_zNFL9UGDd4dY9Hb",
      "url": "http://requestb.in/151xj4r1",
      "failed_attempts": 0,
      "last_http_response_status": -1,
      "object": "webhook_log",
      "last_attempted_at": 1427413289
    }
  ]
}

Plan creado

Regresar a la lista de ejemplos

{
    "data": {
        "object": {
            "id": "mutant_course",
            "livemode": false,
            "created_at": 1428338382,
            "name": "six month of x-men school",
            "amount": 10000,
            "currency": "MXN",
            "interval": "month",
            "frequency": 1,
            "expiry_count": 6,
            "trial_period_days": 15,
            "object": "plan"
        },
        "previous_attributes": {}
    },
    "livemode": false,
    "webhook_status": "pending",
    "id": "5522b6ce19ce8800d9000003",
    "object": "event",
    "type": "plan.create",
    "created_at": 1428338382,
    "webhook_logs": [
        {
            "id": "webhl_zYZxstg2XH9oStU",
            "url": "http://requestb.in/1467d141",
            "failed_attempts": 0,
            "last_http_response_status": -1,
            "object": "webhook_log",
            "last_attempted_at": 0
        }
    ]
}

Customer creadosin tarjeta y sin plan

Regresar a la lista de ejemplos

{
    "data": {
        "object": {
            "id": "cus_rRk8xpuSHW4AUEsm3",
            "email": "Charles Xacier@x-men.org",
            "name": "Charles Xavier",
            "phone": "55-5555-5555",
            "livemode": false,
            "default_card_id": null,
            "object": "customer",
            "created_at": 1428337640,
            "cards": [],
            "subscription": null
        }
    },
    "livemode": false,
    "webhook_status": "pending",
    "id": "5522b3e8241229f132002baa",
    "object": "event",
    "type": "customer.created",
    "created_at": 1428337640,
    "webhook_logs": [
        {
            "id": "webhl_SvY3zpiSVw1cpMh",
            "url": "http://requestb.in/1467d141",
            "failed_attempts": 0,
            "last_http_response_status": -1,
            "object": "webhook_log",
            "last_attempted_at": 0
        }
    ]
}

Customer creado con una tarjeta y sin plan

Regresar a la lista de ejemplos

{
    "data": {
        "object": {
            "id": "cus_n1ZcDf7BWB5Hj89cd",
            "email": "Charles Xacier@x-men.org",
            "name": "Charles Xavier",
            "phone": "55-5555-5555",
            "livemode": false,
            "default_card_id": "card_kkY5nFnto37FNN5D",
            "object": "customer",
            "created_at": 1428336972,
            "cards": [
                {
                    "id": "card_kkY5nFnto37FNN5D",
                    "created_at": 1428336972,
                    "active": true,
                    "last4": "4242",
                    "object": "card",
                    "exp_month": "12",
                    "exp_year": "19",
                    "brand": "VISA",
                    "name": "Jorge Lopez",
                    "customer_id": "cus_n1ZcDf7BWB5Hj89cd"
                }
            ],
            "subscription": null
        }
    },
    "livemode": false,
    "webhook_status": "pending",
    "id": "5522b14c241229168e002a87",
    "object": "event",
    "type": "customer.created",
    "created_at": 1428336972,
    "webhook_logs": [
        {
            "id": "webhl_dqynaXPCTzG6u3o",
            "url": "http://requestb.in/1467d141",
            "failed_attempts": 0,
            "last_http_response_status": -1,
            "object": "webhook_log",
            "last_attempted_at": 0
        }
    ]
}

Customer creado con tarjeta y con plan (suscripción)

Regresar a la lista de ejemplos

{
    "data": {
        "object": {
            "id": "cus_yyDRajnSHe61Ebd7b",
            "email": "Charles Xacier@x-men.org",
            "name": "Charles Xavier",
            "phone": "55-5555-5555",
            "livemode": false,
            "default_card_id": "card_2s1BpzjePT2nxipt",
            "object": "customer",
            "created_at": 1428338839,
            "cards": [
                {
                    "id": "card_2s1BpzjePT2nxipt",
                    "created_at": 1428338839,
                    "active": true,
                    "last4": "4242",
                    "object": "card",
                    "exp_month": "12",
                    "exp_year": "19",
                    "brand": "VISA",
                    "name": "Jorge Lopez",
                    "customer_id": "cus_yyDRajnSHe61Ebd7b"
                }
            ],
            "subscription": {
                "id": "sub_7hcSiRWUpukffri8W",
                "status": "in_trial",
                "object": "subscription",
                "created_at": 1428338839,
                "trial_end": 1429634839,
                "plan_id": "mutant_course",
                "customer_id": "cus_yyDRajnSHe61Ebd7b",
                "card_id": "card_2s1BpzjePT2nxipt"
            }
        }
    },
    "livemode": false,
    "webhook_status": "pending",
    "id": "5522b897241229e16c000019",
    "object": "event",
    "type": "customer.created",
    "created_at": 1428338839,
    "webhook_logs": [
        {
            "id": "webhl_YWuBR2yATA47mX6",
            "url": "http://requestb.in/1467d141",
            "failed_attempts": 0,
            "last_http_response_status": -1,
            "object": "webhook_log",
            "last_attempted_at": 0
        }
    ]
}

Suscripción creada

Regresar a la lista de ejemplos

{
    "data": {
        "object": {
            "id": "sub_7hcSiRWUpukffri8W",
            "status": "in_trial",
            "object": "subscription",
            "created_at": 1428338839,
            "trial_end": 1429634839,
            "plan_id": "mutant_course",
            "customer_id": "cus_yyDRajnSHe61Ebd7b",
            "card_id": "card_2s1BpzjePT2nxipt"
        },
        "previous_attributes": {}
    },
    "livemode": false,
    "webhook_status": "pending",
    "id": "5522b897241229e16c000018",
    "object": "event",
    "type": "subscription.created",
    "created_at": 1428338839,
    "webhook_logs": [
        {
            "id": "webhl_wZrZRyWvpMtMbGp",
            "url": "http://requestb.in/1467d141",
            "failed_attempts": 0,
            "last_http_response_status": -1,
            "object": "webhook_log",
            "last_attempted_at": 0
        }
    ]
}

Suscripción pagada

Regresar a la lista de ejemplos

{
    "data": {
        "object": {
            "id": "5522c1e919ce883fbf00002a",
            "livemode": false,
            "created_at": 1428341225,
            "status": "paid",
            "currency": "MXN",
            "description": "a few weeks of x-men school",
            "reference_id": null,
            "failure_code": null,
            "failure_message": null,
            "monthly_installments": null,
            "object": "charge",
            "amount": 10000,
            "paid_at": 1428341230,
            "fee": 626,
            "customer_id": "cus_9m3aK5RU9mW8Syo26",
            "refunds": [],
            "payment_method": {
                "name": "Jorge Lopez",
                "exp_month": "12",
                "exp_year": "19",
                "auth_code": "000000",
                "object": "card_payment",
                "last4": "4242",
                "brand": "visa"
            },
            "details": {
                "name": "Charles Xavier",
                "phone": "55-5555-5555",
                "email": "Charles Xacier@x-men.org",
                "line_items": []
            }
        },
        "previous_attributes": {
            "payment_method": {}
        }
    },
    "livemode": false,
    "webhook_status": "pending",
    "id": "5522c1ee19ce883fbf000030",
    "object": "event",
    "type": "subscription.paid",
    "created_at": 1428341230,
    "webhook_logs": [
        {
            "id": "webhl_xtwgFC2EhrSTNKQ",
            "url": "http://requestb.in/1467d141",
            "failed_attempts": 0,
            "last_http_response_status": -1,
            "object": "webhook_log",
            "last_attempted_at": 0
        }
    ]
}

Suscripción activa

Regresar a la lista de ejemplos

{
    "data": {
        "object": {
            "id": "sub_PinCKLnjRuHuyVBEC",
            "status": "active",
            "object": "subscription",
            "created_at": 1428341221,
            "billing_cycle_start": 1428341230,
            "billing_cycle_end": 1428946035,
            "plan_id": "mutant_course_min",
            "customer_id": "cus_9m3aK5RU9mW8Syo26",
            "card_id": "card_H6TiyZTLF6Wxiyo6"
        },
        "previous_attributes": {}
    },
    "livemode": false,
    "webhook_status": "pending",
    "id": "5522c1f319ce883fbf000033",
    "object": "event",
    "type": "subscription.paid",
    "created_at": 1428341235,
    "webhook_logs": [
        {
            "id": "webhl_Ue4E8BdereQJyrp",
            "url": "http://requestb.in/1467d141",
            "failed_attempts": 0,
            "last_http_response_status": -1,
            "object": "webhook_log",
            "last_attempted_at": 0
        }
    ]
}

Suscripción cancelada

Regresar a la lista de ejemplos

                
{
		"data": {
			"object": {
				"id": "sub_2fp9z5FxYbJr2zRrG",
				"status": "canceled",
				"object": "subscription",
				"created_at": 1484000093,
				"subscription_start": 0,
				"canceled_at": 1484000229,
				"paused_at": null,
				"billing_cycle_start": null,
				"billing_cycle_end": null,
				"trial_start": null,
				"trial_end": null,
				"plan_id": "gold-plan",
				"customer_id": "cus_2fp9z4X92PkCQimMj",
				"card_id": "src_2fp9z5FxYbJr2zRrC"
			},
			"previous_attributes": {}
		},
		"livemode": false,
		"webhook_status": "pending",
		"webhook_logs": [
			{
				"id": "webhl_2fpA1oidproQcrnrA",
				"url": "www.example.com",
				"failed_attempts": 0,
				"last_http_response_status": -1,
				"object": "webhook_log",
				"last_attempted_at": 0
			},
			{
				"id": "webhl_2fpA1oidproQcrnrB",
				"url": "http://www.example1.com",
				"failed_attempts": 0,
				"last_http_response_status": -1,
				"object": "webhook_log",
				"last_attempted_at": 0
			},
			{
				"id": "webhl_2fpA1oidproQcrnrC",
				"url": "https://requestb.in/1e7nsqn1",
				"failed_attempts": 0,
				"last_http_response_status": -1,
				"object": "webhook_log",
				"last_attempted_at": 0
			}
		],
		"id": "58740be5dba34d123c027a70",
		"object": "event",
		"type": "subscription.canceled",
		"created_at": 1484000229
	}
                
              

Contracargo creado

Regresar a la lista de ejemplos

{
    "data": {
        "object": {
            "id": "chbk_iobELtnpKWkisC69",
            "status": "action_required",
            "reason": "general",
            "note": "",
            "followup_status": "customer_unreachable",
            "response_from_client": "",
            "object": "chargeback",
            "charge_id": "54f776db2412293584333a5c",
            "created_at": 1427318899,
            "evidence_due_by": 1427923666,
            "files": [
            ]
        },
        "previous_attributes": {
            "status": null,
            "created_at": 0,
            "evidence_due_by": 0
        }
    },
    "livemode": false,
    "webhook_status": "pending",
    "id": "5522c1f319ce883fbf000033",
    "object": "event",
    "type": "charge.chargeback.created",
    "created_at": 1428341235,
    "webhook_logs": [
        {
            "id": "webhl_Ue4E8BdereQJyrp",
            "url": "http://requestb.in/1467d141",
            "failed_attempts": 0,
            "last_http_response_status": -1,
            "object": "webhook_log",
            "last_attempted_at": 0
        }
    ]
}

Contracargo ganado

Regresar a la lista de ejemplos

{
    "data": {
        "object": {
            "id": "chbk_iobELtnpKWkisC69",
            "status": "lost",
            "reason": "general",
            "note": "El envío se realizó a nombre de Darth Vader en la estrella de la muerte de una galaxia muy lejana. Teléfono: 001 001 0001",
            "followup_status": "customer_unreachable",
            "response_from_client": "",
            "object": "chargeback",
            "charge_id": "54f776db2412293584333a5c",
            "created_at": 1427318899,
            "evidence_due_by": 1427923666,
            "files": [
                {
                    "id": "chbkf_4Jivno3aTg77Xz3",
                    "file_name": "evidence_file1.pdf",
                    "url": null,
                    "created_at": 1427318688
                },
                {
                    "id": "chbkf_f3bH9AYKmhYghd8",
                    "file_name": "evidence_file2.jpg",
                    "url": null,
                    "created_at": 1427488727
                },
                {
                    "id": "chbkf_hRhiPuoAnkDbCCp",
                    "file_name": "evidence_file3.jpg",
                    "url": null,
                    "created_at": 1427488777
                }
            ]
        },
        "previous_attributes": {
            "status": null,
            "created_at": 0,
            "evidence_due_by": 0
        }
    },
    "livemode": false,
    "webhook_status": "pending",
    "id": "5522c1f319ce883fbf000033",
    "object": "event",
    "type": "charge.chargeback.won",
    "created_at": 1428341235,
    "webhook_logs": [
        {
            "id": "webhl_Ue4E8BdereQJyrp",
            "url": "http://requestb.in/1467d141",
            "failed_attempts": 0,
            "last_http_response_status": -1,
            "object": "webhook_log",
            "last_attempted_at": 0
        }
    ]
}

Contracargo perdido

Regresar a la lista de ejemplos

{
    "data": {
        "object": {
            "id": "chbk_iobELtnpKWkisC69",
            "status": "lost",
            "reason": "general",
            "note": "El envío se realizó a nombre de Darth Vader en la estrella de la muerte de una galaxia muy lejana. Teléfono: 001 001 0001",
            "followup_status": "customer_unreachable",
            "response_from_client": "",
            "object": "chargeback",
            "charge_id": "54f776db2412293584333a5c",
            "created_at": 1427318899,
            "evidence_due_by": 1427923666,
            "files": [
                {
                    "id": "chbkf_4Jivno3aTg77Xz3",
                    "file_name": "evidence_file1.pdf",
                    "url": null,
                    "created_at": 1427318688
                },
                {
                    "id": "chbkf_f3bH9AYKmhYghd8",
                    "file_name": "evidence_file2.jpg",
                    "url": null,
                    "created_at": 1427488727
                },
                {
                    "id": "chbkf_hRhiPuoAnkDbCCp",
                    "file_name": "evidence_file3.jpg",
                    "url": null,
                    "created_at": 1427488777
                }
            ]
        },
        "previous_attributes": {
            "status": null,
            "created_at": 0,
            "evidence_due_by": 0
        }
    },
    "livemode": false,
    "webhook_status": "pending",
    "id": "5522c1f319ce883fbf000033",
    "object": "event",
    "type": "charge.chargeback.lost",
    "created_at": 1428341235,
    "webhook_logs": [
        {
            "id": "webhl_Ue4E8BdereQJyrp",
            "url": "http://requestb.in/1467d141",
            "failed_attempts": 0,
            "last_http_response_status": -1,
            "object": "webhook_log",
            "last_attempted_at": 0
        }
    ]
}