> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dintero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accept payments online

> Add a checkout to your website or app. Create a session, display the Dintero-hosted payment page, and handle the result.

Add a payment checkout to your website or app. You create a session with the order details, display the Dintero-hosted checkout (embedded or as a redirect), and receive a callback when the customer has paid.

This is the standard integration for any online store or service that needs to collect a one-time payment.

```mermaid theme={null}
sequenceDiagram
    participant Merchant as Your server
    participant API as Dintero API
    participant Checkout as Checkout page
    participant Customer as Customer

    Merchant->>API: Create checkout session
    API-->>Merchant: Session ID + checkout URL
    Merchant->>Checkout: Redirect or embed checkout
    Customer->>Checkout: Select payment method & pay
    Checkout->>API: Payment completed
    API->>Merchant: Callback with transaction status
    Checkout->>Customer: Redirect to confirmation page
```

## Integration steps

<Steps>
  <Step title="Create API credentials">
    In [Backoffice](https://backoffice.dintero.com/), go to **Settings > API clients** and create a new **Checkout client**. Save the Client ID and Client Secret. The secret is only shown once.

    Use your sandbox account (`T` prefix) while developing. Switch to production (`P` prefix) when you're ready to accept real payments.
  </Step>

  <Step title="Authenticate">
    Exchange your credentials for a bearer token using the OAuth 2.0 client credentials flow. The token is valid for 4 hours and is used in the `Authorization` header for all API calls.

    See [Authentication](/docs/checkout/checkout-client#authentication) for details.
  </Step>

  <Step title="Create a checkout session">
    Send a `POST` request to `/v1/sessions-profile` with the order details: items, amounts, currency, and URLs for the callback and customer redirect.

    The response returns a **session ID** and a **checkout URL** that you use to display the payment page.

    See [Create a session](/docs/checkout/create-session) for the full payload reference.
  </Step>

  <Step title="Display the checkout">
    Show the checkout to the customer. You have two options:

    * **Redirect**: send the customer to the Dintero-hosted checkout page. Minimal setup, no iframe.
    * **Embed**: render the checkout inside your page using the [Web SDK](https://github.com/Dintero/Dintero.Checkout.Web.SDK). More control over the experience.

    See [Embed vs redirect](/docs/checkout/embedVredirect) for a comparison.
  </Step>

  <Step title="Handle the payment result">
    After the customer pays, Dintero notifies you through two channels:

    | Channel           | How                                                   | Use for                              |
    | ----------------- | ----------------------------------------------------- | ------------------------------------ |
    | **callback\_url** | Server-to-server GET request (retried up to 20 times) | Verify payment and fulfill the order |
    | **return\_url**   | Customer browser redirect (not guaranteed)            | Show a confirmation page             |

    Always verify the transaction via the callback. The browser redirect can fail if the customer closes the tab.

    See [Handling payment](/docs/checkout/after-payment) for transaction statuses and handling.
  </Step>

  <Step title="Manage transactions">
    After authorization, you can **capture**, **void**, or **refund** transactions through the Transactions API. Most integrations capture when the order is shipped.

    See [Transaction management](/docs/checkout/transaction-management) for available operations and the [state diagram](/docs/checkout/transaction-state-diagram) for how transactions move between statuses.
  </Step>
</Steps>

## What's next

<CardGroup cols={2}>
  <Card title="Quickstart" icon="https://mintcdn.com/dintero-c3a7bfec/kqE6jEgPSu_iF1M_/mintlify-docs/assets/icons/sparkles.svg?fit=max&auto=format&n=kqE6jEgPSu_iF1M_&q=85&s=f70815f51d69bcb4775cb08102749416" href="/docs/checkout/quickstart" width="20" height="20" data-path="mintlify-docs/assets/icons/sparkles.svg">
    End-to-end walkthrough with code examples in cURL, Python, and Node.js.
  </Card>

  <Card title="Test data" icon="https://mintcdn.com/dintero-c3a7bfec/4vZVwDjf90sw6DuL/mintlify-docs/assets/icons/beaker.svg?fit=max&auto=format&n=4vZVwDjf90sw6DuL&q=85&s=db874f9401733fa9d84580b700b27ce9" href="/docs/checkout/checkout-testdata" width="20" height="20" data-path="mintlify-docs/assets/icons/beaker.svg">
    Test cards and sandbox scenarios for verifying your integration.
  </Card>

  <Card title="Payment profiles" icon="https://mintcdn.com/dintero-c3a7bfec/4vZVwDjf90sw6DuL/mintlify-docs/assets/icons/color-swatch.svg?fit=max&auto=format&n=4vZVwDjf90sw6DuL&q=85&s=e3876553ec28423612dbf1a2d52bfcf4" href="/docs/checkout/payment-profiles" width="20" height="20" data-path="mintlify-docs/assets/icons/color-swatch.svg">
    Configure which payment methods are shown in the checkout.
  </Card>

  <Card title="Webhooks" icon="https://mintcdn.com/dintero-c3a7bfec/4vZVwDjf90sw6DuL/mintlify-docs/assets/icons/bell.svg?fit=max&auto=format&n=4vZVwDjf90sw6DuL&q=85&s=800dae0e3e31fe9bde6ea804cf3d46ce" href="/docs/checkout/checkout-webhooks" width="20" height="20" data-path="mintlify-docs/assets/icons/bell.svg">
    Subscribe to real-time transaction events.
  </Card>
</CardGroup>
