credits | Wren API

Credits

Credits are a prepaid balance on your Wren account. You can top up your credit balance via Stripe, then use credits to pay for offset orders without a per-transaction charge. Credits also allow offset purchases below the $1.00 Stripe minimum.

POST /api/credits/top-up — Add credits

Charges your payment method on file and adds the amount to your credit balance.

POST/api/credits/top-upCopy Path

Authentication

Required. Use a team API token (recommended; tops up the team wallet) or legacy personal API token (tops up the user wallet). Account required for personal tokens. Test tokens (wren_test_…) return a canned response without charging Stripe — see Test mode.

Headers

Request body

Attribute Type Description & Constraints
amountInUsdCents integer Required. Amount to add in USD cents. Must be a positive integer and at least 100 ($1.00).

Example request

Success response

HTTP 200

Error responses


GET /api/credits/balance — Get your credit balance

Returns the authenticated user's current credit balance.

GET/api/credits/balanceCopy Path

Authentication

Required. Use a team API token (returns the team wallet) or legacy personal API token (returns the user wallet). Test tokens return a canned $1,000.00 balance.

Request

No body. No query parameters.

Example request

Success response

HTTP 200

Error responses


GET /api/credits/ledger — List credit transactions

Returns the authenticated user's credit transaction history, sorted by most recent first.

GET/api/credits/ledgerCopy Path

Authentication

Required. Use a team API token (returns the team ledger) or legacy personal API token (returns the user ledger). Test tokens return a small canned sample ledger.

Query parameters

Parameter Type Description & Constraints
limit integer Optional. Number of entries to return. Default 50, max 200.
offset integer Optional. Number of entries to skip. Default 0.

Example request

Success response

HTTP 200

Error responses