This API allows you to create and manage customers for your account. Customers are the entities that will make cryptocurrency payments for your products and services.
The customer object
Unique identifier with cust_ prefix (e.g., cust_abc123def456).
The customer’s email address. Automatically converted to lowercase.
The customer’s first name.
The customer’s last name.
When the customer was created (ISO 8601).
When the customer was last updated (ISO 8601).
List customers
Retrieves a paginated list of all customers in your account.
Page number for pagination. Results are returned 25 items per page.
curl https://api.gettrxn.com/v1/customers \
-H "Authorization: Bearer $TRXN_TOKEN"
{
"customers": [
{
"id": "cust_abc123def456",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-01T12:00:00Z"
},
{
"id": "cust_xyz789ghi012",
"email": "[email protected]",
"first_name": "Jane",
"last_name": "Smith",
"created_at": "2024-01-02T10:30:00Z",
"updated_at": "2024-01-02T10:30:00Z"
}
],
"pagination": {
"page": 1,
"pages": 3,
"count": 67
}
}
Get customer
Retrieves a specific customer by ID.
The customer’s ID (e.g., cust_abc123def456).
curl https://api.gettrxn.com/v1/customers/cust_abc123def456 \
-H "Authorization: Bearer $TRXN_TOKEN"
{
"id": "cust_abc123def456",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-01T12:00:00Z"
}
Create customer
Creates a new customer in your account. A cryptocurrency wallet is automatically created for the customer.
The customer’s email address. Must be a valid email format. Automatically converted to lowercase. Must be unique within your account.
The customer’s first name.
The customer’s last name.
curl -X POST https://api.gettrxn.com/v1/customers \
-H "Authorization: Bearer $TRXN_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"first_name": "New",
"last_name": "Customer"
}'
{
"id": "cust_new123customer456",
"email": "[email protected]",
"first_name": "New",
"last_name": "Customer",
"created_at": "2024-01-15T14:30:00Z",
"updated_at": "2024-01-15T14:30:00Z"
}
Validation errors
{
"errors": {
"email": ["can't be blank"]
}
}
{
"errors": {
"email": ["is invalid"]
}
}
{
"errors": {
"email": ["has already been taken"]
}
}
Update customer
Updates an existing customer.
The customer’s ID (e.g., cust_abc123def456).
The customer’s email address. Must be a valid email format.
The customer’s first name.
The customer’s last name.
curl -X PATCH https://api.gettrxn.com/v1/customers/cust_abc123def456 \
-H "Authorization: Bearer $TRXN_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"first_name": "Updated"
}'
{
"id": "cust_abc123def456",
"email": "[email protected]",
"first_name": "Updated",
"last_name": "Doe",
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-15T16:45:00Z"
}
Delete customer
Deletes a customer from your account.
This action is irreversible and will also delete the customer’s associated wallet and crypto addresses.
The customer’s ID (e.g., cust_abc123def456).
curl -X DELETE https://api.gettrxn.com/v1/customers/cust_abc123def456 \
-H "Authorization: Bearer $TRXN_TOKEN"
Returns 204 No Content on successful deletion.
Customer features
Automatic wallet creation
When a customer is created, a cryptocurrency wallet is automatically created for them. This wallet can hold multiple cryptocurrency addresses for receiving payments.
Email validation
- Email addresses must be in a valid format.
- Email addresses are automatically converted to lowercase.
- Email addresses must be unique within your account (but can be duplicated across different accounts).
Prefixed IDs
All customer IDs are returned with the prefix cust_ followed by a unique identifier (e.g., cust_abc123def456). This makes it easy to identify customer IDs in your application.
By default, the API returns 25 customers per page. Use the page query parameter to navigate through pages.
The pagination object in the response includes:
Total number of items across all pages.
Integration example
# 1. Create a customer
curl -X POST https://api.gettrxn.com/v1/customers \
-H "Authorization: Bearer $TRXN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "first_name": "John", "last_name": "Doe"}'
# Response: {"id": "cust_abc123def456", ...}
# 2. Create a payment claim link for the customer
curl -X POST https://api.gettrxn.com/v1/payment_claim_links \
-H "Authorization: Bearer $TRXN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"customer_id": "cust_abc123def456"}'
# 3. Send the payment link to the customer
# 4. Customer submits payment information
# 5. Review and approve the payment claim
Sandbox support
The API respects sandbox scoping. If your API token is associated with a sandbox, you can only access customers created in that sandbox. Email uniqueness is enforced separately within each sandbox.