# Build. Integrate. Scale.

<button type="button" class="button primary" data-action="ask" data-icon="gitbook-assistant">Ask a question...</button>

<button type="button" class="button secondary" data-action="ask" data-query="How do I get started?" data-icon="rocket-launch">Get started</button><button type="button" class="button secondary" data-action="ask" data-query="How do I authenticate with the developer platform?" data-icon="key">Authenticate</button><button type="button" class="button secondary" data-action="ask" data-query="How do I integrate with my stack?" data-icon="code">Integrate</button><button type="button" class="button secondary" data-action="ask" data-query="How do I contribute?" data-icon="code-pull-request">Contribute</button>

&#x20;

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><h4><i class="fa-leaf" style="color:$primary;">:leaf:</i></h4></td><td>Payment Gateway</td><td>Accept and process online payments seamlessly.</td><td><a href="/spaces/yE16Xb3IemPxJWydtPOj">/spaces/yE16Xb3IemPxJWydtPOj</a></td><td><a href="/files/LHIOZGoI6dPF36TuRaxH">/files/LHIOZGoI6dPF36TuRaxH</a></td></tr><tr><td><h4><i class="fa-server" style="color:$primary;">:server:</i></h4></td><td>Payout API</td><td>Transfer funds instantly to bank accounts &#x26; UPI.</td><td><a href="/spaces/yE16Xb3IemPxJWydtPOj">/spaces/yE16Xb3IemPxJWydtPOj</a></td><td><a href="/files/IaUMODRBBSBL8eUaPX09">/files/IaUMODRBBSBL8eUaPX09</a></td></tr><tr><td><h4><i class="fa-terminal" style="color:$primary;">:terminal:</i></h4></td><td>Banking APIs</td><td>Build fintech products with powerful banking infrastructure.</td><td><a href="/spaces/M9ty6FYa3j98VSBHF9LN">/spaces/M9ty6FYa3j98VSBHF9LN</a></td><td><a href="/files/ebMoLMpZFyLqpzByuzrk">/files/ebMoLMpZFyLqpzByuzrk</a></td></tr></tbody></table>

&#x20;

&#x20;

{% columns %}
{% column width="50%" %}

## Get Started with KwikPaisa

Launch payments, payouts, and banking APIs in minutes.

Create your account, generate API keys, and make your first live API request using simple integration examples for every major tech stack.

{% hint style="warning" icon="life-ring" %}
**Need some help?**

Troubleshoot common issues or ask for help.

<details>

<summary>I get a 401 Unauthorized error</summary>

This usually happens when the request signature is invalid or required authentication headers are missing.

#### Verify the following:

* `x-client-id` is correct
* `x-signature` is generated properly
* `x-timestamp` is a valid UNIX timestamp
* Your API secret key is correct
* Request body matches the exact payload used during signature generation

</details>

<details>

<summary>KwikPaisa Signature Formula</summary>

HMAC\_SHA256(payload + timestamp, secret\_key)

#### Important Rules

* Payload keys must be recursively sorted
* JSON must use unescaped slashes
* Signature must be generated using the exact request payload

</details>

<details>

<summary>I get a 400 Bad Request error</summary>

This means one or more required request fields are missing or invalid.

#### Common Reasons

* Invalid amount format
* Missing `order_id`
* Invalid UPI ID or bank details
* Empty request body
* Invalid JSON structure

#### Example

For Create Order API:

* `amount`
* `customer_mobile`
* `order_id`

must be passed correctly.

Also ensure:

* `Content-Type: application/json`
* Valid request payload format

</details>

<details>

<summary>My payment or payout stays in processing</summary>

Transactions may remain in processing state while awaiting confirmation from banking or UPI networks.

#### Recommended Action

* Use Order Status API for payments
* Use Payout Status API for payouts
* Avoid creating duplicate requests for the same transaction

#### Payment APIs

* Create Order
* Order Status
* Order Cancel

#### Payout APIs

* Balance Inquiry
* Transaction Initiation
* Payout Status

</details>

<details>

<summary>The request succeeds, but the response is not what I expect</summary>

This usually happens due to:

* Incorrect environment usage
* Wrong webhook handling
* Duplicate order IDs
* Invalid payout mode
* Incorrect callback parsing

#### Verify:

* You are using the correct API endpoint
* Request payload matches API documentation
* Webhook responses are being parsed correctly
* Transaction status is checked using status APIs

#### Recommended

Always rely on:

* Order Status API
* Payout Status API

instead of frontend callback responses.

</details>

<details>

<summary>My webhook is not working</summary>

#### Verify the following:

* Webhook URL is publicly accessible
* Your server returns HTTP `200 OK`
* SSL certificate is valid
* Firewall is not blocking requests

#### Important

KwikPaisa automatically retries failed webhook deliveries.

Ensure your webhook:

* accepts POST requests
* processes JSON payloads
* responds quickly

</details>

<details>

<summary>My signature works locally but fails on server</summary>

This is usually caused by payload formatting differences.

#### Ensure:

* Payload sorting is identical
* JSON encoding is consistent
* Timestamp is generated in seconds
* No extra spaces or formatting changes exist

#### Correct Signature Logic

```
signature = HMAC_SHA256(payload + timestamp, secret_key)
```

{% file src="/files/R87geOSlo8c4TtoszIdL" %}

</details>

<details>

<summary>I get insufficient balance errors during payouts</summary>

Your payout wallet balance may be low.

#### Before initiating payouts:

* Check available balance using Balance Inquiry API
* Ensure sufficient wallet balance exists
* Verify payout limits configured for your account

</details>

<details>

<summary>Duplicate transaction detected</summary>

KwikPaisa blocks duplicate transaction attempts for security and reconciliation purposes.

