Skip to main content

Create a payment

POST /payments — Initialize a new payment request. Tribridge derives the merchant from your x-api-key header and returns a unique id plus a hosted checkout_url to send to your customer. The settlement chain is chosen later, when the deposit wallet is generated.

Step 1 — Send the request

Include your API key and a JSON body:

Headers

Body parameters

The settlement chain (solana or sui) is selected when the deposit wallet is generated via POST /payments/checkout/:id/generate-wallet — it is not a field of the create request.

Step 2 — Send the customer to checkout

Redirect the customer (or show a link/QR) to the checkout_url. There they select a chain, see the one-time deposit address and exact amount, and pay from any wallet.

Step 3 — Handle the outcome

  • Test mode: click Simulate Payment on the checkout page — no real chain involved.
  • Live mode: wait for the real on-chain transfer. Tribridge detects finality and fires payment.confirmed, then payment.completed to your webhook.
After completion the customer is sent to your redirect_url (if provided). Never trust the redirect alone — always confirm via webhook or by fetching the payment status server-side.

Possible errors

Payment Lifecycle

What happens to a payment after creation, state by state.

Webhooks

Get notified the moment each state changes.