Create Payment
Use the Payments API to generate a hosted payment URL that you can embed or open in a browser. Your application initiates the payment, then the customer completes checkout on Bead’s hosted page.
Because Payments are authenticated with a terminal API key, you should create payments from your backend (recommended). Avoid placing your API key in front end or mobile client code.
Overview
Endpoint:
POST /payments/crypto(Sandbox basehttps://api.test.devs.beadpay.io)Supports crypto and digital wallet tenders
Returns one or more hosted payment URLs you can embed or open
Optionally redirects the shopper to
redirectUrlOptional per payment webhooks via
webhookUrls, in addition to the terminal’s default webhook
For an end to end sandbox flow, see Quick Start.
Step 1: Authenticate (preferred)
Payments use header based authentication with a terminal API key.
apiKey is the secret credential used to authenticate requests. maskedApiKey is a display value and cannot be used to authenticate. Send apiKey on every request using the X-Api-Key header.
Required headers
X-Api-Key: {apiKey}Content-Type: application/json
Step 2: Create a hosted payment URL
Send a request to create a payment. The response includes trackingId, paymentPageId, and paymentUrls.
Endpoint
POST https://api.test.devs.beadpay.io/payments/crypto
Headers
X-Api-Key: {apiKey}Content-Type: application/json
Example request body (minimal)
Example request body (expanded)
Example response
Key fields
terminalIdTerminal identifier in Bead. Determines device level settings such as tender configuration and terminal default webhook.merchantIdMerchant identifier. Used for reporting and settlement.requestedAmountAmount in the requested currency. For simple tests, use whole numbers in USD.paymentUrlTypeType of payment URL. Common value isweb.referenceMerchant side reference such as an order or invoice number.descriptionDescription that may be shown to the customer and in reporting.customerOptional customer object. If you include any customer field, all required fields must be populated. See the conditional customer data rule below.redirectUrlOptional URL Bead will redirect to after the customer completes or cancels checkout.emailReceipt,smsReceipt,refundEmailOptional receipt and refund contact settings.webhookUrlsOptional array of additional webhook endpoints for this payment.
Webhooks
If you include webhookUrls, Bead sends payment lifecycle events to both:
The terminal’s default webhook
Each URL in the
webhookUrlsarray
Configure at least one webhook endpoint before you depend on webhooks in production. See Payment Webhooks for payload and retry details.
Conditional customer data rule
If any field inside customer is sent, all of these fields become required:
firstNamelastNameemailaddressaddress2citystatepostalCodecountryCode
Omitting any of these when a customer object is present results in 400 Bad Request with a validation error.
If you do not want to send complete customer data, omit the customer object entirely.
Step 3: Present the hosted page
Use the first URL in paymentUrls to start checkout.
Common patterns:
Web or SPA: Embed the URL in an iframe or open a new tab or window.
Native app: Load the URL in an in-app browser or webview.
Redirect behaviour:
If
redirectUrlis provided: After success or cancel, Bead redirects the browser toredirectUrland includes context in the query string. Use this to show your own confirmation page.If
redirectUrlis not provided: Bead displays a hosted confirmation page that indicates success or cancellation.
Regardless of redirect choice, you should always confirm the final status via webhooks or status polling before shipping goods or granting access.
Step 4: Confirm payment status
You can confirm payment status using webhooks or polling.
Option A: Webhooks (recommended)
Configure a terminal level webhook and optionally supply
webhookUrlsper payment.Your server receives JSON payloads whenever
statusCodechanges.Respond with
200 OKas soon as you have persisted or queued the event.
Option B: Polling
Endpoint
GET https://api.test.devs.beadpay.io/payments/tracking/{trackingId}
Headers
X-Api-Key: {apiKey}Accept: application/json
Example curl
Use the trackingId returned from the Create Payment response.
Typical statuses:
createdandprocessingwhile the customer is payingcompletedwhen the payment has fully succeededunderpaid,overpaid,expired,invalid, orcancelledfor non happy path outcomes
For full status details, see Payment Statuses.
Troubleshooting
401 Unauthorized
API key is missing, invalid, or sent using the wrong header name. The header must be exactly
X-Api-Key.
Hosted page will not load
Confirm you are using a URL from the
paymentUrlsarray returned by the create payment response.Confirm the terminal is configured for at least one tender in the environment you are testing.
No status change
Confirm you are polling the correct
trackingId.If using webhooks, confirm your endpoint is reachable and returns HTTP 200 quickly.
Next steps
After you can create and complete a payment in Sandbox:
Configure Payment Webhooks and verify your endpoint receives status events.
Use Payment Statuses for ad hoc queries and troubleshooting.
Explore Reporting and Settlement to build payment history and reconciliation jobs.
When ready for Production, request production credentials and switch API base URLs to production.
Legacy authentication (supported for existing integrators)
Some existing integrations authenticate Payments using OAuth 2.0 password grant with a terminal username and password. New Payments integrations should use the terminal API key method described above.
If you are using legacy OAuth for Payments, obtain an access token using the password grant and send Authorization: Bearer {access_token} on Payments requests. See the Authentication page for token endpoint details, realms, and refresh token usage.
Legacy token request example
Last updated