List All Customers
Retrieve a paginated list of all customers in your account with optional filtering by date range and ordering.
API Credentials
Request Parametersโ
Additional - 2 fieldsPagination Parameters
Additional - 3 fieldsFiltering & Sorting
Responsesโ
200
Customer list retrieved successfullyList object containing customer objects and pagination information.
Response includes:
object- Object type (always "list")data- Array of customer objectslimit- Number of items per pageoffset- Number of items skippedtotal- Total number of customers matching filtersorder- Sort order appliedfrom- Start date filter appliedto- End date filter applied
400
Bad requestInvalid parameters provided.
Common causes:
- Invalid date format (must be ISO 8601)
- Invalid order value
- Limit exceeds maximum (100)
- Negative offset value
401
UnauthorizedAuthentication failed. Invalid or missing API key.
Common causes:
- Missing Authorization header
- Invalid secret key
- Using public key instead of secret key
- Incorrect HTTP Basic Auth format
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/customers?limit=20&offset=0&order=reverse_chronological \
-u skey_test_5xuy4w91xqz7d1w9u0t:
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
customers = Omise::Customer.list({
limit: 20,
offset: 0,
order: 'reverse_chronological'
})
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
customers = omise.Customer.list(
limit=20,
offset=0,
order='reverse_chronological'
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const customers = await omise.customers.list({
limit: 20,
offset: 0,
order: 'reverse_chronological'
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$customers = OmiseCustomer::retrieve([
'limit' => 20,
'offset' => 0,
'order' => 'reverse_chronological'
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
ScopedList<Customer> customers = client.customers().list()
.limit(20L)
.offset(0L)
.order(Ordering.ReverseChronological)
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var customers = await client.Customers.List(new ListRequest
{
Limit = 20,
Offset = 0,
Order = Ordering.ReverseChronological
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
customers, _ := client.Customers().List(&operations.ListCustomers{
List: operations.List{
Limit: 20,
Offset: 0,
Order: operations.ReverseChronological,
},
})
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
bad_request | Invalid parameters | Check date format and parameter values |
authentication_failure | Invalid API key | Verify your secret key is correct |
invalid_parameters | Invalid pagination parameters | Check limit and offset values |
List Response Fieldsโ
| Field | Description |
|---|---|
object | Object type (always "list") |
data | Array of customer objects |
limit | Number of items per page |
offset | Number of items skipped |
total | Total number of customers |
order | Sort order applied |
from | Start date filter |
to | End date filter |
Try it outโ
Additional - 5 fields