GET /api/v1/payments
List all of your payments, ordered chronologically, most recent first.
Request
$ curl -X GET https://api.payhere.co/api/v1/payments?page=1&per_page=50 \
-H "Accept: application/json" \
-H "Authorization: Bearer ${api_key_here}"
require "http"
require "json"
resp = HTTP.auth("Bearer #{api_key_here}")
.get(
"https://api.payhere.co/api/v1/payments",
page: 1,
per_page: 50
)
parsed = JSON.parse(resp.body)
Params
- page - Page number
- per_page - Records per page, default 20, max 100.
Response
{
"data": [
{
"id": 845088515,
"hashid": "VRSgg9kvB",
"reference": "GW8264",
"formatted_amount": "£12.99",
"amount": 12.99,
"currency": "gbp",
"refund_amount": 2.99,
"amount_paid": 10.00,
"company_id": 636211471,
"card_brand": "visa",
"card_last4": null,
"secure_token": "Vt-ixl7oXL2OgVQagjUkdg",
"status": "part_refund",
"success": true,
"created_at": "2017-06-03T00:00:00.000Z",
"updated_at": "2017-06-03T00:00:00.000Z",
"type": "payments"
}
],
"meta": {
"current_page": 1,
"next_page": 2,
"prev_page": null,
"total_pages": 2,
"total_count": 2
}
}
Errors
- 400 Bad request
- 401 Unauthorized