How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Accept Card Payments, Run Subscriptions And Handle Chargebacks With Braintree

November 29th, 2026 · Kin Lane
Accept Card Payments, Run Subscriptions And Handle Chargebacks With Braintree

If you sell anything online, sooner or later you need to take a card payment, keep a customer’s card on file so they do not have to type it in again, bill some people every month, and deal with the occasional customer who disputes a charge with their bank. Doing all of that by hand does not scale. Braintree handles that work, and it offers an API for it. An API is a way for your own website, your mobile app, your billing system, or an AI assistant acting for you, to ask Braintree to do something directly, without anyone logging into a control panel. I keep a profile of Braintree on APIs.io, and this is what it lets you get done.

What Braintree does

Braintree is a payment gateway, which is the service that sits between your checkout and the card networks, passing a payment along for approval and then moving the money. Braintree says its mission is to empower developers with the tools, resources, and simple-to-use SDKs and APIs to build on one platform, so they can serve merchants from around the world. An SDK is a ready-made code library for a particular platform, and Braintree offers them for the web, iOS and Android, so card details can be collected inside your app without that sensitive data passing through your own servers.

What you can get done

Payment collection and dunning

This is about getting paid and keeping the way a customer pays on file. Braintree stores cards and other payment methods in what it calls the Vault, and hands you back a “token,” a stand-in reference you can charge later without ever holding the card number yourself. “Dunning” is the word for chasing payments that did not go through.

  • POST /payment_methods saves a new payment method for a customer.
  • GET /payment_methods/any/{paymentMethodToken} looks up a saved payment method.
  • PUT /payment_methods/any/{paymentMethodToken} updates one, for example when a card expires.
  • DELETE /payment_methods/any/{paymentMethodToken} removes one the customer no longer wants on file.
  • POST /transactions charges a customer.

Card transaction processing management

A card payment has stages. First it is authorized, meaning the bank agrees the money is there. Then it is submitted for settlement, meaning you actually collect it. Before settlement you can void it, and after settlement you can refund it. This capability also covers disputes, which are chargebacks: a customer asking their bank to reverse a charge.

  • PUT /transactions/{transactionId}/submit_for_settlement collects money on an authorized payment, for example once an order ships.
  • PUT /transactions/{transactionId}/void cancels a payment before it settles.
  • POST /transactions/{transactionId}/refund gives money back after it settles.
  • GET /disputes lists the chargebacks customers have filed.
  • PUT /disputes/{disputeId}/accept accepts a dispute when you agree the customer should get their money back.

Subscription lifecycle management

If you bill people on a schedule, such as a monthly membership or a yearly software license, subscriptions do the repeat charging for you. Plans, add-ons and discounts are set up in the Braintree Control Panel, and the API puts customers on them, changes them and ends them.

  • POST /subscriptions signs a customer up to a plan.
  • GET /subscriptions/{subscriptionId} checks the status of a subscription.
  • PUT /subscriptions/{subscriptionId} changes it, such as moving to a different price.
  • PUT /subscriptions/{subscriptionId}/cancel ends it.
  • POST /subscriptions/{subscriptionId}/retry_charge tries a failed renewal charge again, which is the dunning part in practice.

Customer data management

Every saved card and subscription hangs off a customer record: a name, contact details, an address, and the payment methods attached to them. Keeping that record in Braintree means a returning buyer can pay with one tap.

  • POST /customers creates a customer record.
  • GET /customers/{customerId} looks one up.
  • PUT /customers/{customerId} updates contact or billing details.
  • DELETE /customers/{customerId} removes a customer.

Braintree can also tell your systems when something happens, through webhooks. A webhook is a message Braintree sends to your software the moment an event occurs, such as a subscription changing status or a dispute being opened, instead of your software having to keep checking.

Getting started

Braintree is a paid service. For what it costs, see the Pricing section of the Braintree profile. The documentation lives on PayPal’s developer site: the GraphQL API concepts guide explains Braintree’s main server API, the JavaScript client SDK setup guide covers taking payments on a website, and the iOS SDK setup guide covers taking them in an iPhone app.

On APIs.io you can browse the Braintree profile along with individual APIs such as the GraphQL API, the Customers API, the Disputes API and the Plans API.

If you are still keying card numbers into a terminal or chasing failed renewals by email, start by putting your checkout on the JavaScript SDK and let Braintree keep the cards and the recurring billing for you.