Skip to content

Create a payment

POST /v1/payments

Credential: secret key.

ParameterTypeRequiredDescription
amountstringYesPrice in USD with up to 2 decimals, from "0.50" to "1000000"
payment_idstringYesYour reference (1–128 characters), unique per mode. Makes the request idempotent.
currencystringNoOnly "USD" (default)
expires_inintegerNoSeconds the payer can start paying, from 300 to 604800 (7 days). Default: your payment defaults (60 minutes unless changed).
descriptionstringNoShown to the payer, up to 500 characters
success_urlstringNoWhere the hosted page sends the payer after paying
cancel_urlstringNoWhere the hosted page sends a payer who leaves
metadataobjectNoUp to 20 string keys, values up to 500 characters. Never shown to the payer.
fee_payerstringNomerchant (fees come out of what you receive) or payer (a processing fee is added to what the payer sends). Default: your payment defaults.
max_conversion_bpsintegerNoMaximum conversion cost in basis points, 10–500 (0.1%–5%). Default: your payment defaults.
underpay_tolerancestringNoShortfall in USD that still counts as paid, up to "1000". Default: your payment defaults.
tokenstringNoWith network: also issue a deposit address for this method (headless)
networkstringNoWith token
Terminal window
curl https://api.unizpay.com/v1/payments \
-H "Authorization: Bearer $UNIZPAY_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": "25.00",
"payment_id": "order_1001",
"description": "Order #1001",
"success_url": "https://shop.example.com/orders/1001",
"metadata": { "customer_id": "c_123" }
}'

201 with the payment object (200 when it already existed), plus:

FieldDescription
methodsEvery token and network the payment can be paid with: [{ "token", "network", "network_name" }]
deposit_addressOnly when token and network were sent: the issued deposit address
StatusCodeWhen
400invalid_requestA parameter is missing or invalid (param names it)
409conflictPayouts are not set for this mode, or payment_id was used with different details
422method_unavailabletoken/network can’t be paid to your payouts right now