> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Braintree payments and subscriptions

> Observe Braintree transactions and recurring billing, and send GraphQL writes.

Follow the [REST app guide](https://docs.bijection.com/integrations/native-rest.md). Use `providerEndpoint` with `https://payments.braintree-api.com` or `https://payments.sandbox.braintree-api.com` and `/graphql`. Seal the Base64 value of `public_key:private_key` as `Authorization` header auth with prefix `Basic `. Bind receivers and mounts to the same protected `data` label.

Use one mount per mode and initialize with `{ profile: { mode: "provider", provider, limit: 25 } }`.

| Provider mode | Fields |
| - | - |
| `braintree.transactions.observations` | Global transaction ID, status, amount and currency, and provider order reference. For PayPal transactions the order reference can contain the PayPal invoice ID. |
| `braintree.subscriptions.observations` | Global subscription ID, lifecycle status, plan reference and price. |

Both modes retain the ending Relay cursor while Braintree reports more results. The next sweep starts at the first page. Missing records remain landed. Each response supports up to 50 records and 36 KiB and requires the bundled parser artifact. Standalone PayPal invoices belong to the separate PayPal Invoicing API.

## Write subscriptions and charge a payment method

Use `providerWriter` with a write-capable sealed Basic credential and the same protected label. Supply one GraphQL mutation input object, up to 24 KiB.

| Mode | Slot | Actions |
| - | - | - |
| `braintree.subscriptions.create-update` | `providerWriter` | Create and update recurring billing subscriptions. Put the global subscription ID in the update command's `id` and omit `subscriptionId` from the input. |
| `braintree.transactions.charge` | `providerWriter` | Create one transaction through `chargePaymentMethod` using a Braintree payment method ID. |

Each caller key binds one exact command. An uncertain task settles as final `Unknown`. GraphQL errors or a missing returned ID prevent acknowledgment. An acknowledged charge establishes the transaction ID. Use the transaction source to observe settlement. Commands perform no deletes and carry no read cursor.

[Braintree GraphQL reference](https://developer.paypal.com/braintree/graphql/reference) · [PayPal Invoicing API](https://developer.paypal.com/docs/api/invoicing/v2/)

Submit mode `braintree.subscriptions.cancel` through the subscription writer with `{ action: "cancelSubscription", id }` using the global subscription ID. The once command requires that ID and `CANCELED` status in the reply. Cancellation keeps the subscription record and carries no read cursor.

[Cancel a Braintree subscription](https://developer.paypal.com/braintree/graphql/reference/mutations/cancel-recurring-billing-subscription)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.