Skip to main content
This API allows you to create and manage products for your account. Products represent the items or services that your customers can purchase using cryptocurrency payments.

The product object

id
string
Unique identifier with prod_ prefix (e.g., prod_abc123def456).
name
string
The product’s name. Leading and trailing whitespace is automatically trimmed.
created_at
string
When the product was created (ISO 8601).
updated_at
string
When the product was last updated (ISO 8601).

List products

GET /v1/products
Retrieves a paginated list of all products in your account.
page
integer
default:"1"
Page number for pagination. Results are returned 25 items per page.
curl https://api.gettrxn.com/v1/products \
  -H "Authorization: Bearer $TRXN_TOKEN"
Response
{
  "products": [
    {
      "id": "prod_abc123def456",
      "name": "Premium Subscription",
      "created_at": "2024-01-01T12:00:00Z",
      "updated_at": "2024-01-01T12:00:00Z"
    },
    {
      "id": "prod_xyz789ghi012",
      "name": "Digital Course",
      "created_at": "2024-01-02T10:30:00Z",
      "updated_at": "2024-01-02T10:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "pages": 3,
    "count": 67
  }
}

Get product

GET /v1/products/:id
Retrieves a specific product by ID.
id
string
required
The product’s ID (e.g., prod_abc123def456).
curl https://api.gettrxn.com/v1/products/prod_abc123def456 \
  -H "Authorization: Bearer $TRXN_TOKEN"
Response
{
  "id": "prod_abc123def456",
  "name": "Premium Subscription",
  "created_at": "2024-01-01T12:00:00Z",
  "updated_at": "2024-01-01T12:00:00Z"
}

Create product

POST /v1/products
Creates a new product in your account.
name
string
required
The product’s name. Whitespace is automatically trimmed. Cannot be blank.
curl -X POST https://api.gettrxn.com/v1/products \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "New Digital Product"
  }'
Response
{
  "id": "prod_new123product456",
  "name": "New Digital Product",
  "created_at": "2024-01-15T14:30:00Z",
  "updated_at": "2024-01-15T14:30:00Z"
}

Validation errors

Name cannot be blank
{
  "errors": {
    "name": ["can't be blank"]
  }
}

Update product

PATCH /v1/products/:id
Updates an existing product.
id
string
required
The product’s ID (e.g., prod_abc123def456).
name
string
The product’s name. Whitespace is automatically trimmed.
curl -X PATCH https://api.gettrxn.com/v1/products/prod_abc123def456 \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Product Name"
  }'
Response
{
  "id": "prod_abc123def456",
  "name": "Updated Product Name",
  "created_at": "2024-01-01T12:00:00Z",
  "updated_at": "2024-01-15T16:45:00Z"
}

Delete product

DELETE /v1/products/:id
Deletes a product from your account.
This action is irreversible and will also delete the product’s associated prices and other related data.
id
string
required
The product’s ID (e.g., prod_abc123def456).
curl -X DELETE https://api.gettrxn.com/v1/products/prod_abc123def456 \
  -H "Authorization: Bearer $TRXN_TOKEN"
Returns 204 No Content on successful deletion.

Product features

Automatic name trimming

Product names automatically have leading and trailing whitespace removed during validation. This ensures consistent formatting and prevents issues with extra spaces.

Associated prices

Products can have multiple associated prices for different pricing models (one-time payments, subscriptions, etc.). When a product is deleted, all associated prices are automatically removed.

Name validation

Product names have the following validation rules:
  • Required: Every product must have a name.
  • Trimmed: Leading and trailing whitespace is automatically removed.
  • Flexible: Names can contain special characters, unicode, and emojis.
  • No uniqueness constraint: Multiple products can have the same name within an account.

Pagination

By default, the API returns 25 products per page. Use the page query parameter to navigate through pages.

Integration example

# 1. Create a product
curl -X POST https://api.gettrxn.com/v1/products \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Premium Course"}'

# Response: {"id": "prod_abc123def456", "name": "Premium Course", ...}

# 2. Create a price for the product
curl -X POST https://api.gettrxn.com/v1/prices \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": "prod_abc123def456",
    "amount": 9999,
    "currency": "USD",
    "recurring": false
  }'

# 3. Create a payment claim link using the price
curl -X POST https://api.gettrxn.com/v1/payment_claim_links \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"price_id": "price_xyz789"}'

Sandbox support

The API respects sandbox scoping. If your API token is associated with a sandbox, you can only access products created in that sandbox. Product names can be duplicated across different accounts and sandboxes.