#### Best Practices

* Always use unique `order_id`
* Avoid retrying instantly
* Use status APIs before retrying failed transactions

</details>

<details>

<summary>Which APIs should I use for transaction verification?</summary>

For reliable transaction verification:

#### Payments

Use:

* Order Status API

#### Payouts

Use:

* Payout Status API

Avoid relying only on:

* frontend redirects
* user-side success screens
* temporary processing responses

</details>
{% endhint %}

With your first integration complete, explore our API guides and references to build payments, payouts, and banking workflows with KwikPaisa.

<a href="/spaces/yE16Xb3IemPxJWydtPOj/pages/PbYb0GukRhiS4qCHdRal" class="button primary" data-icon="rocket-launch">Get started</a> <a href="/spaces/M9ty6FYa3j98VSBHF9LN" class="button secondary" data-icon="terminal">API reference</a>

&#x20;

&#x20;
{% endcolumn %}

{% column width="50%" %}
{% stepper %}
{% step %}

#### Create Your Merchant Account

Sign up and generate your API credentials to start integrating KwikPaisa APIs.

<a href="https://dashboard.kwikpaisa.com/register" class="button primary">Sign up</a><a href="https://dashboard.kwikpaisa.com/login" class="button secondary">Log in</a>
{% endstep %}

{% step %}

#### Make Your First API Request

Connect with KwikPaisa APIs using secure authentication and signature-based requests.

```
Endpoint:
POST {baseUrl}/api/v3/pg/order/create
```

{% tabs %}
{% tab title="JavaScript" %}
{% code overflow="wrap" %}

```javascript
const crypto = require('crypto');
const payload = {
  amount: "100.00",
  order_id: "ORD123456"
};
const timestamp = Math.floor(Date.now() / 1000);
const signature = crypto
  .createHmac('sha256', 'YOUR_SECRET_KEY')
  .update(JSON.stringify(payload) + timestamp)
  .digest('hex');
console.log(signature);
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code overflow="wrap" %}

```python
import json
import hmac
import hashlib
import time
payload = {
    "amount": "100.00",
    "order_id": "ORD123456"
}
# Sort payload keys
sorted_payload = dict(sorted(payload.items()))
# Convert to JSON
payload_json = json.dumps(
    sorted_payload,
    separators=(',', ':')
)
# Generate timestamp
timestamp = str(int(time.time()))
# Generate signature
signature = hmac.new(
    b'YOUR_SECRET_KEY',
    (payload_json + timestamp).encode(),
    hashlib.sha256
).hexdigest()
print(signature)
```

{% endcode %}
{% endtab %}

{% tab title="cURL" %}
{% code overflow="wrap" %}

```bash
curl --request POST \
  --url {baseUrl}/api/v3/pg/order/create \
  --header "Content-Type: application/json" \
  --header "x-client-id: YOUR_CLIENT_ID" \
  --header "x-timestamp: 1716206400" \
  --header "x-signature: GENERATED_SIGNATURE" \
  --data '{
    "amount": "100.00",
    "order_id": "ORD123456",
    "customer_mobile": "9999999999"
}'
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code overflow="wrap" expandable="true" %}

```go
package main
import (
	"crypto/hmac"
	"crypto/sha256"
	"encoding/hex"
	"encoding/json"
	"fmt"
	"time"
)
func main() {
	payload := map[string]string{
		"amount":   "100.00",
		"order_id": "ORD123456",
	}
	payloadJSON, _ := json.Marshal(payload)
	timestamp := fmt.Sprintf("%d", time.Now().Unix())
	message := string(payloadJSON) + timestamp
	secretKey := "YOUR_SECRET_KEY"
	h := hmac.New(sha256.New, []byte(secretKey))
	h.Write([]byte(message))
	signature := hex.EncodeToString(h.Sum(nil))
	fmt.Println(signature)
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

#### Parse the Response

If the request is successful, KwikPaisa APIs return a response like this:

{% code title="response.json" overflow="wrap" %}

```json
{
  "code": "200",
  "status": "success",
  "message": "API authentication successful!",
  "return_data": {
    "kwikX_order_id": "kp_40dec464-7155-43a3-855d-c95c5ab1be71",
    "created_at": "13-05-2026 08:34 AM",
    "order_id": 3501946751751,
    "order_status": "UN_PAID",
    "payment_link": "http://orchestration.localhost/payment/sandbox/pay_TSN7ASUDmzcZNyH8qLeG8PrR4CWB9pwFQOuDPYia0fd5k2fMzN"
  }
}

```

{% endcode %}
{% endstep %}
{% endstepper %}
{% endcolumn %}
{% endcolumns %}

&#x20;

&#x20;

{% columns %}
{% column width="50%" %}

<figure><img src="https://gitbookio.github.io/onboarding-template-images/placeholder.png" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column width="50%" valign="middle" %}

## Explore the KwikPaisa Developer Platform

Access integration guides, API references, webhook documentation, and SDK examples to build secure payment and banking experiences with KwikPaisa.

<a href="/spaces/XzoKToaHFf2XFT1UP1j7" class="button primary" data-icon="book-open">API Guides</a> <a href="/spaces/V2VaiUpMgerAqv8xO5Og" class="button secondary" data-icon="book">API Reference</a>
{% endcolumn %}
{% endcolumns %}

&#x20;

&#x20;

<h2 align="center">Need Integration Support?</h2>

<p align="center">Get help with API integration, webhooks, payouts, and onboarding from the KwikPaisa technical team.</p>

<p align="center"><a class="button primary">Contact Support</a><a class="button secondary">API Status</a></p>

&#x20;


---

# 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://developers.kwikpaisa.com/readme.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.
