01 Listado de ventas

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


Parameters

Page

La API devuelve los resultados usando paginación. Devuelve un máximo de 25 ventas por petición. Después de la respuesta con los resultados, la api muestra la información de paginación. Usando el parámetro page podemos indicar a la API cuál es la página que queremos visualizar.

Sample request. Page 1
curl "https://api.pagantis.com/api/1/charges?page=1" -X GET \
-H "Authorization: Bearer 4ef2536e019d163d79e6c2af168310c4e264fbbc99ba2a0229577b2768b41e33"
      
API response
      {
         "response":[
            {
              charge 1 information...
            },
            {
              charge 2 information...
            },
            ...
            {
              charge 25 information...
            }
          ],
      "count":25,
      "pagination":{
      "current":1,
      "previous":null,
      "next":2,
      "per_page":25,
      "pages":9,
      "count":205
   }
    

La información de paginación se recibe después del Listado de ventas.

count: Contiene el numero de resultados que se muestran en la página actual.
current: El numero de la página que estamos visualizando.
previous: Numero de página anterior. null si no existe página anterior.
next: Numero de página siguiente. null si no existe página siguiente.
per_page: Numero de resultados mostrados por página.
pages: Numero total de páginas.
count: Numero total de resultados.

Sample request. Page 9
curl "https://api.pagantis.com/api/1/charges?page=9" -X GET \
-H "Authorization: Bearer 4ef2536e019d163d79e6c2af168310c4e264fbbc99ba2a0229577b2768b41e33"
  
API response
    {
       "response":[
          {
            charge 1 information...
          },
          {
            charge 2 information...
          },
          ...
          {
            charge 5 information...
          }
        ],
        "count":5,
        "pagination":{
           "current":9,
           "previous":8,
           "next":null,
           "per_page":25,
           "pages":9,
           "count":205
        }
 }
  


Examples

Request

cURL
curl "https://api.pagantis.com/api/1/charges?page=1" -X GET \
	-H "Authorization: Bearer 4ef2536e019d163d79e6c2af168310c4e264fbbc99ba2a0229577b2768b41e33"

Response

Status
        200 OK
        Content type: application/json; charset=utf-8
Body
{
  "response": [
    {
      "livemode": false,
      "paid": false,
      "amount": 9500,
      "currency": "EUR",
      "refunded": false,
      "captured": false,
      "authorization_code": "1234567890",
      "error_code": null,
      "error_message": null,
      "order_id": "ref0",
      "description": "Test charge",
      "custom": null,
      "amount_in_eur": 9500,
      "exchange_rate_eur": 1.0,
      "source": null,
      "ip": null,
      "locale": null,
      "fee": null,
      "interchange_fee": null,
      "user": null,
      "installment_type": null,
      "created_at": "2015-07-08T11:32:19.000Z",
      "refunds": [

      ],
      "id": "cha_216c0eb6d3738e3119b9597b0bb2dbfc",
      "customer": null,
      "subscription": null,
      "card": {
        "brand": "VISA",
        "card_type": "C",
        "last4": "1234",
        "expiration_year": 2015,
        "expiration_month": 12,
        "cvc_check": "1",
        "bin": 123456,
        "id": "car_39a440dc9922ad5aa8b8eefc7676515f",
        "tokenized": true
      },
      "activities": [

      ],
      "settlement": null
    },
    {
      "livemode": false,
      "paid": false,
      "amount": 7500,
      "currency": "EUR",
      "refunded": false,
      "captured": false,
      "authorization_code": "1234567890",
      "error_code": null,
      "error_message": null,
      "order_id": "ref1",
      "description": "Test charge",
      "custom": null,
      "amount_in_eur": 7500,
      "exchange_rate_eur": 1.0,
      "source": null,
      "ip": null,
      "locale": null,
      "fee": null,
      "interchange_fee": null,
      "user": null,
      "installment_type": null,
      "created_at": "2015-07-08T11:32:19.000Z",
      "refunds": [

      ],
      "id": "cha_2ef5d3403b6567619e8e236143cdf530",
      "customer": null,
      "subscription": null,
      "card": {
        "brand": "VISA",
        "card_type": "C",
        "last4": "1234",
        "expiration_year": 2015,
        "expiration_month": 12,
        "cvc_check": "1",
        "bin": 123456,
        "id": "car_66fefb767b7dd3f35d28af647b5c6659",
        "tokenized": true
      },
      "activities": [

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