Skip to main content
Accept PayPal payments with Braintree as the payment service provider (PSP). The customer approves the payment on PayPal and returns to your site, and Payrails completes the payment with Braintree.

Supported workflows

Before you begin

Complete these steps before you send your first PayPal payment through Braintree:
  1. Set up a Braintree integration in your workspace. Follow the Braintree integration setup guide if you don’t have one yet.
  2. In the Braintree Control Panel, link your PayPal business account to your Braintree account.
  3. Add the Payrails domain api.payrails.io to the PayPal domain names in Braintree, so that PayPal can return the customer to Payrails.
  4. In your Braintree integration in Payrails, set the Merchant Account ID to the Braintree merchant account in the currency of your PayPal payments. To accept PayPal in more than one currency, create one Braintree integration per merchant account.
  5. To save PayPal accounts for later payments, ask PayPal to enable billing agreements (reference transactions) on your PayPal account.
  6. In the Payrails Portal, go to Settings → Integrations, open your Braintree integration, select PayPal under Payment methods, and save.
  7. Add PayPal as a payment option in your workflow.

Request fields for Braintree

Send these fields in the authorize request, in addition to the standard authorize fields. Required fields must be present for the payment to succeed. Payrails sends Optional fields to the PSP when you include them.

Authorize a PayPal payment

Call authorize a payment with payPal as the paymentMethodCode.
Authorize request
The response includes a redirect to the PayPal approval page. After the customer approves the payment, PayPal returns them to Payrails, and Payrails charges or authorizes the payment with Braintree, depending on your capture mode. If the customer cancels on PayPal, the payment is canceled. Confirm the result through webhook notifications or the execution status before you fulfill the order.

How Braintree handles PayPal

  • With instant capture, Payrails charges the payment when the customer returns. With manual capture, Payrails authorizes it, and you capture it later in full or in parts.
  • You can refund the full amount or part of it, and cancel an authorized payment.
  • When you save the PayPal account, Braintree stores it as a billing agreement and Payrails returns it as a payment instrument. Use it for later subscription or unscheduled payments.
  • Braintree doesn’t send payment status webhooks for PayPal, so Payrails gets the result when the customer returns from PayPal.
Last modified on October 6, 2026