Skip to main content
Start a customer deposit session through a widget.
POST /api/v1/widgets/:widgetId/create-session Creates a deposit session for a customer paying through the widget. The session has a 30-minute expiry and is tracked through CREATEDPENDINGCONFIRMED statuses. This endpoint accepts either a JWT bearer token or the widget’s client secret via X-Client-Secret header.

Parameters

Path

NameTypeRequiredDescription
widgetIdstringYesThe widget ID

Body

NameTypeRequiredDescription
amountstringYesPayment amount as a decimal string, 1–32 characters
currencystringYesCurrency symbol, 2–8 uppercase alphanumeric (e.g. USDC)
networkstringYesBlockchain network, 4–66 characters
currencyAddressstringYesContract address of the currency on the network, 0–66 characters
depositAddressstringYesDestination address for the deposit, 1–128 characters
customerEmailstringNoCustomer’s email, 1–128 characters
customerReferencestringNoYour internal reference ID, 1–128 characters
metadataobjectNoCustom metadata matching the widget’s schema, 1–2,048 bytes

Request example

curl --request POST 'https://payments.bleepay.com/api/v1/widgets/wdgt_abc/create-session' \
  --header 'X-Client-Secret: wdgt_secret_abc123...' \
  --header 'Content-Type: application/json' \
  --data '{
    "amount": "100",
    "currency": "USDC",
    "network": "polygon",
    "currencyAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
    "depositAddress": "0xMerchantWalletAddress",
    "customerEmail": "customer@example.com",
    "customerReference": "order_12345"
  }'

Response

Response schema

FieldTypeDescription
idstringUnique session identifier
paymentStatusstringInitial status — CREATED
amountstringPayment amount
currencystringCurrency symbol
networkstringBlockchain network
currencyAddressstringCurrency contract address
depositAddressstringDestination deposit address
expiresAtstringISO 8601 expiry (30 minutes from creation)
clientSecretstringOne-time client secret for tracking this session

Example response

{
  "id": "dep_a1b2c3d4e5f6",
  "paymentStatus": "CREATED",
  "amount": "100",
  "currency": "USDC",
  "network": "polygon",
  "currencyAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
  "depositAddress": "0xMerchantWalletAddress",
  "expiresAt": "2026-06-09T12:30:00.000Z",
  "clientSecret": "dep_secret_xyz..."
}

Error responses

StatusCodeDescription
400validation_failedParameters outside allowed ranges (amount not in min/max, disallowed network/currency, etc.)
401unauthorizedMissing or invalid authentication
404not_foundWidget not found