02 Detalle de la venta

You can obtain a charge in particular based on the charge_id or the order_id

By charge_id


Route

GET /api/1/charges/:id

Headers

Authorization: Bearer SECRET_KEY

Request sample

curl "https://api.pagantis.com/api/1/charges/cha_f7e6ad709ae634a158479f99a3368cde" -X GET \
  -H "Authorization: Bearer 0967e3b9f1f7436dd7b16c6c46986b253328fc627f5254dc1f55b96614801804"

By order_id

As the order_id is not a unique field, the api can return multiple results when querying by order_id.

Route

GET /api/1/charges?order_id=$ORDER_ID

Headers

Authorization: Bearer SECRET_KEY

Request sample

curl "https://api.pagantis.com/api/1/charges?order_id=66" -X GET \
-H "Authorization: Bearer 0967e3b9f1f7436dd7b16c6c46986b253328fc627f5254dc1f55b96614801804"

Response

Status
        200 OK
        Content type: application/json; charset=utf-8
Single result response sample
{
   "response":{
      "id":"cha_52ed747cb580bb6357d032bc75e48738",
      "amount":5988,
      "error_code":"undefined_error",
      "error_message":"\nERROR. El comercio tiene un filtro que no permite esta operacin.[Bines por pases]\n",
      "order_id":"66",
      "description":"Printed Dress (1),Gasto de envío",
      "paid":false,
      "created_at":"2016-05-05T15:51:09.000+02:00",
      "status":"error",
      "commission":599,
      "amount_to_settle":5389,
      "discount":0,
      "metadata":{
         "phone":"667676767",
         "address":"diagonal 579 ",
         "city":"barcelona",
         "province":"barcelona",
         "user_email":"welcome@pagamastarde.com"
      },
      "closed_at":"2016-05-05T15:51:11.000+02:00",
      "payment_date":null,
      "card":{
         "id":"car_9b6d3b79c977a665782e4e9d07ab8079",
         "bin":"444433",
         "brand":null,
         "type":null,
         "category":null,
         "country_code":null,
         "last4":"1111",
         "expiration_year":2016,
         "expiration_month":12
      },
      "refunds":[

      ]
   }
}
Multiple results response sample
{
   "response":[
      {
         "id":"cha_52ed747cb580bb6357d032bc75e48738",
         "amount":5988,
         "error_code":"undefined_error",
         "error_message":"\nERROR. El comercio tiene un filtro que no permite esta operacin.[Bines por pases]\n",
         "order_id":"66",
         "description":"Printed Dress (1),Gasto de envío",
         "paid":false,
         "created_at":"2016-05-05T15:51:09.000+02:00",
         "status":"error",
         "commission":599,
         "amount_to_settle":5389,
         "discount":0,
         "metadata":{
            "phone":"667676767",
            "address":"diagonal 579 ",
            "city":"barcelona",
            "province":"barcelona",
            "user_email":"soporte@digitalorigin.com"
         },
         "closed_at":"2016-05-05T15:51:11.000+02:00",
         "payment_date":null,
         "card":{
            "id":"car_9b6d3b79c977a665782e4e9d07ab8079",
            "bin":"444433",
            "brand":null,
            "type":null,
            "category":null,
            "country_code":null,
            "last4":"1111",
            "expiration_year":2016,
            "expiration_month":12
         },
         "refunds":[

         ]
      },
      {
         "id":"cha_dd10be5f680c7744037024a00083ff15",
         "amount":5988,
         "error_code":"undefined_error",
         "error_message":"\nERROR. El comercio tiene un filtro que no permite esta operacin.[Bines por pases]\n",
         "order_id":"66",
         "description":"Printed Dress (1),Gasto de envío",
         "paid":false,
         "created_at":"2016-05-05T15:50:58.000+02:00",
         "status":"error",
         "commission":599,
         "amount_to_settle":5389,
         "discount":0,
         "metadata":{
            "phone":"667676767",
            "address":"diagonal 579 ",
            "city":"barcelona",
            "province":"barcelona",
            "user_email":"soporte@digitalorigin.com"
         },
         "closed_at":"2016-05-05T15:51:01.000+02:00",
         "payment_date":null,
         "card":{
            "id":"car_9b6d3b79c977a665782e4e9d07ab8079",
            "bin":"444433",
            "brand":null,
            "type":null,
            "category":null,
            "country_code":null,
            "last4":"1111",
            "expiration_year":2016,
            "expiration_month":12
         },
         "refunds":[

         ]
      },
      {
         "id":"cha_0c9dd47dab1ad6aa39cbc6623f29fa26",
         "amount":5988,
         "error_code":null,
         "error_message":null,
         "order_id":"66",
         "description":"Printed Dress (1),Gasto de envío",
         "paid":true,
         "created_at":"2016-05-05T15:49:39.000+02:00",
         "status":"paid",
         "commission":599,
         "amount_to_settle":5389,
         "discount":0,
         "metadata":{
            "phone":"667676767",
            "address":"diagonal 579 ",
            "city":"barcelona",
            "province":"barcelona",
            "user_email":"soporte@digitalorigin.com"
         },
         "closed_at":"2016-05-05T15:49:42.000+02:00",
         "payment_date":"2016-05-05",
         "card":{
            "id":"car_b652bd6fc9403e777190453f3e057c84",
            "bin":"554050",
            "brand":"MASTERCARD",
            "type":"debit",
            "category":"CLASICA",
            "country_code":"ES",
            "last4":"0004",
            "expiration_year":2016,
            "expiration_month":12
         },
         "refunds":[

         ]
      },
      {
         "id":"cha_9977b4ee5a2f3f5c0936a84516150afa",
         "amount":5988,
         "error_code":null,
         "error_message":null,
         "order_id":"66",
         "description":"Printed Dress (1),Gasto de envío",
         "paid":true,
         "created_at":"2016-05-05T13:59:40.000+02:00",
         "status":"paid",
         "commission":599,
         "amount_to_settle":5389,
         "discount":0,
         "metadata":{
            "phone":"667676767",
            "address":"diagonal 579 ",
            "city":"barcelona",
            "province":"barcelona",
            "user_email":"soporte@digitalorigin.com"
         },
         "closed_at":"2016-05-05T13:59:42.000+02:00",
         "payment_date":"2016-05-05",
         "card":{
            "id":"car_c90ae58ab13b48691fe9ae6271c4f332",
            "bin":"554050",
            "brand":"MASTERCARD",
            "type":"debit",
            "category":"CLASICA",
            "country_code":"ES",
            "last4":"0004",
            "expiration_year":2016,
            "expiration_month":12
         },
         "refunds":[

         ]
      },
      {
         "id":"cha_6cdc673521794a3f6a8354e8b966352e",
         "amount":5988,
         "error_code":null,
         "error_message":null,
         "order_id":"66",
         "description":"Printed Dress (1),Gasto de envío",
         "paid":true,
         "created_at":"2016-05-05T09:11:03.000+02:00",
         "status":"paid",
         "commission":599,
         "amount_to_settle":5389,
         "discount":0,
         "metadata":{
            "phone":"667676767",
            "address":"diagonal 579 ",
            "city":"barcelona",
            "province":"barcelona",
            "user_email":"soporte@digitalorigin.com"
         },
         "closed_at":"2016-05-05T09:11:05.000+02:00",
         "payment_date":"2016-05-05",
         "card":{
            "id":"car_0c526c0bfb590443b794da49ded2ebaf",
            "bin":"554050",
            "brand":"MASTERCARD",
            "type":"debit",
            "category":"CLASICA",
            "country_code":"ES",
            "last4":"0004",
            "expiration_year":2016,
            "expiration_month":12
         },
         "refunds":[

         ]
      }
   ],
   "count":5,
   "pagination":{
      "current":1,
      "previous":null,
      "next":null,
      "per_page":25,
      "pages":1,
      "count":5
   }
}