Skip to main content
POST
Create Collection

Overview

Create a checkout session to collect payment from a customer. Returns a checkout URL where the customer completes payment.

Request Body

callbackUrl and webhookUrl are optional overrides. If not provided, the URLs configured in your app dashboard will be used.

Response

Integration Examples

Example Response

Checkout Flow

  1. Create Session: Call this endpoint to create a checkout session
  2. Redirect Customer: Send customer to the checkoutUrl
  3. Customer Pays: Customer logs in and completes payment on Fyatu
  4. Webhook Notification: Receive IPN at your webhookUrl (server-to-server)
  5. Customer Returns: Customer is redirected to callbackUrl with status

Callback URL

After payment (success or failure), the customer is redirected to your callbackUrl with query parameters:
Never trust callback parameters alone. Always verify payment status server-side using the webhook or by calling the Get Collection endpoint.

Webhook (IPN)

Your webhookUrl receives a POST request with the payment details:

Session Expiration

  • Checkout sessions expire after 60 minutes
  • Expired sessions are automatically updated to status EXPIRED
  • Create a new session if the customer returns after expiration

Duplicate Prevention

  • The orderId must be unique per app
  • Attempting to create a collection with a duplicate orderId returns 409 Conflict
  • Use orderId to link payments to your order/invoice system
Store the collectionId to later verify the payment status or issue refunds.

Authorizations

Authorization
string
header
required

JWT access token obtained from /auth/token

Body

application/json
amount
number
required

Payment amount in USD

Required range: x >= 1
orderId
string
required

Your unique order/invoice ID (required)

Maximum string length: 100
description
string
required

Payment description (max 100 chars)

Maximum string length: 100
currency
string
default:USD

Currency code (only USD supported, other values ignored)

callbackUrl
string<uri>

Return URL after payment (overrides dashboard setting)

webhookUrl
string<uri>

IPN URL for server-to-server notifications (overrides dashboard setting)

metadata
object

Custom data to attach

Response

Checkout session created successfully

success
boolean
Example:

true

status
integer
Example:

201

message
string
data
object
meta
object