Overview

The Fetch Payment endpoint allows you to retrieve detailed information about a specific payment using its unique identifier. This is useful for checking payment status, verifying transaction details, or retrieving customer information associated with the payment.

Endpoint

GET /payments/{id}

Authentication

All requests must include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Path Parameters

id
string
required

The unique identifier of the payment to retrieve.

  • Format: UUID v4
  • Example: 2315fca8-9aec-42ee-8bee-a9d10add170e

Response Structure

data
object

The payment details object

Examples

curl -X GET "https://api.spendjuice.com/payments/2315fca8-9aec-42ee-8bee-a9d10add170e" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"

Response Examples

{
  "data": {
    "amount": 10000,
    "cancellation_reason": null,
    "correlation_id": "a3f53cea-e05a-11ee-8a6d-8a7019bc5d83",
    "currency": "NGN",
    "customer": {
      "billing_address": {
        "city": "Torphy",
        "country": "NG",
        "line1": "46259 Brekke Adella Rapids",
        "line2": "Suite 304",
        "state": "River",
        "zip_code": "53292"
      },
      "email": "greg_gleichner@hansen.net",
      "first_name": "Murray Inc",
      "id": "53380ca0-b29d-4dd4-8732-8fd518f4a394",
      "last_name": "",
      "phone_number": "+2348023321025"
    },
    "date": "2024-03-12T10:23:59.750724Z",
    "description": "Test",
    "id": "a3f53772-e05a-11ee-9444-8a7019bc5d83",
    "metadata": {
      "order": {
        "identifier": "Veniam quaerat dolor?",
        "items": [
          {
            "name": "Small Rubber Shoes",
            "type": "digital"
          }
        ]
      }
    },
    "mode": "test",
    "payment_method": {
      "account_name": "Carrie Romaguera Sr.",
      "account_number": "34521736",
      "account_type": "savings",
      "bank_name": "Conn Group",
      "id": "1e140102-3ddc-41d1-aaaf-b101cd195377",
      "type": "bank_account"
    },
    "reference": "Possimus rerum.",
    "status": "pending"
  }
}

Error Handling

Status CodeDescriptionPossible Solution
401Invalid or missing API keyCheck your API key and authorization header
403Permission deniedVerify your API key has correct permissions
404Payment not foundVerify the payment ID exists and is valid
429Rate limit exceededImplement exponential backoff
500Internal server errorContact support

Best Practices

Rate Limits

This endpoint is subject to rate limiting:

  • 100 requests per minute per API key
  • Rate limit info included in response headers:
    • X-RateLimit-Limit
    • X-RateLimit-Remaining
    • X-RateLimit-Reset

Need Help?

For additional assistance: