04 Cargar a token

Route
POST /api/1/charges
Headers
Authorization: Bearer SECRET_KEY


Examples

Request

cURL
curl "https://api.pagantis.com/api/1/charges" -d 'charge[amount]=592&charge[currency]=EUR&charge[card_id]=car_9f30c3f29f640dabce435ba19d1f021f&charge[description]=test+token&charge[order_id]=test+token+order' -X POST \
	-H "Authorization: Bearer 4ad2ee8fbb0e9878ee6470f9127ba4b987eaddc69ce55bee2de1b8952e622ca9" \
	-H "Content-Type: application/x-www-form-urlencoded"
Request body
        charge[amount]=592
        charge[currency]=EUR
        charge[card_id]=car_9f30c3f29f640dabce435ba19d1f021f
        charge[description]=test+token
        charge[order_id]=test+token+order
      

Request parameters
charge[amount]: Precio en céntimos a cobrar.
charge[currency]: Opcional. ISO de la Moneda.
charge[card_id]: Card ID a cobrar. Se obtiene con el detalle de una venta.
charge[description]: Opcional. Descripción de la venta. Aparece en el backoffice y permite identificar la transacción.
charge[order_id]: Opcional. Order_id asociado a la venta.

Response

Status
        200 OK
        Content type: application/json; charset=utf-8
Body
{
   "response":{
      "id":"cha_1804178a485d2479e410800b35efab80",
      "amount":592,
      "error_code":null,
      "error_message":null,
      "order_id":null,
      "description":null,
      "paid":true,
      "created_at":"2016-05-11T11:58:18.864+02:00",
      "status":"paid",
      "commission":59,
      "amount_to_settle":533,
      "discount":0,
      "metadata":{

      },
      "closed_at":"2016-05-11T11:58:21.000+02:00",
      "payment_date":"2016-05-11",
      "card":{
         "id":"car_5bc96e8ee165c91128aca408cdaed33e",
         "bin":"554050",
         "brand":"MASTERCARD",
         "type":"debit",
         "category":"CLASICA",
         "country_code":"ES",
         "last4":"0004",
         "expiration_year":2016,
         "expiration_month":12
      },
      "refunds":[

      ]
   }
}