For the complete documentation index, see llms.txt. This page is also available as Markdown.

Test with PayPal

PayPal is available for testing on a terminal with type = virtual. In Sandbox, PayPal uses a sandbox test account, so you can complete a test payment and confirm the wallet approval and completion flow end to end. No real assets are required and no live PayPal balance is used.

Use this guide when you want to validate the PayPal wallet flow. For the recommended default end to end test, see Test with Klarna. For a comparison of all test methods, see Choosing a Test Method.

1 – Prerequisites

Item
Notes

PayPal enabled for your Sandbox merchant and terminal

Contact developer support if PayPal is not yet activated for your Sandbox environment.

Terminal with type = virtual

PayPal testing applies to terminals with type = virtual, not physical.

Sandbox base URL

https://api.test.devs.beadpay.io

Hosted payment page base

Returned in paymentUrls

Terminal API key

You need the real API key value. The masked API key is not usable.

merchantId and terminalId

Must match the terminal API key you were issued.

Sandbox PayPal test account

Provided below. Used to log in and approve the payment in the PayPal Sandbox.

Webhook endpoint (recommended)

Publicly reachable and registered in the Bead dashboard.

Authentication note: Payments endpoints use header based authentication. Send your API key as X-Api-Key on every request.

2 – Create Payment Request

Send a POST /Payments/crypto to generate the hosted checkout URL. On a terminal with type = virtual, include refundEmail and a customer object.

Required headers:

  • X-Api-Key: {apiKey}

  • Content-Type: application/json

To present PayPal as the tender, include paypal in tenderTypes.

Example request

Example response:

Save these values:

  • paymentUrls[0] for the hosted checkout URL

  • paymentId your primary lookup key for status checks, webhooks, reporting, and support

3 – Launch Hosted Payment Page

Use paymentUrls[0] to launch checkout.

Option
Details

Redirect

Redirect the shopper's browser to the hosted page URL.

Embed

Load the hosted page URL in an iframe inside your site.

The shopper now sees Bead's hosted payment page.

4 – Select PayPal and Open PayPal Checkout

  1. In the Bead hosted UI, select PayPal as the payment method.

  2. Bead opens the PayPal approval flow. The customer approves the payment via the PayPal app or web.

5 – Complete PayPal Sandbox Checkout

Log in to the PayPal Sandbox flow using the shared test account below and approve the payment. Because this is a sandbox account, no real PayPal balance is used.

Field
Test value

Email / username

test+2@beadpay.io

Password

Password1

If the test account stops working, contact developer support to have the Sandbox credentials rotated.

Follow the PayPal prompts until the shopper is returned to your redirectUrl, if you provided one.

6 – Verify Result

Option A: Webhook verification

Confirm your webhook endpoint receives a payment event indicating completion. Look for a status field that indicates the payment is completed.

Option B: API status check (optional)

Endpoint: GET /Payments/{paymentId}/tracking

What to confirm:

  • The response shows the payment in a completed state.

  • Amount fields reflect a successful payment for the requested amount.

Production eligibility

PayPal has no US residency restriction and supports customers globally, including all US states and territories. The consumer needs an active PayPal account. See Which consumers can use Klarna, PayPal, and Venmo? for full details.

Troubleshooting

  • PayPal does not appear as a tender option. PayPal may not be enabled for the Sandbox merchant or terminal, or the terminal is not type = virtual. Confirm enablement and terminal type with developer support.

  • 401 Unauthorized. The API key is missing or invalid, or the header name is wrong. The header must be exactly X-Api-Key.

  • 403 Forbidden. The API key is valid but not permitted for the merchantId or terminalId in your request. Confirm the IDs match the credential set you were issued and that you are using the correct environment.

  • Validation error on payment creation. On a terminal with type = virtual, confirm you included refundEmail and a complete customer object.

  • Cannot log in to the PayPal Sandbox account. Confirm you are using the current Sandbox test account values above. If they have changed, contact developer support.

  • Redirect does not happen. Confirm you set a valid redirectUrl. If not provided, Bead will display a hosted confirmation screen instead of redirecting.

Next Steps

  • Test different amounts and run cancellation or expiry scenarios.

  • On a terminal with type = virtual, you can also validate Test with Venmo.

  • Validate your production readiness using webhooks plus status checks and avoid tight polling loops.

Last updated