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

# Initiate Payment

> Create a new payment transaction

Initiates a new payment transaction.

## Endpoint

`POST https://quickei.io/pay/sandbox/api/v1/payment/create`

## Parameters

<ParamField body="amount" type="decimal" required>
  Amount to charge, rounded to 2 decimal places
</ParamField>

<ParamField body="currency" type="string" required>
  Currency code in uppercase (ISO 4217 Alpha-3)
</ParamField>

<ParamField body="return_url" type="string" required>
  Your return/success URL
</ParamField>

<ParamField body="cancel_url" type="string">
  Your cancel/failure URL
</ParamField>

<ParamField body="product_name" type="string" required>
  Product name or short description
</ParamField>

<ParamField body="order_number" type="string" required>
  Your internal order reference
</ParamField>

<ParamField body="custom" type="string">
  Custom transaction ID for your records
</ParamField>

## Request Example — Guzzle (PHP)

```php theme={null}
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST',
  'https://quickei.io/pay/sandbox/api/v1/payment/create', [
  'json' => [
    'amount'       => '100.00',
    'currency'     => 'USD',
    'return_url'   => 'https://yoursite.com/success',
    'cancel_url'   => 'https://yoursite.com/cancel',
    'product_name' => 'MacBook Air',
    'order_number' => 'ORD-2024-001234',
    'custom'       => '123456789ABCD',
  ],
  'headers' => [
    'Authorization' => 'Bearer {{access_token}}',
    'accept'        => 'application/json',
    'content-type'  => 'application/json',
  ],
]);
echo $response->getBody();
```

## Response — 200 OK

```json theme={null}
{
  "message": {
    "code": 200,
    "success": ["CREATED"]
  },
  "data": {
    "token": "2zMRmT3KeYT2BWMAyGhq...",
    "payment_url": "https://quickei.io/pay/..."
  },
  "type": "success"
}
```

## Error Response — 403 FAILED

```json theme={null}
{
  "message": {
    "code": 403,
    "error": ["Requested with invalid token!"]
  },
  "data": [],
  "type": "error"
}
```
