Checkout for Pix
Example payload and integration flow for creating a standalone checkout with Pix payment, expiration, and redirect URLs.
Create a standalone checkout to receive a payment via Pix, define when the link expires, and redirect the customer back to your site.
Use this checkout type when you sell a product or service with a single payment, such as a course, ticket, e-commerce order, or one-time charge. The customer accesses the checkout link, pays with Pix, and returns to the configured URL based on the journey outcome.
Before You Begin
- Define your site's URLs for success, cancellation, and expiration scenarios.
- List the items being charged, including name, quantity, and value.
- Use
customerDataif you want to pre-fill customer information when creating the checkout.
Integration Flow
- Build the payload with
billingTypes,chargeTypes,minutesToExpire,callback, anditems. - Send the payload in the checkout creation flow via the API.
- After the API returns the checkout ID, use that ID to display or share the payment link with the customer.
- Direct the customer to the checkout to complete the Pix payment.
- Handle the customer's return via the URL configured in
successUrl,cancelUrl, orexpiredUrl.
Example Payload
Use this JSON body when creating the checkout:
{
"billingTypes": ["PIX"],
"chargeTypes": ["DETACHED"],
"minutesToExpire": 60,
"callback": {
"cancelUrl": "https://mysite.com/cancelled",
"expiredUrl": "https://mysite.com/expired",
"successUrl": "https://mysite.com/success"
},
"items": [
{
"name": "Marketing Course",
"description": "Complete digital marketing course",
"quantity": 1,
"value": 297.00
}
]
}This payload creates a checkout with:
- Pix payment
- Standalone charge with
chargeTypesset toDETACHED - Link valid for 60 minutes
- A product called "Marketing Course" valued at R$ 297.00
- Redirect to your site after success, cancellation, or expiration
Main Parameters
| Field | Type | Required | Description |
|---|---|---|---|
billingTypes | array of strings | Yes | Defines the payment methods accepted at checkout. Use ["PIX"] to accept Pix. |
chargeTypes | array of strings | Yes | Defines the charge type. Use ["DETACHED"] for a standalone charge. |
minutesToExpire | number | Yes | Defines how many minutes the checkout link remains valid. In the example, 60 equals 1 hour. |
callback | object | Yes, when you need to redirect the customer | Groups the URLs where the customer will be sent after success, cancellation, or expiration. |
callback.cancelUrl | string | Yes, within callback | URL to redirect the customer when they cancel or abandon the journey through the cancellation flow. |
callback.expiredUrl | string | Yes, within callback | URL to redirect the customer when the checkout link has expired. |
callback.successUrl | string | Yes, within callback | URL to redirect the customer after successful checkout completion. |
items | array of objects | Yes | Defines what you are selling. Include at least one item. |
items[].name | string | Yes | Name of the product or service displayed at checkout. |
items[].description | string | No | Additional description of the item. |
items[].quantity | number | Yes | Quantity of the item being sold. |
items[].value | number | Yes | Unit price of the item in BRL. In the example, 297.00 represents R$ 297.00. |
Important Behaviors
- The link becomes invalid after the period defined in
minutesToExpire. - If the customer accesses an expired checkout, use
expiredUrlto explain the next step, such as generating a new checkout. - If the customer cancels the journey, use
cancelUrlto allow them to try again or return to the cart. - If the checkout is completed successfully, use
successUrlto show the order confirmation or post-payment instructions.
Do not use this payload for subscriptions or installments without including the specific fields for those checkout types. For recurring charges, use the appropriate charge type described on the subscription page.
Best Practices
- Create clear return pages for
successUrl,cancelUrl, andexpiredUrl, informing the customer of the purchase status and next action. - Validate that all items have
name,quantity, andvaluebefore sending the payload. - Use values consistent with the cart or order saved in your system to avoid discrepancies between the checkout and the sale.
- Generate a new checkout when the link expires, rather than reusing an old link.
- Do not rely solely on browser redirects to reconcile orders; also handle events and confirmations in your payment flow.
Next Steps
- See Checkout Link and Customer Redirect to learn how to use the ID returned by the API.
- See How to Provide Customer Data to pre-fill the checkout with
customerData. - See Checkout with Subscription (Recurring) if the charge should repeat over time.
- See Checkout for Credit Card if you also need to accept card payments.
