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

# Callbacks

> Receive checkout payment status notifications from Bpay.

After a customer completes (or fails) a checkout payment, Bpay POSTs the payment status to your configured callback URL.

See [Receive checkout payment callback](/api-reference/payments-checkout/receive-checkout-payment-callback) for the interactive API reference with request and response schemas.

***

## Callback flow

```text theme={null}
Customer completes payment on checkout page
        │
        ▼
Bpay processes the transaction
        │
        │ HTTP POST (JSON)
        ▼
Your callback URL
        │
        ▼
Your server returns HTTP 200 acknowledgement
```

***

## Sample implementations

<Tabs>
  <Tab title="Node.js">
    ```javascript theme={null}
    const express = require("express");
    const app = express();

    app.use(express.urlencoded({ extended: false }));
    app.use(express.json());

    app.post("/", (req, res) => {
      const { amount, referenceNumber, status, timestamp, transactionID, msisdn } = req.body;

      // Your logic here

      return res.json({
        amount,
        status: status === "success",
        referenceNumber,
        statusMessage: "Payment was successful!",
        transactionID,
      });
    });

    app.listen(7000, () => console.log("app running on port 7000"));
    ```
  </Tab>

  <Tab title="PHP">
    ```php theme={null}
    <?php
    $data = file_get_contents('php://input');
    $data = json_decode($data, true);

    $amount = $data['amount'];
    $referenceNumber = $data['referenceNumber'];
    $status = $data['status'];
    $transactionID = $data['transactionID'];

    // Your logic here

    $res = [
      'amount' => $amount,
      'status' => $status === 'success',
      'referenceNumber' => $referenceNumber,
      'statusMessage' => 'Payment was successful!',
      'transactionID' => $transactionID,
    ];

    echo json_encode($res);
    ?>
    ```
  </Tab>

  <Tab title="GitHub">
    [beem-pay-checkout-api-sample — callback](https://github.com/beemafrica/beem-pay-checkout-api-sample/tree/master/callback)
  </Tab>
</Tabs>
