Skip to main content

Fetch Payment Status

GET {BASE_URL}/payment/{payment_id}

Retrieves information about specific payment entity.

Parameters

n/a

Response

Returns a JSON object with the following properties:

  • id The unique identifier of the transaction
  • amount Payment amount object
    • amount Amount in cents
    • currency Currency code
  • receivedAmount Settled payment amount object
    • amount Amount in cents
    • currency Currency code
  • status Payment status
  • createdAt Payment created at timestamp

Example

Request:

fetch('https://sandbox-api.ninjapay.tech/api/v1/payment/fc26571a-1a36-411e-8458-95fb8c06f782', {
method: 'get',
headers: {
Authorization: 'Bearer MERCHANT_SECRET_KEY',
'Content-Type': 'application/json',
},
});

Response:

{
"id": "fc26571a-1a36-411e-8458-95fb8c06f782",
"amount": {
"amount": "100",
"currency": "EUR"
},
"receivedAmount": {
"amount": "100",
"currency": "EUR"
},
"status": "new",
"createdAt": "2024-05-01T00:00:00+00:00"
}

Errors

This API uses the following error codes:

  • 401 Unauthorized The API key provided was invalid or missing
  • 404 Not Found The requested resource was not found
  • 500 Internal Server Error An unexpected error occurred on the server