Skip to content

Products & prices

Your catalog has two levels, just like Stripe:

  • Product (prod_…) — the thing you sell (“Pro plan”).
  • Price (price_…) — a recurring amount + interval attached to a product (“NPR 499 / month”). Subscriptions reference a price, not a product.

A product can have many prices (monthly vs. annual, different tiers).

Terminal window
curl -s "$TRILE_API/v1/catalog/products" \
-H "x-api-key: $TRILE_KEY" -H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "name": "Pro plan", "description": "Everything in Pro." }'

You can attach a product image with POST /v1/catalog/products/:productId/image (multipart; SVG/PNG/JPEG up to 2 MB).

A price pins down how much and how often. Amounts are in paisa, as a string.

Terminal window
curl -s "$TRILE_API/v1/catalog/prices" \
-H "x-api-key: $TRILE_KEY" -H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"productId": "prod_01ARZ3NDEKTSV4RRFFQ69G5FAX",
"amount_paisa": "49900",
"currency": "NPR",
"interval": "month",
"intervalCount": 1,
"trialDays": 14
}'
FieldNotes
amount_paisaRecurring amount in paisa, as a string. "49900" = NPR 499.00.
intervalday, week, month, or year.
intervalCountMultiplier. interval: "month", intervalCount: 3 → quarterly.
trialDaysOptional free trial before the first charge. With a trial, the first wallet debit is deferred to the end of the trial.

Prices and products are immutable in the ways that matter — you don’t edit an amount, you create a new price and archive the old one:

Terminal window
curl -X DELETE "$TRILE_API/v1/catalog/prices/price_01ARZ3..." -H "x-api-key: $TRILE_KEY"

Archiving a price (soft delete) stops new subscriptions from using it; existing subscriptions on that price keep billing. PATCH is for metadata and non-financial fields, not the amount.

Put a customer on a price: Subscriptions.