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

# Collect via Checkout

> Create an invoice or order and checkout session in one API call from payer details.

Use `POST /v1/checkouts/create` when you do **not** want to manually create a party, counterparty, and invoice/order first. Dollr creates or matches the payer and returns `source_id`, `party_id`, and `counterparty_id` when applicable.

<Note>
  **API Reference:** [Create checkout source](/api-reference/checkouts/create-checkout-source)
</Note>

## When to use

* E-commerce checkout where payer details are known at cart time
* Faster prototyping than the [document-first Quick Start](/quickstart)
* [Hosted checkout](/guides/hosted-checkout) with `mode: "HOSTED"` — redirect to `url` for mobile money or card

For formal B2B invoicing with explicit publish control, prefer the [invoice flow](/guides/collect-with-nodejs).

## Hosted flow (recommended for most integrations)

<Steps>
  <Step title="Authenticate">
    See [Authentication](/authentication).
  </Step>

  <Step title="Create hosted checkout source">
    ```http theme={null}
    POST /v1/checkouts/create
    ```

    Set `mode: "HOSTED"`, `source_kind` (`INVOICE` or `ORDER`), payer details, `items[]`, and optional `success_url` / `cancel_url`.
  </Step>

  <Step title="Redirect customer">
    Send the customer to the `url` in the response. They pay with mobile money or card on Dollr's hosted page.
  </Step>

  <Step title="Confirm payment">
    `GET /v1/status/source?source_type=INVOICE&source_id={source_id}` or [Realtime status](/guides/realtime-status).
  </Step>
</Steps>

See [Hosted checkout](/guides/hosted-checkout) for full details.

## API-embedded flow

If you build your own payment UI:

<Steps>
  <Step title="Create checkout source">
    `POST /v1/checkouts/create` (any mode)
  </Step>

  <Step title="Checkout session → payment account → execute">
    `POST /v1/sessions/checkout`, register a [payment account](/api/payment-accounts), then `POST /v1/executions/collection` with a stored UUID `reference_id`.
  </Step>

  <Step title="Poll or subscribe">
    `GET /v1/status/collection/{reference_id}` or [Realtime status](/guides/realtime-status).
  </Step>
</Steps>

<Warning>
  Request body uses `source_kind`; session and execution calls use `source_type` for the same concept.
</Warning>

## Related

* [Hosted checkout](/guides/hosted-checkout) · [Collect with card](/guides/collect-with-card)
* [Checkouts API concept](/api/checkouts)
* [Choose your integration](/guides/choose-integration)
