Skip to main content
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

id
string
Unique identifier with cust_ prefix (e.g., cust_abc123def456).
email
string
The customer’s email address. Automatically converted to lowercase.
first_name
string
The customer’s first name.
last_name
string
The customer’s last name.
created_at
string
When the customer was created (ISO 8601).
updated_at
string
When the customer was last updated (ISO 8601).

List customers

GET /v1/customers
Retrieves a paginated list of all customers in your account.
page
integer
default:"1"
Page number for pagination. Results are returned 25 items per page.
curl https://api.gettrxn.com/v1/customers \
  -H "Authorization: Bearer $TRXN_TOKEN"
Response
{
  "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

GET /v1/customers/:id
Retrieves a specific customer by ID.
id
string
required
The customer’s ID (e.g., cust_abc123def456).
curl https://api.gettrxn.com/v1/customers/cust_abc123def456 \
  -H "Authorization: Bearer $TRXN_TOKEN"
Response
{
  "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

POST /v1/customers
Creates a new customer in your account. A cryptocurrency wallet is automatically created for the customer.
email
string
required
The customer’s email address. Must be a valid email format. Automatically converted to lowercase. Must be unique within your account.
first_name
string
The customer’s first name.
last_name
string
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"
  }'
Response
{
  "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

Email cannot be blank
{
  "errors": {
    "email": ["can't be blank"]
  }
}
Invalid email format
{
  "errors": {
    "email": ["is invalid"]
  }
}
Duplicate email
{
  "errors": {
    "email": ["has already been taken"]
  }
}

Update customer

PATCH /v1/customers/:id
Updates an existing customer.
id
string
required
The customer’s ID (e.g., cust_abc123def456).
email
string
The customer’s email address. Must be a valid email format.
first_name
string
The customer’s first name.
last_name
string
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"
  }'
Response
{
  "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

DELETE /v1/customers/:id
Deletes a customer from your account.
This action is irreversible and will also delete the customer’s associated wallet and crypto addresses.
id
string
required
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.

Pagination

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:
page
integer
Current page number.
pages
integer
Total number of pages.
count
integer
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.