---
title: "Start payment for an online payment method"
method: POST
path: "/checkout-payments/initiate"
tags: ["Checkout"]
---

# Start payment for an online payment method

`POST /checkout-payments/initiate`

## Request

- Base URL: `http://localhost:8000/api/shop`
- URL: `http://localhost:8000/api/shop/checkout-payments/initiate`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-shop-api/docs/checkout-payments/initiate/post.ts> (a function with typed inputs; its response is checked against the schema)

Call this instead of placing the order when the selected payment method is an online gateway (the place-order response then has `redirect: true`). Uses the cart of the Bearer token; addresses, shipping and payment method must already be saved. The response says how to hand the customer to the gateway: `redirect` (open `redirectUrl`: Stripe, PhonePe, PayGlocal), `form` (POST `formFields` to `formAction`: PayPal Standard, PayU) or `sdk` (open the gateway SDK with `sdkData`: Razorpay, PayPal Smart Button). PayPal Smart Button returns the PayPal `order_id` to hand to the PayPal JS SDK `createOrder` callback, with the `client_id` and `currency` to load the SDK with. Stripe, PhonePe, PayGlocal and PayU create the order on their own return. For Razorpay, PayPal Standard and PayPal Smart Button, call `POST /api/shop/checkout-payments/confirm` after payment.

## Headers

- `X-STOREFRONT-KEY` string, required
- `X-Locale` string
- `X-Channel` string
- `X-Currency` string

## Response `201`

What the client needs to start the payment.

## Other responses

- `400`: Invalid input
- `401`: No cart token.
- `422`: The cart is not ready, the method is not an online gateway, or the gateway rejected the request.

## Changes

- **2026-10-28** `b84d43839844`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bagisto/apis/bagisto-shop-api/changes/checkout-payments/initiate/post.md)

---

[API](https://skmtc.dev/bagisto/apis/bagisto-shop-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-shop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-shop-api/revisions/f619df36bf29?raw)
