Get Started
Invoice
Invoice Flow
Balance
Rate
Exchange
Transfer

Invoice

First, create an invoice and redirect the user to the payment page. After successful payment, if the webhook was set then the invoice information (trackid,invoice_number,status) will be immediately sent to the webhook and after that, the user will be redirected to your callback url with a trackid and invoice_number. After redirecting the user to your site, you must check the status of the invoice through the https://api.zipay.io/api/invoice-status method, and if "status" is "pending" call https://api.zipay.io/api/invoice-verify method to complete the invoice and if "status" is "completed" provide the service to the user.

* if you do not call verify method , invoice will be rejected after 30 mins.

Create Invoice

POST https://api.zipay.io/api/create-invoice

Name Type Mandatory Description
terminal_number integer yes If you don't have it, go to the panel and create gateway and get the terminal number.
amount float yes Amount of invoice 100.99
currency string yes One of USD , USDT and IRT
invoice_number string yes Use a unique invoice number per each gateway. The max length is 200.
national_id string no If you enter this, only users with this national ID can pay the invoice.
callback string yes http://example.org/back . trackid and invoice_number will be added to the end of this url . http://example.org/back?trackid=de7d44ae-9df9-487f-a175-ade1ecfab28b&invoice_number=1
webhook string no if you enter this , after successful payment trackid, invoice_number and status will be sent to webhook url via post method


Response:
{
    "result": {
        "trackid": "de7d44ae-9df9-487f-a175-ade1ecfab28b",
        "redirect": "http://api.zipay.io/invoice_v1/de7d44ae-9df9-487f-a175-ade1ecfab28b",
        "message": null
    },
    "success": true,
    "status": 200
}
    


Invoice Status

POST https://api.zipay.io/api/invoice-status

Name Type Mandatory Description
trackid string yes de7d44ae-9df9-487f-a175-ade1ecfab28b


Response:
{
    "result": {
        "trackid": "de7d44ae-9df9-487f-a175-ade1ecfab28b",
        "status": "pending",
        "amount": "100.99",
        "coin": {
            "name": "United States dollar",
            "currency": "USD",
            "symbol": "$"
        },
        "invoice_number": "1000",
         "time": 1680282113,
        "date": "31/03/2023 17:01 UTC",
        "pay_date": "31/03/2023 17:02 UTC",
        "datew3c": "2023-03-31T17:01:53+00:00",
        "pay_datew3c": "2023-03-31T17:02:08+00:00",
        "merchant_terminal_number": 1003,
        "invoice_transaction_id": 101,
        "national_id": "",
        "payer_firstname": "نام پرداخت کننده",
        "payer_lastname": "نام خانوادگی پرداخت کننده",
        "payer_email": "[email protected]",
        "payer_account_number": 10025
    },
    "success": true,
    "status": 200
}
    


Invoice Verify

POST https://api.zipay.io/api/invoice-verify
Call this method when invoice.status=pending to complete the invoice and add amount to you'r balance .
* if you do not call verify method , invoice will be rejected after 30 mins.

Name Type Mandatory Description
trackid string yes de7d44ae-9df9-487f-a175-ade1ecfab28b


Response:
{
    "result": {
        "trackid": "de7d44ae-9df9-487f-a175-ade1ecfab28b",
        "status": "completed",
        "amount": "100.99",
        "coin": {
            "name": "United States dollar",
            "currency": "USD",
            "symbol": "$"
        },
        "invoice_number": "1000",
         "time": 1680282113,
        "date": "31/03/2023 17:01 UTC",
        "pay_date": "31/03/2023 17:02 UTC",
        "datew3c": "2023-03-31T17:01:53+00:00",
        "pay_datew3c": "2023-03-31T17:02:08+00:00",
        "merchant_terminal_number": 1003,
        "invoice_transaction_id": 101,
        "national_id": "",
        "payer_firstname": "نام پرداخت کننده",
        "payer_lastname": "نام خانوادگی پرداخت کننده",
        "payer_email": "[email protected]",
        "payer_account_number": 10025
    },
    "success": true,
    "status": 200
}
    


