Get a payment.
GET
/v1/payments/{reference}
const url = 'https://api.ridleypay.com/v1/payments/WOO-123';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.ridleypay.com/v1/payments/WOO-123 \ --header 'Authorization: Bearer <token>'Returns enriched payment data for a completed or failed payment, identified by its reference number.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”reference
required
string
The payment reference (same value sent as reference when creating the session).
Example
WOO-123Responses
Section titled “ Responses ”Payment found
Media typeapplication/json
object
data
object
id
string
type
string
attributes
object
reference
string
amount
string
currency
string
status
string
paid
boolean
provider
string
customer_email
string
card_last
string
card_brand
string
links
object
self
string
Example
{ "data": { "id": "1", "type": "payments", "attributes": { "reference": "WOO-123", "amount": "99.99", "currency": "JMD", "status": "PAID", "paid": true, "provider": "powertranz", "customer_email": "jane@example.com", "card_last": "4242", "card_brand": "visa" }, "links": { "self": "https://pay.example.com/api/v1/payments/WOO-123" } }}Payment not found
Media typeapplication/json
object
errors
Array<object>
object
status
string
title
string
detail
string
Example
{ "errors": [ { "status": "404", "title": "Not Found", "detail": "Payment not found." } ]}