Pagar.me API: orders, charges and subscriptions with AI agents
Pagar.me, part of Stone, offers a REST API for processing online payments by card, Pix and boleto, a Brazilian payment method based on a bank slip. E-commerce stores, SaaS companies and platforms use it for checkout, recurring billing or split payments. Access is through the account's secret key, with separate test and production keys.
What the Pagar.me API offers
Customers and cards
Register customers and store tokenized cards.
Orders and charges
Create orders and charges by card, Pix or boleto, then capture and refund.
Subscriptions and plans
Set up recurring billing, change plans and follow invoices.
Recipients and split
Divide amounts between recipients in marketplaces.
Balance and transfers
Check the balance and receivables.
Webhooks
Receive events for approved, declined and refunded payments.
How to access the Pagar.me API
- With your company’s credentialsBasic authentication with the account's secret key (sk_), with separate keys for test and production, generated in the dashboard.
- The secret key allows refunds, so block that action for the agent or require approval.
- Card data never passes through the agent: use tokenization.
- Test everything with the test keys before production.
Official documentation: docs.pagar.me
What an iTeam agent does with the Pagar.me API
Recovering a declined payment
When a card is declined, the agent tells the customer and offers Pix or boleto on the right channel.
Subscription at risk
Subscription invoices with a failed charge trigger contact from the agent before cancellation.
Refund review
The agent lists the period's refunds and chargebacks with the reason and the originating order.
Customer question about a charge
The agent looks up the order in Pagar.me and explains the status and the settlement date.
From the credential to the agent at work, with approval
Get the keys from the dashboard
In the Pagar.me dashboard, copy the test secret key and configure the webhook that iTeam will receive.
Set permissions per agent
In iTeam, the Pagar.me credential goes into the vault and each agent gets a closed list of actions (look up orders, generate Pix, read subscriptions). Actions that change data require approval from a person.
Validate small, then scale
Start with one case: create a Pix charge with the test key. Once the result is checked, the process takes on more volume, always with an audit trail and approval wherever there is risk.
Ready-made AI teams for this work
Bank reconciliation team
Bank lines, Stripe payouts and ledger entries are matched each morning. You only see what did not match, with a reason.
Accounts payable team
Invoices arrive by e-mail and in shared folders. The team reads them, checks them and lines them up for your approval before the due date.
Collections team
Before and after each due date, customers get a clear reminder with a payment link. Disputes and promises to pay go to your team.
Cash flow forecast team
Every week the projection is rebuilt from your books, open invoices and bills, with a plain note on what changed and why.
Bookkeeping team
Transactions are categorized as they come in, receipts are matched, and the month-end close starts with a short list of questions.
Questions about the Pagar.me API
Is the Pagar.me API free?
There is no charge for using the API; you pay the per-transaction fees set in your contract with Pagar.me.
Do I need to write code to use the Pagar.me API with iTeam?
No. iTeam reads the Pagar.me API documentation and builds the calls, and the deployment team adjusts the flow with you. Your company approves and follows up.
Can the agent see the customer's card number?
No. Pagar.me works with tokenized cards, and the agent only looks at the status, the amount and the order data.