Invoice List

POST https://api.zipay.io/api/invoice-list

Name Type Mandatory Description
terminal_number integer no
invoice_number string no
status string no refunded completed generated rejected pending waiting
limit integer no default is 10
page integer no default is 1
sort string no default is desc you can use asc


Response:
{
    "items": [
        {
            "trackid": "08985ab3-5937-40ff-bffa-f85c56256730",
            "status": "generated",
            "amount": "1",
            "coin": {
                "name": "United States dollar",
                "currency": "USD",
                "symbol": "$"
            },
            "invoice_number": "981",
            "time": 1680282307,
            "date": "31/03/2023 17:05 UTC",
            "pay_date": null,
            "datew3c": "2023-03-31T17:05:07+00:00",
            "pay_datew3c": null,
            "merchant_terminal_number": 1003,
            "invoice_transaction_id": 116,
            "national_id": "",
            "payer_firstname": "نام پرداخت کننده",
            "payer_lastname": "نام خانوادگی پرداخت کننده",
            "payer_email": null,
            "payer_account_number": null
        },
        {
            "trackid": "2ac211ad-29f5-4009-a811-2ec64d937065",
            "status": "completed",
            "amount": "1000",
            "coin": {
                "name": "United States dollar",
                "currency": "USD",
                "symbol": "$"
            },
            "invoice_number": "10131",
            "time": 1680282113,
            "date": "31/03/2023 17:01 UTC",
            "pay_date": "31/03/2023 17:02 UTC",
            "datew3c": "2023-03-31T17:01:53+00:00",
            "pay_datew3c": "2023-03-31T17:02:08+00:00",
            "merchant_terminal_number": 1003,
            "invoice_transaction_id": 115,
            "national_id": "",
            "payer_firstname": "نام پرداخت کننده",
            "payer_lastname": "نام خانوادگی پرداخت کننده",
            "payer_email": "[email protected]",
            "payer_account_number": 10025
        },
        {
            "trackid": "abfab42c-2364-4b84-b709-3f7a8969ec2c",
            "status": "rejected",
            "amount": "1000",
            "coin": {
                "name": "United States dollar",
                "currency": "USD",
                "symbol": "$"
            },
            "invoice_number": "10031",
            "time": 1680281790,
            "date": "31/03/2023 16:56 UTC",
            "pay_date": "31/03/2023 16:56 UTC",
            "datew3c": "2023-03-31T16:56:30+00:00",
            "pay_datew3c": "2023-03-31T16:56:41+00:00",
            "merchant_terminal_number": 1003,
            "invoice_transaction_id": 114,
            "national_id": "",
            "payer_firstname": "نام پرداخت کننده",
            "payer_lastname": "نام خانوادگی پرداخت کننده",
            "payer_email": "[email protected]",
            "payer_account_number": 10025
        }
    ],
    "total": 9,
    "limit": 3,
    "page": 1,
    "sort": "desc",
    "success": true,
    "status": 200
}
    


Invoice refund

POST https://api.zipay.io/api/invoice-refund

Name Type Mandatory Description
trackid string yes 12a2c8ec-249a-43bb-a161-a7658981c110


Response:
{
    "result": {
        "trackid": "12a2c8ec-249a-43bb-a161-a7658981c110",
        "status": "refunded",
        "amount": "1",
        "coin": {
            "name": "United States dollar",
            "currency": "USD",
            "symbol": "$"
        },
        "invoice_number": "20",
        "time": 1680281790,
        "date": "31/03/2023 16:56 UTC",
        "pay_date": "31/03/2023 16:56 UTC",
        "datew3c": "2023-03-31T16:56:30+00:00",
        "pay_datew3c": "2023-03-31T16:56:41+00:00",
        "merchant_terminal_number": 1003,
        "invoice_transaction_id": 70,
        "national_id": "",
        "payer_firstname": "نام پرداخت کننده",
        "payer_lastname": "نام خانوادگی پرداخت کننده",
        "payer_email": "[email protected]",
        "payer_account_number": 10025
    },
    "success": true,
    "status": 200
}