You need an
sk_test_ key. If you don’t have one yet, see Set up your account.1
Install the prerequisites
You need Node.js 20 or 22 (LTS).
2
Create the project and install the SDK
3
Configure the API key
Create a
.env file in the root with your sandbox key:4
Create the PIX charge
Create a checkout session with PIX. The response includes the
checkoutUrl you redirect the buyer to:5
Make your first payment
In the sandbox, the outcome is controlled by the last two digits of the amount — no real PIX needed:
Since the session above uses
10_000, the payment is confirmed within seconds and fires the transaction.paid webhook.6
Check the payment in the Dashboard
Go to Transactions at app.payments.bob.company and see the just-paid charge, with the
isSandbox: true field.Next steps
Understand the flow
See how session, transaction, checkout, and webhook connect.
Configure webhooks
Implement asynchronous confirmation on your server.
Test in the sandbox
Simulate payment states without moving real money.
See all paths
Compare hosted checkout, Checkout SDK, and direct API.