POST
/hyax-api/trpc/crypto.createCryptoCheckoutSessionCreate a USDC checkout session
Public tRPC mutation — buyers are anonymous at checkout, so no API key is needed. Wrap the input in `{ "json": … }` (SuperJSON) and read the result from `result.data.json`. Pricing is never trusted from the client: shipping and coupons are recomputed server-side. Each session adds a sub-cent nonce to the total so every open session has a unique expected amount — the buyer must transfer `amountBaseUnits` exactly, or verification fails. Sessions expire after 3 hours.
Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.
Request body
| Field | Required | Description |
|---|---|---|
teamId | Required | Team receiving the payment. Must have crypto enabled and a valid wallet. |
amountCents | Required | Integer USD cents before discounts |
customerEmail | Required | Buyer email; used to create or match the person on fulfillment |
chainId | No | Supported network ID. Default `8453` (Base). |
currency | No | Default `usd` |
customerName | No | |
productId | No | Product to grant access to on fulfillment |
items | No | Cart line items; also used for coupon eligibility |
couponCode | No | Validated and applied server-side |
shippingRateId | No | Recalculated server-side against the shipping address |
shippingAddress | No | Object: firstName, lastName, email, phone, address1, address2, city, state, zipCode, country |
billingAddress | No | Same shape as `shippingAddress` |
visitorId | No | Cookie ID for revenue attribution |
postId | No | Attribute the sale to a post |
linkId | No | Attribute the sale to a link |
Request
curl -X POST 'https://platform.hyax.com/hyax-api/trpc/crypto.createCryptoCheckoutSession' \
-H 'Content-Type: application/json' \
-d '{
"json": {
"teamId": "clx_team_id",
"amountCents": 4999,
"chainId": 8453,
"currency": "usd",
"customerEmail": "[email protected]",
"customerName": "Jane Smith",
"productId": "clx_product_id",
"items": [
{
"id": "1",
"productId": "clx_product_id",
"name": "E-book",
"price": 49.99,
"quantity": 1
}
],
"visitorId": "hyax_vid_abc123"
}
}'Response
{
"result": {
"data": {
"json": {
"sessionId": "clx…",
"recipientAddress": "0xYourReceivingWalletAddress00000000000000",
"chainId": 8453,
"networkName": "Base",
"nativeSymbol": "ETH",
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amountBaseUnits": "49994271",
"amountDisplay": "49.994271"
}
}
}
}