Overview

Retrieve detailed information about a specific customer using their unique identifier. This endpoint supports field selection, response versioning, and conditional fetching.

Base URL

GET /customers/{id}

Path Parameters

id
string
required

The unique identifier of the customer. Example: 6f7e1e7f-93d1-4fcc-b7a4-738f869615c8

Query Parameters

fields
string

Comma-separated list of fields to include in the response. Example: fields=first_name,email,phone_number

version
string

API version for backwards compatibility. Default: Latest version

include
string

Additional related resources to include. Example: include=transactions,payment_methods

Request Examples

curl -X GET "https://api.spendjuice.com/customers/6f7e1e7f-93d1-4fcc-b7a4-738f869615c8" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"

Response

{
    "data": {
        "id": "6f7e1e7f-93d1-4fcc-b7a4-738f869615c8",
        "first_name": "Test",
        "last_name": "Customer",
        "email": "test@custom.com",
        "phone_number": "+2348012345678",
        "billing_address": {
            "line1": "123 Test lane",
            "line2": "3456 Mike Drive",
            "city": "Anon",
            "state": "Acme",
            "zip_code": "12345",
            "country": "US"
        },
        "created_at": "2024-03-15T12:00:00Z",
        "updated_at": "2024-03-15T12:00:00Z"
    }
}

Rate Limiting

This endpoint has a rate limit of 1000 requests per hour per API key. Rate limit information is included in the response headers:

  • X-RateLimit-Limit: Total requests allowed per hour

  • X-RateLimit-Remaining: Remaining requests in the current period

  • X-RateLimit-Reset: Time when the rate limit resets (Unix timestamp)

Common Use Cases

Error Responses

Status CodeDescription
400Invalid request (malformed parameters)
401Authentication failed (invalid or missing API key)
403Permission denied
404Customer not found
429Rate limit exceeded
500Internal server error

Best Practices

  1. Always use HTTPS for API requests

  2. Implement proper error handling

  3. Cache responses when appropriate

  4. Monitor rate limits

  5. Use field selection to minimize response payload size

Need Help?

For additional assistance: