Skip to main content
GET
/
v1
/
checkout
/
search
{
  "sessions": [
    {
      "id": "cs_ci_123456789",
      "status": "created",
      "amount": 5000,
      "currency": "XOF",
      "user_phone": "+22507987654",
      "payment_id": "ORDER_123",
      "description": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "expires_at": "2023-11-07T05:31:56Z",
      "completed_at": "2023-11-07T05:31:56Z",
      "failure_reason": "<string>",
      "transaction_fee": 25
    }
  ],
  "total_count": 123,
  "has_more": true,
  "next_offset": 123
}

Search Checkout Sessions

This endpoint allows you to search for checkout sessions based on various criteria such as status, date range, and customer information.

Endpoint

  • Endpoint: GET /v1/checkout/search
  • Description: Search for checkout sessions using query parameters.
  • Query Parameters:
    • status (string, optional): Filter by checkout session status (e.g., “completed”, “pending”).
    • start_date (string, optional): The start date for the search range (ISO 8601 format).
    • end_date (string, optional): The end date for the search range (ISO 8601 format).
    • customer_id (string, optional): Filter by customer ID.
  • Response:
    {
      "data": [
        {
          "id": "cs_test_123",
          "amount": 1000,
          "currency": "usd",
          "status": "completed",
          "created_at": "2024-01-01T12:00:00Z",
          "customer_id": "cus_456"
        },
        {
          "id": "cs_test_124",
          "amount": 2000,
          "currency": "usd",
          "status": "pending",
          "created_at": "2024-01-02T15:30:00Z",
          "customer_id": "cus_789"
        }
      ],
      "total_count": 2
    }
    

Parameters

  • status (string, optional): Filter by checkout session status (e.g., “completed”, “pending”).
  • start_date (string, optional): The start date for the search range (ISO 8601 format).
  • end_date (string, optional): The end date for the search range (ISO 8601 format).
  • customer_id (string, optional): Filter by customer ID.

Example Request

curl -X GET "https://api.example.com/v1/checkout/search?status=completed&start_date=2024-01-01&end_date=2024-01-31" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "data": [
    {
      "id": "cs_test_123",
      "amount": 1000,
      "currency": "usd",
      "status": "completed",
      "created_at": "2024-01-01T12:00:00Z",
      "customer_id": "cus_456"
    },
    {
      "id": "cs_test_124",
      "amount": 2000,
      "currency": "usd",
      "status": "pending",
      "created_at": "2024-01-02T15:30:00Z",
      "customer_id": "cus_789"
    }
  ],
  "total_count": 2
}

Notes

  • You can combine multiple query parameters to refine your search results.
  • The response includes a list of checkout sessions that match the search criteria along with the total count.

Errors

  • 400 Bad Request: Invalid query parameters.
  • 401 Unauthorized: Invalid or missing API key.

See Also

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

reference
string
user_phone
string
amount_min
integer
amount_max
integer
limit
integer
default:50

Response

200 - application/json

Session founded

sessions
object[]
total_count
integer
has_more
boolean
next_offset
integer