# Checkout - flow

The **Standard Checkout** integration allows you to generate a unique, secure payment URL that your customers can use to complete their transactions on the Vesicash-hosted payment page. This is the quickest and simplest way to start accepting payments with minimal backend implementation.

1. **Initialize the Payment**: Make a server-side POST request to the payment initialization endpoint:
2. **Redirect the Customer**: Upon a successful request, we’ll return a unique link for the payment page. Redirect your customer to this page to complete their payment.
3. **After the Payment**: Once the payment is completed, the customer will be redirected back to your provided redirectUrl. You can use this event to confirm the transaction and update your records.

**Step 1: Initialize the Payment**

Send a server‑side POST request to the payment initialization endpoint.

#### <mark style="color:green;">POST:</mark> /v1/payment/init

#### Headers

| Name       | Type   | Description              |
| ---------- | ------ | ------------------------ |
| secret-key | string | Your Vesicash secret key |
| public-key | string | Your Vesicash public key |

#### Request body

* currency (string): The currency for the payment.
* country (string): The country for the payment.
* reference (string, optional): The transaction reference. If not provided, a value will be generated internally. The reference must be at least 10 characters long.
* narration (string): Description or reason for the payment.
* method (string): The payment method to be used.
* amount (number): The amount of the payment.
* webhook\_url (string): A URL where notifications about the payment status will be sent.
* redirect\_url (sting):

#### Request

For example, you can make a post request to the endpoint above and pass in the raw json data below to create a one-off transaction.

```
{
"currency": "ZMW",
    "country": "ZM",
    "narration": "payment for rice",
    "reference": "***********"
    "method": "mobilemoney", //"card"
    "amount": 1.3,
    "webhook_url: "",
    "redirect_url": "",
}
```

#### Step 2: Redirect the Customer&#xD;

Upon a successful request, we’ll return a paymentLink for the payment page. Redirect the customer to this URL in your browser or mobile app.

#### Response

```
{
    "status": "success",
    "code": 200,
    "message": "success",
    "data": {
        "payment_link": "",
        "reference": "",
        "payment_id": "",
        "status": "pending"
    }
}
```

**Step 3: After the Payment**

Once the customer completes the payment on the Vesicash checkout page:

1. **Customer Redirect**: The customer is redirected to the redirectUrl you provided in the initialization request.
2. **Query Payment Status**: Your server should call the Payment Status endpoint to confirm the final state of the transaction (e.g., success, failed, pending).
3. **Receive Webhook Notification**: Vesicash automatically sends webhook notifications to your configured URL whenever a transaction status changes, provided your webhook secret is properly generated and verified.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vesicash.com/api-documentation/payments/mobile-money/checkout-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
