Crear un cargo

Para realizar un cobro en efectivo, crea un cargo usando al menos los campos requeridos. Cada cargo está identificado por un payment_id único, una vez creado puedes verificarlo por medio del endpoint /v1/charges/{payment_id}.

POST /v1/charges

Ejemplo

curl -H "Accept: application/compropago" \
-H "Content-type: application/json" \
-u 23976112561d20: \
-X POST \
-d '{
  "order_id": "SMGCURL1",
  "order_price": 75.0,
  "order_name": "SAMSUNG GOLD CURL",
  "image_url": "https://test.amazon.com/5f4373",
  "customer_name": "Alejandra Leyva",
  "customer_email": "noreply@compropago.com",
  "payment_type": "SEVEN_ELEVEN",
  "currency": "MXN"
}' https://api.compropago.com/v1/charges

Respuesta

{
  "id": "ch_fe92a1a5-abec-49e3-877c-5024c1464dc3",
  "type": "charge.pending",
  "object": "charge",
  "created_at": 1424024955774,
  "accepted_at": null,
  "expires_in": 1424024065774,
  "paid": false,
  "amount": 150.00,
  "livemode": true,
  "currency": "mxn",
  "refunded": false,
  "fee": 7.50,
  "fee_details": {
    "amount": 7.50,
    "currency": "mxn",
    "type": "compropago_fee",
    "application": null,
    "amount_refunded": 0,
    "tax": 0.94
  },
  "order_info": {
    "order_id": "SMGCURL1",
    "order_price": 150.00,
    "order_name": "SAMSUNG GOLD CURL",
    "payment_method": "cash",
    "store": "SEVEN_ELEVEN",
    "country": "MX",
    "image_url": null,
    "success_url": null,
    "failed_url": null,
    "exchange": {
      "rate": 1,
      "request": 1485224234,
      "origin_amount": "150.0",
      "final_amount": "150.0",                   
      "origin_currency": "MXN",
      "final_currency": "MXN",
      "exchange_id": null 
    }             
  },
  "customer": {
    "customer_name": "Alejandra Leyva",
    "customer_email": "noreply@compropago.com",
    "customer_phone": "2221515801"
  },
  "instructions":{
    "description": "Para que el pago sea valido debes pagar ...",
    "step_1": "Ir a la caja 7Eleven ...",
    "step_2": "Solicitar deposito ...",
    "step_3": "Deposite la cantidad ...",
    "note_extra_comition": "Las tiendas 7Eleven cobran en caja una comisión de 7 pe..",
    "note_expiration_date": "Orden válida antes de 01/10/2013",
    "note_confirmation": "Tu pago será confirmado a través de SMS y email",
    "details":{
      "payment_amount": "75.0",
      "payment_store": "SEVEN_ELEVEN",
      "amount": "75.0",
      "store": "SEVEN_ELEVEN",
      "bank_account_number": "xxxx xxxx xxxx xxxx",
      "company_reference_name": "ComproPago",
      "company_reference_number": "",
      "company_bank_number": "",
      "order_reference_number": "",
      "bank_account_holder_name": "ComproPago SAPI de CV",
      "bank_reference": "",
      "bank_name": "Banorte"
    }
  },
  "api_version": "1.1",
}
Campos requeridos
order_id string ID de la orden o servicio
order_price float Precio de la orden o servicio
order_name string Nombre de la orden o servicio
customer_name string Nombre del cliente
customer_email string Email del cliente
payment_type string
"SEVEN_ELEVEN" "EXTRA" "CIRCULO_K"
"ELEKTRA" "COPPEL" "WOOLWORTH"
"FARMACIA_BENAVIDES" "DEL_SOL"
"FARMACIA_ESQUIVAR"
"BANAMEX" "BANCOMER" "SANTANDER"
"BANORTE" "SCOTIABANK" "INBURSA"


Campos opcionales

image_url string Imagen del producto o servicio
currency string Cambio de divisa *default "MXN" "USD" "EUR" "GBP"