Set up Braintree
Connect a restricted Braintree API key for scheduled transaction polling, add the Carden webhook for disputes, link QuickBooks, and create a server key for Level 2/3 preparation.
On this page
1. Add Braintree in Carden
Select the merchant and Carden environment used by your Braintree backend. Open Integrations, add Braintree, and open its Setup page. Use a sandbox workspace with Braintree sandbox keys and a production workspace with production keys.
2. Create a restricted Braintree API user
- In the Braintree Control Panel, create a custom role that can only view transactions.
- Create a dedicated API user and assign it that role. Do not reuse a person's login or an administrator account.
- Sign in as that user and open Settings (gear) → API.
- Select Generate New API Key, then View.
- Copy the Merchant ID, Public Key, and Private Key.
3. Verify and connect
Paste the Merchant ID, Public Key, and Private Key into Carden Setup and select Verify and connect. Carden checks the keys with Braintree before saving, encrypts them, and never shows the private key again.
- Keys from the wrong Braintree environment fail with an authentication error.
- A role without transaction view access fails with an authorization error.
- A Braintree merchant can be connected to only one Carden workspace.
Connecting starts scheduled transaction polling. The first run reads the previous 90 days of card sales and refunds; later runs read only what changed since the last run, with a short overlap. The Card transaction polling status on the Setup page shows Backfill pending until the first run completes, then Up to date, with the time of the last successful read.
4. Add the Carden webhook in Braintree
Webhooks are optional for card merchants. They deliver dispute changes and refund failures as they happen, and transaction settlement for ACH and SEPA Direct Debit. Everything they carry is also picked up by polling, so a missed notification is not lost.
- After connecting, copy the destination URL shown under Webhook delivery.
- In the Braintree Control Panel, open Settings (gear) → API → Webhooks → Create new webhook.
- Paste the destination URL and select Dispute Opened, Dispute Under Review, Dispute Won, Dispute Lost, Dispute Accepted, Dispute Expired, Refund Failed, Transaction Settled, and Transaction Settlement Declined. Do not select Transaction Disbursed or Disbursement; Carden records those notifications but does not use them.
- Select Create Webhook.
- Select Check URL next to the new webhook. Braintree sends a signed check notification and the Carden status changes from Awaiting first notification to Delivery verified.
The destination URL must be public HTTPS. Braintree signs each notification with your API key pair, so Carden verifies it with the stored keys. Refunds are credit transactions that reference the original sale. Braintree webhooks omit line items, so after a sale settles Carden reads its retained line-item count with the restricted key.
5. Connect QuickBooks
Connect QuickBooks so Carden can prepare Level 2/3 fields from authoritative invoices. Let the initial import complete and resolve factual invoice and item-mapping exceptions. Without QuickBooks, you can still send a complete CanonicalInvoice v1 inline.
6. Create a Carden server key
Create a Braintree-integration Carden API key and store it in your server's secret manager. A Stripe, Square, or QuickBooks key is rejected even if it has a similarly named scope.
| Use | Required Carden scopes |
|---|---|
| Prepare from a QuickBooks invoice | invoices:read + enrichment:write |
| Prepare from an inline CanonicalInvoice v1 | enrichment:write |
| Report payment outcomes | payments:write |
Backend flow
- Look up the invoice your customer is paying and persist a payment attempt with a stable preparation idempotencyKey.
- Call Carden to prepare Braintree fields for the full invoice amount in USD.
- Merge data into gateway.transaction.sale, or into gateway.transaction.submitForSettlement for an authorization you captured later. Keep preparation.id with the attempt.
- Report the Braintree outcome to Carden with enrichmentRequestId set to preparation.id. The report is how Carden links the Braintree transaction to its invoice preparation; polling then confirms settlement, refunds, card classification, and retained Level 2/3 data from Braintree itself.
- Carden polls card transactions with the restricted key and records disputes from polling and signed webhooks. Braintree sends settlement and refund webhooks only for ACH and SEPA Direct Debit.
POST /api/v1/braintree/transaction-enrichment/from-invoice
POST /api/v1/braintree/transaction-enrichment
POST /api/v1/braintree/payment-reportsIf Carden reports a PO, SKU, or unit gap, take the payment as an ordinary Braintree transaction without Level 2/3 fields. Carden never invents a PO number, SKU, unit, or tax amount to fill a field.
Rotate or disconnect
To rotate keys, generate a new API key for the same API user in Braintree, select Rotate API keys in Carden, and paste the new values. The webhook destination URL and the polling cursor are kept, so the Braintree webhook needs no change and no transactions are re-read. Then revoke the old key in Braintree.
Select Disconnect to stop polling and stop accepting webhooks immediately. Payment evidence Carden already recorded is kept. Delete the webhook in Braintree too.