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

# Collection - Standard Checkout

> Redirect customers to Payfonte hosted checkout using a server-side API request.

Standard checkout is a redirect flow:

1. Your backend creates a checkout session.
2. Payfonte returns a checkout URL.
3. You redirect the customer to that URL.
4. Customer completes payment and Payfonte notifies your system via webhook.

## Why Use Standard Checkout?

<CardGroup cols={3}>
  <Card title="Fastest Launch" icon="rocket">
    Minimal frontend complexity. Your backend creates a checkout and redirects users.
  </Card>

  <Card title="Hosted Experience" icon="window-maximize">
    Payfonte handles payment method UI and provider-specific interactions.
  </Card>

  <Card title="Reliable Status Updates" icon="bell">
    Use webhook events and transaction verification for final payment outcomes.
  </Card>
</CardGroup>

## Integration Steps

<Steps>
  <Step title="Collect payment details on your backend">
    Prepare required fields like `amount`, `currency`, `country`, and customer information.
  </Step>

  <Step title="Create checkout session">
    Send a request to `POST /payments/v1/checkouts` with your `client-id` and `client-secret`.
  </Step>

  <Step title="Redirect customer">
    Redirect users to `data.shortURL` (or `data.url`) from the response.
  </Step>

  <Step title="Confirm final status">
    Process webhook notifications and/or verify transaction status before order fulfillment.
  </Step>
</Steps>

## Create Checkout Request

```bash theme={null}
curl --location 'https://sandbox-api.payfonte.com/payments/v1/checkouts' \
  --header 'client-id: <client-id>' \
  --header 'client-secret: <client-secret>' \
  --header 'Content-Type: application/json' \
  --data '{
    "reference": "ORDER-1001",
    "amount": 50000,
    "currency": "NGN",
    "country": "NG",
    "redirectURL": "https://yourapp.com/payment/complete",
    "webhook": "https://yourapp.com/webhooks/payfonte",
    "user": {
      "email": "customer@example.com",
      "phoneNumber": "2348012345678",
      "name": "John Doe"
    }
  }'
```

Sample response:

```json theme={null}
{
  "data": {
    "url": "https://checkout-staging.payfonte.com/payfusion/66579afe04916ddcfcf73e7b",
    "shortURL": "https://l.6bd.co/XXXXX",
    "reference": "ORDER-1001",
    "amount": 50000
  }
}
```

## Parameter Reference

| Field         | Type    | Required    | Description                                    |
| ------------- | ------- | ----------- | ---------------------------------------------- |
| `reference`   | string  | Recommended | Unique transaction identifier from your system |
| `amount`      | integer | Yes         | Amount in minor units (no decimals)            |
| `currency`    | string  | Yes         | ISO currency code (for example `NGN`)          |
| `country`     | string  | Yes         | ISO country code (for example `NG`)            |
| `user`        | object  | Yes         | Customer object (email/phone/name fields)      |
| `redirectURL` | string  | No          | Customer return URL after checkout             |
| `webhook`     | string  | No          | Per-transaction webhook override URL           |
| `metadata`    | object  | No          | Custom fields for your internal tracking       |

## Amount Rule (Important)

Payfonte does not support decimal API amounts. Send integer minor-unit values only.

* `500.00 NGN` -> `50000`
* `1250.75 NGN` -> `125075`

See [Amount Specification](/en/guides/introductions/amount-specification) for full conversion rules.

## After Redirect and Payment

<AccordionGroup>
  <Accordion title="Customer redirect result" icon="link" defaultOpen>
    After checkout, customer is redirected to your `redirectURL` with transaction context such as `status` and `reference`.
  </Accordion>

  <Accordion title="Webhook notification" icon="bell">
    If webhooks are configured, Payfonte sends asynchronous status updates to your webhook endpoint.
  </Accordion>

  <Accordion title="Final state verification" icon="shield-check">
    For critical flows, verify transaction status from your backend before shipping goods or crediting wallets.
  </Accordion>

  <Accordion title="Failed payment handling" icon="triangle-exclamation">
    If payment fails, allow user retry and keep your order state pending until final success is confirmed.
  </Accordion>
</AccordionGroup>

## Production Best Practices

| Practice                        | Why It Matters                                          |
| ------------------------------- | ------------------------------------------------------- |
| Generate references server-side | Prevent duplicate references and improve reconciliation |
| Process webhook idempotently    | Avoid duplicate order fulfillment on retries            |
| Validate redirect parameters    | Protect against malformed/forged client-side values     |
| Use backend verification        | Ensure final status before business-critical actions    |

## Related Docs

<CardGroup cols={3}>
  <Card title="Inline Checkout" icon="window-maximize" href="/en/guides/collections/inline">
    Embedded checkout alternative for on-page payment.
  </Card>

  <Card title="Webhooks" icon="bell" href="/en/guides/collections/webhook">
    Set up and validate payment event callbacks.
  </Card>

  <Card title="API Reference" icon="file-code" href="/en/api-reference/introduction">
    Endpoint and schema details for checkout operations.
  </Card>
</CardGroup>
