API Reference Guide

Under this section you will find all API information that is used for processing payments.

Authentication

All Paykun APIs requires MerchantId & AccessToken headers to be present for authentication purpose, Same can be found from merchant dashboard. Some APIs also requires you to add a signature in the request body for the purpose of ensuring authenticity.

See How to generate Access Token & Encryption Key.

See How signature generation and verification work.

Get Transaction Status

GET https://api.paykun.com/v1/merchant/transaction/{transaction_id}

This endpoint allows you to get transaction status with many more details

Path Parameters

Headers

{
    "status": true,
    "data": {
        "message": "Record retrieved successfully",
        "transaction": {
            "payment_id": "88253-41453-72735-05390",
            "merchant_email": "merchantemail@gmail.com",
            "merchant_id": "01234567890123",
            "status": "Success",
            "status_flag": 1,
            "payment_mode": "WALLET",
            "order": {
                "order_id": "15707057419885",
                "product_name": "Product Name",
                "gross_amount": 11,
                "gateway_fee": 0.22,
                "tax": 0.04
            },
            "customer": {
                "name": "Customer Name",
                "email_id": "test@gmail.com",
                "mobile_no": "0213456789"
            },
            "shipping": {
                "address": null,
                "city": null,
                "state": null,
                "country": null,
                "pincode": null
            },
            "billing": {
                "address": null,
                "city": null,
                "state": null,
                "country": null,
                "pincode": null
            },
            "custom_field_1": null,
            "custom_field_2": null,
            "custom_field_3": null,
            "custom_field_4": null,
            "custom_field_5": null,
            "date": "1581769083",
            "signature": "e08bf1fcaf01d5fa4198de47d08a0158a9526b9e341e8a53bb8d3373b9268861f0bc0c363e60371e0f723558296f23ec43de8aceafd833498d2cf94bf8032b64"
        }
    }
}

Get Order Details

GET https://api.paykun.com/v1/merchant/orders/{order_id}

Retrieve transaction list using order id, as this may return multiple transactions you can provide filters to narrow down search results.

Path Parameters

Query Parameters

Headers

{
    "status": true,
    "data": {
        "message": "Record retrieved successfully",
        "total_orders": 1,
        "is_last": true,
        "current_item_count": 1,
        "current_page": 1,
        "last_page": 1,
        "orders": [
            {
                "req_id": "99850-39895-28080-59252",
                "product_name": "Membership Fee",
                "gross_amount": 1700,
                "status": "Success",
                "status_flag": 0,
                "customer_name": "Customer Name",
                "customer_email_id": "test@gmail.com",
                "customer_mo_no": "1234567890",
                "shipping_address": null,
                "shipping_city": null,
                "shipping_state": null,
                "shipping_country": null,
                "shipping_pincode": null,
                "billing_address": null,
                "billing_city": null,
                "billing_state": null,
                "billing_country": null,
                "billing_pincode": null,
                "order_id": "0000000030",
                "custom_field_1": null,
                "custom_field_2": null,
                "custom_field_3": null,
                "custom_field_4": null,
                "custom_field_5": null,
                "timestamp": "02/04/2019 10:40:35 AM",
                "timestamp_original": "2019-04-02 05:10:35"
            }
        ]
    }
}

Refund Transaction

POST https://api.paykun.com/v1/merchant/transaction/{transaction_id}/refund

Refund transaction using the transaction ID

Headers

Request Body

{
    "status": true,
    "data": {
        "message": "Your refund is successfully processed",
        "refund_ref_no": "68284-82388-16633-62514"
    }
}

POST https://api.paykun.com/v1/merchant/payment/link/create

Create payment link

Headers

Request Body

{
    "status": true,
    "data": {
        "message": "Payment link is created successfully",
        "payment_link_id": "WDAJyp1",
        "payment_link": "https://paykun.in/WDAJyp1"
    }
}

Last updated