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

# Payment session

> Understand the recommendedGateway.session object, how checkout details differ across gateways, and how to send your customer to checkout for each one.

When you initiate a payment, Archefusion returns the checkout details inside `recommendedGateway.session`. This is the object you read to send your customer to the gateway's checkout page.

## Reading the session

For redirect-based gateways (Paystack, Flutterwave, Monnify, Korapay), the `session` object shares these common fields:

* `gateway`: the gateway that produced the session
* `reference`: the gateway's transaction reference
* `redirectUrl`: the checkout URL to send the customer to
* `raw`: the raw response data from the underlying gateway

**What to do with the response:**

1. Send the customer to `recommendedGateway.session.redirectUrl` to complete checkout. This works for Paystack, Flutterwave, Monnify, and Korapay.
2. Store `paymentId`. You will need it to [check status](https://docs.archefusion.com/pages/api-reference/get-payment) or [verify the payment](https://docs.archefusion.com/pages/accept-payments#verify-transaction) through Archefusion's APIs.

<Warning>
  **Interswitch is the exception.** Its `redirectUrl` is a POST form action, not a link you redirect the customer to. Submit `session.formFields` to `session.redirectUrl` as a POST request using `session.method`. Redirecting a customer to it with a plain GET will fail.
</Warning>

## Gateway session examples

The `session` object varies by gateway. Expand each gateway below to see the shape of its `session` object. The `raw` field is trimmed here for brevity.

<AccordionGroup>
  <Accordion title="Paystack">
    ```json theme={null}
    {
      "gateway": "paystack",
      "reference": "668aca23-9ed2-4f10-a985-2636c5624a0b",
      "redirectUrl": "https://checkout.paystack.com/8t7sxqvgn023yc5",
      "accessCode": "8t7sxqvgn023yc5",
      "metadata": {
        "mode": "test",
        "paymentId": "668aca23-9ed2-4f10-a985-2636c5624a0b",
        "merchantId": "...",
        "merchantOrderId": "order-70-0o8hh-ojy78j0e-8i903-pl679-e07"
      },
      "raw": {
        "reference": "...",
        "access_code": "...",
        "authorization_url": "https://checkout.paystack.com/..."
      }
    }
    ```

    Redirect the customer to `redirectUrl` to complete checkout.
  </Accordion>

  <Accordion title="Flutterwave">
    ```json theme={null}
    {
      "gateway": "flutterwave",
      "reference": "148dddaf-b67b-4914-8873-cd037dd9cfee",
      "redirectUrl": "https://checkout.flutterwave.com/v3/hosted/pay/...",
      "meta": {
        "mode": "test",
        "paymentId": "148dddaf-b67b-4914-8873-cd037dd9cfee",
        "merchantId": "...",
        "merchantOrderId": "order-0940e-8i903-pl679-e07-6y89-8u09"
      },
      "raw": {
        "link": "https://checkout.flutterwave.com/v3/hosted/pay/..."
      }
    }
    ```

    Redirect the customer to `redirectUrl` to complete checkout.
  </Accordion>

  <Accordion title="Monnify">
    ```json theme={null}
    {
      "gateway": "monnify",
      "reference": "MNFY|38|20260724005133|008154",
      "redirectUrl": "https://sdk.monnify.com/checkout/MNFY|38|20260724005133|008154",
      "paymentReference": "UBER_MONI__e31934fc-68c7-4f8f-a1ad-9ccd518e3768",
      "transactionReference": "MNFY|38|20260724005133|008154",
      "transfer": {
        "bankDetails": null
      },
      "metaData": {
        "mode": "test",
        "paymentId": "e31934fc-68c7-4f8f-a1ad-9ccd518e3768",
        "merchantId": "...",
        "merchantOrderId": "Order-2eryr7ui-56yc56-ry67-op0978p-901"
      },
      "raw": {
        "checkoutUrl": "https://sdk.monnify.com/checkout/MNFY|...",
        "merchantName": "ArcheFusion LTD",
        "enabledPaymentMethod": ["ACCOUNT_TRANSFER"],
        "transactionReference": "MNFY|..."
      }
    }
    ```

    Redirect the customer to `redirectUrl` to complete checkout.

    <Note>
      Monnify's checkout URL contains pipe (`|`) characters. Browsers accept these directly, so you can use `redirectUrl` as-is. If your HTTP stack requires strictly valid URLs, encode the pipes as `%7C`.
    </Note>
  </Accordion>

  <Accordion title="Korapay">
    ```json theme={null}
    {
      "gateway": "korapay",
      "reference": "UBR_KORA1_1536fb45-1162-48ff-990b-c859183602bc",
      "redirectUrl": "https://checkout.korapay.com/KPY-PI-...pay",
      "metadata": {
        "mode": "test",
        "source": "archefusion",
        "paymentId": "1536fb45-1162-48ff-990b-c859183602bc",
        "merchantId": "..."
      },
      "raw": {
        "reference": "UBR_KORA1_...",
        "checkout_url": "https://checkout.korapay.com/KPY-PI-...pay"
      }
    }
    ```

    Redirect the customer to `redirectUrl` to complete checkout.
  </Accordion>

  <Accordion title="Interswitch WebPAY">
    ```json theme={null}
    {
      "gateway": "interswitch_webpay",
      "reference": "UB_INTER_910a35a71b48edf847b9bfa",
      "method": "POST",
      "redirectUrl": "https://newwebpay.interswitchng.com/collections/w/pay",
      "formFields": {
        "mode": "test",
        "amount": 10000,
        "cust_id": "1de7fe08-0cd3-4bab-9054-d37690306a10",
        "txn_ref": "UB_INTER_910a35a71b48edf847b9bfa",
        "currency": "566",
        "cust_name": "customer@gmail.com",
        "cust_email": "customer@gmail.com",
        "pay_item_id": "Default_Payable_MX167820",
        "merchant_code": "MX167820",
        "pay_item_name": "archefusion_txn_1784847963466",
        "site_redirect_url": "https://app.archefusion.com"
      }
    }
    ```

    Interswitch does not follow the redirect pattern. Its `redirectUrl` is a POST form action. Submit the fields in `formFields` to `redirectUrl` as a POST request using `method`, rather than sending the customer there with a plain GET redirect.
  </Accordion>
</AccordionGroup>
