Payment Requests
Create Payment Request
This endpoint allows you to create a payment request using HandCash. There are three types of payment requests:
- Payment requests that do not expire on payment (e.g., a link or QR code for donations)
- Payment requests that expire on payment (e.g., a digital item or a unique physical product)
- Limit orders that expire after a set number of purchases (e.g., a limited edition card drop)
API Endpoint
- Method: POST
- URL:
https://cloud.handcash.io/v3/paymentRequests
Headers
Request Parameters
Parameter Details
product
: Details of the product or service being paid for.instrumentCurrencyCode
: The currency code for the payment (e.g., ‘BSV’).denominationCurrencyCode
: Optional. The currency for price denomination if different frominstrumentCurrencyCode
.receivers
: Array of payment recipients, including amount and destination.requestedUserData
: Optional. Array of user data fields to request.redirectUrl
: Optional. URL to redirect the user after payment.notifications
: Optional. Webhook and email notification settings.expirationType
: Type of expiration for the payment request.totalUnits
: Required ifexpirationType
is ‘limit’. The total number of times the payment can be made.expirationInSeconds
: Optional. Time in seconds until the request expires.enabledAt
: Optional. ISO date string for when the request becomes active.
Example Request
Response Type
Important Notes
- The payment request in this example has a single receiver.
- It will expire in 604800 seconds (one week).
- The service will receive the user’s paymail in the body of the webhook notification.
- Custom parameters (e.g.,
gameId
) will be included in the webhook notification. - This payment request expires after 5 payments due to
"expirationType": "limit"
and"totalUnits": 5
. - HandCash will notify the server for each successful payment via the specified webhook URL.
- Email notifications will be sent for each successful payment.
- Users will be redirected to the
redirectUrl
after completing the payment. - The redirect URL will include the
transactionId
as a query parameter. - Developers can use the redirect URL pattern to send users to specific collections of digital items.