This API allows you to create and manage prices for your products. Prices define the cost and billing structure (one-time or recurring) for your products, enabling customers to make cryptocurrency payments.
The price object
Unique identifier with price_ prefix (e.g., price_abc123def456).
The price amount in cents (e.g., 2999 for $29.99).
The associated product’s ID.
Whether the price is active. Defaults to true on creation.
Recurring billing configuration. null for one-time prices. Show recurring properties
Billing interval: day, week, month, or year.
Number of intervals between charges.
When the price was created (ISO 8601).
When the price was last updated (ISO 8601).
One-time price example
{
"id" : "price_def456ghi789" ,
"amount" : 4999 ,
"product_id" : "prod_xyz789ghi012" ,
"active" : true ,
"recurring" : null ,
"created_at" : "2024-01-02T10:30:00Z" ,
"updated_at" : "2024-01-02T10:30:00Z"
}
Recurring price example
{
"id" : "price_abc123def456" ,
"amount" : 2999 ,
"product_id" : "prod_xyz789ghi012" ,
"active" : true ,
"recurring" : {
"interval" : "month" ,
"interval_count" : 1
},
"created_at" : "2024-01-01T12:00:00Z" ,
"updated_at" : "2024-01-01T12:00:00Z"
}
List prices
Retrieves a paginated list of all prices in your account.
Page number for pagination. Results are returned 25 items per page.
curl https://api.gettrxn.com/v1/prices \
-H "Authorization: Bearer $TRXN_TOKEN "
{
"prices" : [
{
"id" : "price_abc123def456" ,
"amount" : 2999 ,
"product_id" : "prod_xyz789ghi012" ,
"active" : true ,
"recurring" : {
"interval" : "month" ,
"interval_count" : 1
},
"created_at" : "2024-01-01T12:00:00Z" ,
"updated_at" : "2024-01-01T12:00:00Z"
},
{
"id" : "price_def456ghi789" ,
"amount" : 4999 ,
"product_id" : "prod_xyz789ghi012" ,
"active" : true ,
"recurring" : null ,
"created_at" : "2024-01-02T10:30:00Z" ,
"updated_at" : "2024-01-02T10:30:00Z"
}
],
"pagination" : {
"page" : 1 ,
"pages" : 3 ,
"count" : 67
}
}
Get price
Retrieves a specific price by ID.
The price’s ID (e.g., price_abc123def456).
curl https://api.gettrxn.com/v1/prices/price_abc123def456 \
-H "Authorization: Bearer $TRXN_TOKEN "
{
"id" : "price_abc123def456" ,
"amount" : 2999 ,
"product_id" : "prod_xyz789ghi012" ,
"active" : true ,
"recurring" : {
"interval" : "month" ,
"interval_count" : 1
},
"created_at" : "2024-01-01T12:00:00Z" ,
"updated_at" : "2024-01-01T12:00:00Z"
}
{
"id" : "price_def456ghi789" ,
"amount" : 4999 ,
"product_id" : "prod_xyz789ghi012" ,
"active" : true ,
"recurring" : null ,
"created_at" : "2024-01-02T10:30:00Z" ,
"updated_at" : "2024-01-02T10:30:00Z"
}
Create price
Creates a new price for a product in your account.
The product’s ID (e.g., prod_abc123def456). Must belong to your account.
The price amount in cents (e.g., 2999 for $29.99). Must be 0 or greater.
Object containing recurring billing configuration. Omit for one-time prices. Show recurring properties
Billing interval. One of: day, week, month, year.
Number of intervals between charges. Must be a positive integer (e.g., 1 for monthly, 3 for quarterly).
Create a one-time price
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": 4999
}'
Create a monthly recurring price
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": 2999,
"recurring": {
"interval": "month",
"interval_count": 1
}
}'
Create a quarterly recurring price
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,
"recurring": {
"interval": "month",
"interval_count": 3
}
}'
{
"id" : "price_new123price456" ,
"amount" : 2999 ,
"product_id" : "prod_abc123def456" ,
"active" : true ,
"recurring" : {
"interval" : "month" ,
"interval_count" : 1
},
"created_at" : "2024-01-15T14:30:00Z" ,
"updated_at" : "2024-01-15T14:30:00Z"
}
Validation errors
{
"errors" : {
"amount" : [ "can't be blank" ]
}
}
Amount must be non-negative
{
"errors" : {
"amount" : [ "must be greater than or equal to 0" ]
}
}
Interval is required for recurring prices
{
"errors" : {
"interval" : [ "is required for recurring prices. Valid options are: \" day \" , \" week \" , \" month \" , or \" year \" " ]
}
}
Interval count is required
{
"errors" : {
"interval_count" : [ "is required for recurring prices" ]
}
}
Interval count must be a positive integer
{
"errors" : {
"interval_count" : [ "must be greater than zero and only integer values are valid" ]
}
}
Update price
Updates a price’s active status. Only the active attribute can be modified after creation.
The price’s ID (e.g., price_abc123def456).
Whether the price is active. Set to false to deactivate.
curl -X PATCH https://api.gettrxn.com/v1/prices/price_abc123def456 \
-H "Authorization: Bearer $TRXN_TOKEN " \
-H "Content-Type: application/json" \
-d '{
"active": false
}'
{
"id" : "price_abc123def456" ,
"amount" : 2999 ,
"product_id" : "prod_xyz789ghi012" ,
"active" : false ,
"recurring" : {
"interval" : "month" ,
"interval_count" : 1
},
"created_at" : "2024-01-01T12:00:00Z" ,
"updated_at" : "2024-01-15T16:45:00Z"
}
Delete price
Deletes a price from your account.
This action is irreversible and will also delete associated subscriptions and line items.
The price’s ID (e.g., price_abc123def456).
curl -X DELETE https://api.gettrxn.com/v1/prices/price_abc123def456 \
-H "Authorization: Bearer $TRXN_TOKEN "
Returns 204 No Content on successful deletion.
Recurring billing intervals
Prices can be configured for recurring billing with flexible intervals:
Configuration interval interval_count Daily day1Weekly week1Bi-weekly week2Monthly month1Quarterly month3Semi-annually month6Yearly year1
Recurring billing examples
Weekly subscription ($9.99/week)
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": 999,
"recurring": {
"interval": "week",
"interval_count": 1
}
}'
Quarterly subscription ($49.99 every 3 months)
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": 4999,
"recurring": {
"interval": "month",
"interval_count": 3
}
}'
Annual subscription ($99.99/year)
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,
"recurring": {
"interval": "year",
"interval_count": 1
}
}'
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 one-time price
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": 19999
}'
# Response: {"id": "price_onetime123", "amount": 19999, "recurring": null, ...}
# 3. Create a monthly subscription price
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": 2999,
"recurring": {
"interval": "month",
"interval_count": 1
}
}'
# Response: {"id": "price_monthly123", "amount": 2999, "recurring": {...}, ...}
Sandbox support
The API respects sandbox scoping. If your API token is associated with a sandbox, you can only access prices for products created in that sandbox.