Documentation/API Reference/Charges

Charges

Create and manage payments.

POST
/v1/checkout

Creates a new payment session and returns a checkout URL.

Body Parameters

amountnumberRequired

Amount in paisa (wait, usually API takes normal currency, let's assume standard unit based on implementation, e.g. NPR 100). Implementation uses standard unit.

currencystringRequired

Three-letter ISO currency code, e.g. NPR.

providerstringRequired

Payment provider to use. Either esewa or khalti.

returnUrlstringRequired

The URL to redirect the user to after payment completion.

Request
{
  "amount": 1000,
  "currency": "NPR",
  "provider": "esewa",
  "returnUrl": "https://example.com/return"
}
Response
{
  "id": "pay_123456789",
  "checkout_url": "https://payark.com/checkout/pay_...",
  "payment_method": {
    "type": "esewa"
  }
}
GET
/v1/payments

Returns a list of payments.

Query Parameters

limitnumber

A limit on the number of objects to be returned. Limit can range between 1 and 100.

Response
{
  "data": [
    {
      "id": "pay_...",
      "amount": 1000,
      "status": "success",
      "created_at": "2024..."
    }
  ],
  "meta": {
    "total": 10,
    "limit": 10,
    "offset": 0
  }
}