Navbar
Curl Python PHP
  • Introduction
  • Authentication
  • Getting your API key
  • Responses
  • Payment Order
  • Payout order
  • Rate Endpoint
  • Checkout API
  • Introduction

    API EndPoint

    EndPoint: https://api.dizpay.com/v2/
    

    DizPay is a blockchain payment processor which provides you a simple and powerful RESTful API to integrate cryptocurrency payments into your website. Currently, DizPay supports payments of Bitcoin (BTC), Ethereum (ETH), Litecoin (LTC), DASH, Tether (USDT), Gemini Dollar (GUSD), Paxos (PAX), TrueUSD (TUSD), and USD Coin (USDC).

    This API reference provides detailed information on getting started with the DizPay API and using the provided endpoints to integrate the DizPay API into your application.

    Authentication

    Original API request JSON data:

    {
      "app_id": "dp9vC69mdA3QG2VPRe",
      "number": "8eb9bc53-75ea-4142-8a91-af89d2246379",
      "address": "1DLVkXuZrSVhw9Ymm72csp99A8wufe76F8",
      "to_address": "1DLVkXuZrSVhw9Ymm72csp99A8wufe76F8",
      "amount": "1",
      "fee": "0.002"
    }
    

    After adding app_key:

    {
      "app_id": "dp9vC69mdA3QG2VPRe",
      "app_key": "e145d582c31928ca103d262b200e882d",
      "number": "8eb9bc53-75ea-4142-8a91-af89d2246379",
      "address": "1DLVkXuZrSVhw9Ymm72csp99A8wufe76F8",
      "to_address": "1DLVkXuZrSVhw9Ymm72csp99A8wufe76F8",
      "amount": "1",
      "fee": "0.002"
    }
    

    Conversion to a single string:

    address=1DLVkXuZrSVhw9Ymm72csp99A8wufe76F8&amount=1&app_id=dp9vC69mdA3Q
     G2VPRe&app_key=e145d582c31928ca103d262b200e882d&fee=0.002&number=8eb9bc
     53-75ea-4142-8a91-af89d2246379&to_address=1DLVkXuZrSVhw9Ymm72csp99A8wuf
     e76F8
    

    MD5 signature from the string: f433acfea90730724f8261fdb0d502e1

    Remove app_key and add signature:

    {
      "app_id": "dp9vC69mdA3QG2VPRe",
      "number": "8eb9bc53-75ea-4142-8a91-af89d2246379",
      "address": "1DLVkXuZrSVhw9Ymm72csp99A8wufe76F8",
      "to_address": "1DLVkXuZrSVhw9Ymm72csp99A8wufe76F8",
      "amount": "1",
      "fee": "0.002",
      "signature": "f433acfea90730724f8261fdb0d502e1"
    }
    

    You need to sign all the API requests you send to the DizPay server. To sign a request, follow the instructions below:

    1. Create JSON data for the API request.

    2. Add your app_key to the request as an extra parameter.

    3. Sort the keys alphabetically and combine all the key-value pairs into a single string. Separate the key-value pairs with &.

    4. Calculate the MD5 value for the combined string.

    5. Remove the app_key from your JSON data.

    6. Add a new key signature with the calculated MD5 value.

    7. Send the final request to the provided endpoint.

    Note: For your account safety, NEVER put your app_key in the final request.

    To get your API Key, refer to Getting your API Key

    Getting your API key

    To get your API key, you first need to register yourself as a merchant on our website.

    Follow the instructions below to get your API key:

    1. Register a merchant account from our registration page.
    2. Log into the merchant console.
    3. Go to the APP KEY menu in the merchant console.
    4. Note down the App ID and App key.

    NEVER reveal your app key to anyone.

    To get details about the minimum recharge amount, minimum withdrawal amount, and the miner fees for your currency, visit our pricing page.

    Responses

    The DizPay API provides responses in the JSON format. Each response contains a status code and the requested data.

    Status Codes

    Currently, the DizPay API returns the following status codes:

    Status Code Status Description
    200 OK Request succeeded
    400 Bad Request Request failed. Check the Error code in the response for further details
    401 Unauthorized The app_id is invalid or blocked
    403 Forbidden Signing failure
    500 Internal Server Error An internal error occurred in the server

    Errors

    Error code examples

    {
        "code": 1000,
        "message": {
            "id": "required",
            "password": "required"
        }
    }
    
    {
        "code": 1001,
        "message": {
            "merchant_id": "merchant does not exist"
        }
    }
    
    {
        "code": 1002,
        "message": {
            "password": "password does not match"
        }
    }
    
    {
        "code": 1003,
        "message": {
            "amount": "amount <= 0"
        }
    }
    
    
    {
        "code": 1004,
        "message": { }
    }
    
    {
        "code": 1005,
        "message": {
            "pin_code": "try too many times"
        }
    }
    
    {
        "code": 1006,
        "message": {
            "pin_code": "pin code is expired"
        }
    }
    
    {
      "code": 1008,
      "message":
      {
        "balance": "current balance < 10"
      }
    }
    
    {
        "code": 1010,
        "message": { }
    }
    
    
    {
        "code": 1051,
        "message": {
            "error": {
                "message": "Invalid address",
                "code": -5
            }
        }
    }
    
    Error Code Description
    1000 Field Syntax Error (e.g. Required, Range, Type)
    1001 Entity does not exist
    1002 Entity does not match
    1003 Invalid value
    1004 SMS failed
    1005 Requests sent too frequently
    1006 Entity has expired
    1008 Not enough balance
    1010 Email failed
    1051 Error with the wallet server

    Rate limiting

    DizPay limits the amount of API requests you can send per minute to our servers. This is done to prevent continuous API requests which can limit our ability to maintain consistent service to all our users.

    Currently, we only allow x requests per minute to each user. If you send more requests than the specified limit, the server returns 1005 error code.

    Payment Order

    Create a payment(recharge) order to handle payment from the outside. The received amount is added onto your merchant address.

    If the incoming amount is greater than or equal to your pre-set target amount, the configured notify_url is called to notify you of the transaction.

    Create payment order

    Example Request

      curl https://api.dizpay.com/v2/member/orders/create_charge_order \
        -X POST \
        -H 'Content-Type: application/json' \
        -d '{"app_id":"dpb96h2KfR4GYTAyqn","signature":"9fed973581219861b689ee16dcfe3acd","number":"53f9bc56-337e-4a2b-9c74-1432752648d8","currency_code":"ETH","erc20_token":0,"amount":"10","extra":"","notify_url":"example.dizpay.com"}'
    
      import requests
    
      r = requests.post('https://api.dizpay.com/v2/member/orders/create_charge_order', json={
        "app_id":"dpb96h2KfR4GYTAyqn",
        "signature":"9fed973581219861b689ee16dcfe3acd",
        "number":"53f9bc56-337e-4a2b-9c74-1432752648d8",
        "currency_code":"ETH",
        "erc20_token":0,
        "amount":"10",
        "extra":"",
        "notify_url":"example.dizpay.com"
      }, response_type='json')
    
    <?php
      require_once __DIR__.'/../vendor/autoload.php';
      $profile = new \DizPay\DizPayProfile('YOUR_APP_ID', 'YOUR_APP_KEY');
      $ordersAPI = \DizPay\DizPayAPIFactory::orders($profile);
      $resp = $ordersAPI->createChargeOrder([
        'number' => '53f9bc56-337e-4a2b-9c74-1432752648d8',
        'currency_code' => 'ETH',
        'erc20_token' => 0,
        'amount' => 10,
        'extra' => '',
        'notify_url' => '...'
        ]);
    

    Example Response

    {
       "currency_code": "ETH",
       "erc20_token": 0,
       "status": 1,
       "amount": "10",
       "paid_amount": "0.00",
       "fee": "0.00000000",
       "to_address": "0x0565e657de50f60d73fcbd0927871e34136ecd04",
       "address": "0xdc44cd8c0d99848e1fa326735dd90f29f17335c6",
       "extra": "",
       "number": "1723145127941662",
       "txid": null
    }
    

    HTTP Request

    POST /member/orders/create_charge_order

    Arguments

    Parameter Required Description Remarks
    app_id Yes Your app_id
    number Yes Order number
    currency_code Yes Digital currency name Example: USDT
    amount Yes Amount of currency
    signature Yes signature (see Authentication section)
    erc20_token No 0 for Non-token currency
    1 for Token currency
    Default: 0
    extra No Extra information
    notify_url No Callback URL Must contain the protocol (http) as well.

    Response

    Field Description
    number Order number
    currency_code Code of the used currency
    erc20_token Either 0 or 1
    amount Amount paid
    paid_amount Amount actually received
    extra Extra information
    fee Fee set by the merchant. This field is currently unused.
    to_address Address of the target recipient
    txid The txid of the transaction
    status Order status:
    1 for In progress
    2 for Completed
    4 for Cancelled

    Query an order

    Example Request

      curl https://api.dizpay.com/v2/member/orders/query_order \
        -X POST \
        -H 'Content-Type: application/json' \
        -d '{"app_id":"dp7dBNHarMxGvY6EyK","signature":"0bf97d7ffa0eaee25b3f326c095f5243","number":"8eb9bc53-75ea-4142-8a91-af89d2246379"}'
    
      import requests
    
      r = requests.post('https://api.dizpay.com/v2/member/orders/query_order', json={
        "app_id":"dp7dBNHarMxGvY6EyK",
        "signature":"0bf97d7ffa0eaee25b3f326c095f5243",
        "number":"8eb9bc53-75ea-4142-8a91-af89d2246379"
      }, response_type='json')
    
    <?php
      require_once __DIR__.'/../vendor/autoload.php';
      $profile = new \DizPay\DizPayProfile('YOUR_APP_ID', 'YOUR_APP_KEY');
      $ordersAPI = \DizPay\DizPayAPIFactory::orders($profile);
      $resp = $ordersAPI->queryOrder(['number' => '8eb9bc53-75ea-4142-8a91-af89d2246379']);
    

    Response

    {
      "currency_code": "ETH",
      "erc20_token": 0,
      "status": 2,
      "amount": "10",
      "fee": "0.00100000",
      "paid_amount": "0.00",
      "to_address": "0x0565e657de50f60d73fcbd0927871e34136ecd04",
      "address": "0xdc44cd8c0d99848e1fa326735dd90f29f17335c6",
      "extra": "",
      "number": "1723145127941662",
      "txid": null
    }
    

    Returns the details of the order based on the order number

    HTTP Request

    POST member/orders/query_order

    Arguments

    Parameter Required Description
    app_id Yes Your app_id
    number Yes The order number to query
    signature Yes Signature

    Response

    Field Description
    number Order number
    currency_code Code of the used currency
    erc20_token 0 for Non-token currency
    1 for Token
    amount Amount paid
    paid_amount Amount actually received
    extra extra information
    fee Fee set by the merchant. This field is currently unused.
    to_address Address of the target recipient
    address Address of the money source
    txid The txid for the transaction
    status Order status:
    1 for In progress
    2 for Completed
    4 for Cancelled

    Cancel an order

    Example Request

      curl https://api.dizpay.com/v2/member/orders/cancel_order \
        -X POST \
        -H 'Content-Type: application/json' \
        -d '{"app_id":"dp7dBNHarMxGvY6EyK","signature":"0bf97d7ffa0eaee25b3f326c095f5243","number":"8eb9bc53-75ea-4142-8a91-af89d2246379"}'
    
      import requests
    
      r = requests.post('https://api.dizpay.com/v2/member/orders/cancel_order', json={
        "app_id":"dp7dBNHarMxGvY6EyK",
        "signature":"0bf97d7ffa0eaee25b3f326c095f5243",
        "number":"8eb9bc53-75ea-4142-8a91-af89d2246379"
      }, response_type='json')
    
    <?php
      require_once __DIR__.'/../vendor/autoload.php';
      $profile = new \DizPay\DizPayProfile('YOUR_APP_ID', 'YOUR_APP_KEY');
      $ordersAPI = \DizPay\DizPayAPIFactory::orders($profile);
      $resp = $ordersAPI->cancelOrder(['number' => '8eb9bc53-75ea-4142-8a91-af89d2246379']);
    

    Response

    {
      "currency_code": "ETH",
      "erc20_token": 0,
      "status": 4,
      "amount": "10",
      "fee": "0.00100000",
      "paid_amount": "0.00",
      "to_address": "0x0565e657de50f60d73fcbd0927871e34136ecd04",
      "address": "0xdc44cd8c0d99848e1fa326735dd90f29f17335c6",
      "extra": "",
      "number": "1723145127941662",
      "txid": null
    }
    
    

    Cancels the selected order.

    HTTP Request

    POST /member/orders/cancel_order

    Arguments

    Parameter Required Description
    app_id Yes Your app_id
    number Yes The order number to cancel
    signature Yes Signature

    Response Fields

    Field Description
    number Order number
    currency_code Code of the used currency
    erc20_token 0 for Non-token currency
    1 for Token
    amount Amount paid
    paid_amount Amount actually received
    extra Extra information
    fee Fee set by the merchant. This field is currently unused.
    to_address Address of the target recipient
    address Address of the money source
    txid The txid for the transaction
    status Order status:
    1 for In progress
    2 for Completed
    4 for Cancelled

    Notification on payment completion

    You can use the DizPay API to get notifications on the results of a payment transaction. You can then notify your users in turn. To get notified, you need to configure the notify_url.

    Notifications are sent within the bounds of the following rules:

    1. The merchant server receives the notification and checks the signature of the packet. If it passes the check, the subsequent business logic is executed and the HTTP status code of success (200) is sent to the payment gateway.
    2. If the payment gateway does not receive the success response in 3 seconds, it communicates with the merchant server to retry the transaction every 10 minutes. After retrying for 24 hours, the payment gateway stops communicating with the merchant server for the transaction.

    Note:

    Notification sample

    {
      "currency_code": "ETH",
      "erc20_token": 0,
      "status": 2,
      "amount": "10",
      "paid_amount": "10",
      "extra": "",
      "number": "1723145127941662",
      "signature": "0bf97d7ffa0eaee25b3f326c095f5243"
    }
    
    

    Notification Params

    Parameter Description
    number order number
    currency_code currency code name
    erc20_token either 0 or 1
    amount currency amount
    paid_amount actual received amount
    extra extra info
    signature signature
    status order status, 1 for in progress, 2 for completed, 4 for cancelled

    Verifying signature in the notification

    Example

    origin data

    {
      "number": "8eb9bc53-75ea-4142-8a91-af89d2246379",
      "currency_code": "USDT",
      "amount": "100.00000000",
      "paid_amount": "100.00000000",
      "extra": "",
      "erc20_token": 0,
      "status": 2,
      "signature": "4a0ebe1a14833a4565a6655e2408d03c"
    }
    

    remove signature, add app_id and app_key:

    {
      "app_id": "dp9vC69mdA3QG2VPRe",
      "app_key": "e145d582c31928ca103d262b200e882d",
      "number": "8eb9bc53-75ea-4142-8a91-af89d2246379",
      "currency_code": "USDT",
      "amount": "100.00000000",
      "paid_amount": "100.00000000",
      "extra": "",
      "erc20_token": 0,
      "status": 2
    }
    

    generate string

    amount=100.00000000&app_id=dp9vC69mdA3QG2VPRe&app_key=e145d582c31928ca1
    03d262b200e882d&currency_code=USDT&erc20_token=0&extra=&number=8eb9bc53
    -75ea-4142-8a91-af89d2246379&paid_amount=100.00000000&status=2
    

    compute md5

    4a0ebe1a14833a4565a6655e2408d03c
    
    1. Remove signature from the notification response and add the app_id and app_key.

    2. Sort the key-value pairs alphabetically and combine them into a single string separated by &. Make sure you use UTF-8 encoding for non-ASCII characters.

    3. Calculate the MD5 sum of the combined string (use lower case values).

    4. Verify whether the computed signature is equal to the one in the original response.

    Payout order

    Create payout order

    Create a payout(substitute) order to handle payout or withdrawal business in your application. The amount of the corresponding digital currency is deducted from your merchant’s bulk shipping wallet.

    Make sure that your wallet has enough balance to complete the transaction.

    Example Request

      curl https://api.dizpay.com/v2/member/orders/create_payout_order \
        -X POST \
        -H 'Content-Type: application/json' \
        -d '{"app_id":"dp9vC69mdA3QG2VPRe","signature":"16c70a34dd1da3507dafc563023d9019","number":"1723145127941662","currency_code":"ETH","erc20_token":0,"to_address":"0x0565e657de50f60d73fcbd0927871e34136ecd04","amount":"10","extra":""}'
    
      import requests
    
      r = requests.post('https://api.dizpay.com/v2/member/orders/create_payout_order', json={
        "app_id": "dp9vC69mdA3QG2VPRe",
        "signature": "16c70a34dd1da3507dafc563023d9019",
        "number": "1723145127941662",
        "currency_code": "ETH",
        "erc20_token": 0,
        "to_address": "0x0565e657de50f60d73fcbd0927871e34136ecd04",
        "amount": "10",
        "extra": ""
      }, response_type='json')
    
    <?php
      require_once __DIR__.'/../vendor/autoload.php';
      $profile = new \DizPay\DizPayProfile('YOUR_APP_ID', 'YOUR_APP_KEY');
      $ordersAPI = \DizPay\DizPayAPIFactory::orders($profile);
      $resp = $ordersAPI->createPayoutOrder([
        'number' => '53f9bc56-337e-4a2b-9c74-1432752648d8',
        'currency_code' => 'ETH',
        'erc20_token' => 0,
        'amount' => 10,
        'extra' => '',
        'to_address' => '0x0565e657de50f60d73fcbd0927871e34136ecd04'
        ]);
    

    Response

    {
      "currency_code": "ETH",
      "erc20_token": 0,
      "status": 1,
      "amount": "10",
      "paid_amount": "0.00",
      "fee": "0.00000000",
      "to_address": "0x0565e657de50f60d73fcbd0927871e34136ecd04",
      "address": "0xdc44cd8c0d99848e1fa326735dd90f29f17335c6",
      "extra": "",
      "number": "1723145127941662",
      "txid": null
    }
    

    HTTP Request

    POST /member/orders/create_payout_order

    Arguments

    Parameter Required Description Remarks
    app_id Yes Your app_id
    number Yes Order number
    currency_code Yes Digital currency name Example: USDT
    amount Yes Amount of currency
    signature Yes signature (see Authentication section)
    erc20_token No 0 for Non-token currency
    1 for Token currency
    Default: 0
    extra No Extra information
    to_address No The address to withdraw the funds in

    Response

    Field Description
    number Order number
    currency_code Code of the used currency
    erc20_token Either 0 or 1
    amount Amount paid
    paid_amount Amount actually received
    extra Extra information
    fee Fee set by the merchant. This field is currently unused.
    to_address Address of the target recipient
    address Address of the money source
    txid The txid of the transaction
    status Order status:
    1 for In progress
    2 for Completed
    4 for Cancelled

    Pay an order

    Example Request

      curl https://api.dizpay.com/v2/member/orders/pay_order \
        -X POST \
        -H 'Content-Type: application/json' \
        -d '{"app_id":"dp7dBNHarMxGvY6EyK","signature":"0bf97d7ffa0eaee25b3f326c095f5243","number":"8eb9bc53-75ea-4142-8a91-af89d2246379"}'
    
      import requests
    
      r = requests.post('https://api.dizpay.com/v2/member/orders/pay_order', json={
        "app_id": "dp7dBNHarMxGvY6EyK",
        "signature": "0bf97d7ffa0eaee25b3f326c095f5243",
        "number": "8eb9bc53-75ea-4142-8a91-af89d2246379"
      }, response_type='json')
    
    <?php
      require_once __DIR__.'/../vendor/autoload.php';
      $profile = new \DizPay\DizPayProfile('YOUR_APP_ID', 'YOUR_APP_KEY');
      $ordersAPI = \DizPay\DizPayAPIFactory::orders($profile);
      $resp = $ordersAPI->payOrder([
        'number' => '8eb9bc53-75ea-4142-8a91-af89d2246379',
        ]);
    

    Example Response

    {
      "currency_code": "ETH",
      "erc20_token": 0,
      "status": 2,
      "amount": "10",
      "fee": "0.00100000",
      "paid_amount": "0.00",
      "to_address": "0x0565e657de50f60d73fcbd0927871e34136ecd04",
      "address": "0xdc44cd8c0d99848e1fa326735dd90f29f17335c6",
      "extra": "",
      "number": "1723145127941662",
      "txid": null
    }
    

    HTTP Request

    POST member/orders/pay_order

    Arguments

    Parameter Required Description
    app_id Yes Your app_id
    number Yes The order number to query
    signature Yes Signature

    Response

    Field Description
    number Order number
    currency_code Code of the used currency
    erc20_token 0 for Non-token currency
    1 for Token
    amount Amount paid
    paid_amount Amount actually received
    extra extra information
    fee Fee set by the merchant. This field is currently unused.
    to_address Address of the target recipient
    address Address of the money source
    txid The txid for the transaction
    status Order status:
    1 for In progress
    2 for Completed
    4 for Cancelled

    Rate Endpoint

    The DizPay APIs in this section do not require authentication. Therefore, you do not need to add the signature key in the requests.

    Query Crypto Currency

    Example Request

      curl https://api.dizpay.com/v2/member/rates/cryptocurrency \
        -X POST \
        -H 'Content-Type: application/json' \
        -d '{"currency_list":"ETH,BTC"}'
    
      import requests
    
      r = requests.post('https://api.dizpay.com/v2/member/rates/cryptocurrency', json={
        "currency_list":"ETH,BTC"
      }, response_type='json')
    
    <?php
      require_once __DIR__.'/../vendor/autoload.php';
      $profile = new \DizPay\DizPayProfile('YOUR_APP_ID', 'YOUR_APP_KEY');
      $ratesAPI = \DizPay\DizPayAPIFactory::rates($profile);
      $resp = $ratesAPI->cryptocurrency([
        'currency_list' => 'ETH,BTC',
        ]);
    

    Response

    {
      "objects": [
        {
          "currency_code": "BTC",
          "erc20_token": 0,
          "usd_price": "4103.80830069",
          "percent_change_24h": "0.28775500"
        },
        {
          "currency_code": "ETH",
          "erc20_token": 0,
          "usd_price": "141.26885105",
          "percent_change_24h": "-0.23148100"
        }
      ]
    }
    

    Gets the rate of the required crypto currency.

    Path

    POST member/rates/cryptocurrency

    Params

    Parameter Required Description
    currency_list No Comma-separated currency codes. Returns all the rates if this parameter is empty.

    Return Fields

    Field Description
    usd_price Current USD
    currency_code Currency code
    erc20_token No
    percent_change_24h Increase percent in the last 24 hours. This can be negative.

    Query Fiat Currency

    Example Request

      curl http://api.dizpay.com/v2/member/rates/currency \
        -X POST \
        -H 'Content-Type: application/json' \
        -d '{"currency_list":"CNY,GBP"}'
    
      import requests
    
      r = requests.post('https://api.dizpay.com/v2/member/rates/currency', json={
        "currency_list":"CNY,GBP"
      }, response_type='json')
    
    <?php
      require_once __DIR__.'/../vendor/autoload.php';
      $profile = new \DizPay\DizPayProfile('YOUR_APP_ID', 'YOUR_APP_KEY');
      $ratesAPI = \DizPay\DizPayAPIFactory::rates($profile);
      $resp = $ratesAPI->currency([
        'currency_list' => 'CNY,GBP',
        ]);
    

    Response(200)

    {
      "objects": [
        {
          "country": "中华人民共和国",
          "country_code": "CN",
          "currency": "人民币元",
          "currency_code": "CNY",
          "usd_rate": "6.71"
        },
        {
          "country": "英国",
          "country_code": "GB",
          "currency": "英镑",
          "currency_code": "GBP",
          "usd_rate": "0.77"
        }
      ]
    }
    

    Gets the fiat currency rate.

    HTTP Request

    POST member/rates/currency

    Arguments

    Parameter Required Description
    currency_list No Comma-separated currency codes. Returns all the rates if this parameter is empty.

    Return Fields

    Field Description
    country Name of country
    country_code Country code
    currency Name of currency
    currency_code Currency code
    usd_rate USD rate of the current fiat

    Checkout API

    invoice

    Example Request

      curl https://checkout.dizpay.com/v1/invoice \
        -X POST \
        -H 'Content-Type: application/json' \
        -d ' "app_id":"dpb96h2KfR4GYTAyqn", \
        "signature":"9fed973581219861b689ee16dcfe3acd", \
        "order_number":"53f9bc56-337e-4a2b-9c74-1432752648d8", \
        "name":"DizPay Inc.",                                   \
        "description": "Add crypto to your account",            \
        "logo_url":"https://cdn.shopifycloud.com/hatchful-web/assets/c3a241ae6d1e03513dfed6f5061f4a4b.png", \
        "payer_info":"email", \
        "price_type":"fixed_price", \
        "currency": "USD", \
        "amount": 100, \
        "rate": "huobi", \
        "crypto": "USDC,TUSD,PAX,GUSD,USDT,ETH,BTC,LTC,DASH", \
        "locale": "auto", \
        "success_url": "https://example.com/diz-pay-result?type=success", \
        "cancel_url": "https://example.com/diz-pay-result?type=failed",\
        "notify_url": "https://demo.dizpay.com/webhook", \
        "extra": "another-params"}'
    
      import requests
    
      r = requests.post('https://checkout.dizpay.com/v1/invoice', json={
        "app_id":"dpb96h2KfR4GYTAyqn",
        "signature":"9fed973581219861b689ee16dcfe3acd",
        "order_number":"53f9bc56-337e-4a2b-9c74-1432752648d8",
        "name":"DizPay Inc.",
        "description": "Add crypto to your account",
        "logo_url":"https://cdn.shopifycloud.com/hatchful-web/assets/c3a241ae6d1e03513dfed6f5061f4a4b.png",
        "payer_info":"email",
        "price_type":"fixed_price",
        "currency": "USD",
        "amount": 100,
        "rate": "huobi",
        "crypto": "USDC,TUSD,PAX,GUSD,USDT,ETH,BTC,LTC,DASH",
        "locale": "auto",
        "success_url": "https://example.com/diz-pay-result?type=success",
        "cancel_url": "https://example.com/diz-pay-result?type=failed",
        "notify_url": "https://demo.dizpay.com/webhook",
        "extra": "another-params"
      }, response_type='json')
    
    <?php
      require_once __DIR__.'/../vendor/autoload.php';
      $profile = new \DizPay\DizPayProfile('YOUR_APP_ID', 'YOUR_APP_KEY');
      $checkoutAPI = \DizPay\DizPayAPIFactory::checkout($profile);
      $resp = $checkoutAPI->invoice([
            'order_number' => uniqid('TEST_ORDER:'), # required
            'name' => 'DizPay Inc.', // 'Your Merchant Name, eg: DizPay Inc.',
            'description' => 'Add crypto to your account.', // 'optional, default is: Add crypto to your {{ Domain or App Name }} account.',
            'logo_url'=> 'https://cdn.shopifycloud.com/hatchful-web/assets/c3a241ae6d1e03513dfed6f5061f4a4b.png',
            'payer_info' => 'email', // one of in ['', 'email', 'mobile']
            'pricing_type' => 'fixed_price', // one of in ['fixed_price', 'no_price'],
            'currency' => 'USD', // required, split by commas, valid option is USD | CNY | GBP | BTC | ETH | LTC | DASH | USDT | TUSD | GUSD | PAX | USDC
            'amount' => '100',  // string, required
            'rate' => 'huobi', // optional, default is coinmarketcap, one of in ['coinmarketcap', 'okex', 'binance', 'huobi']
            'crypto' => 'USDC,TUSD,PAX,GUSD,USDT,ETH,BTC,LTC,DASH', // required, split by commas, valid option is BTC | ETH | LTC | DASH | USDT | TUSD | GUSD | PAX | USDC
            'locale' => 'auto', // language, one of in ['auto', 'en', 'cn', 'ru', 'ko', 'jp']
            'success_url' => 'https://example.com/diz-pay-result?type=success', // optional, redirect to the merchant URL after successful payment.
            'cancel_url' => 'https://example.com/diz-pay-result?type=failed', // optional, edirect to a failure URL when the charge failed to complete. The buyer cancels the order or the payment expired.
            'notify_url' => 'https://demo.dizpay.com/webhook',                // optional, Send information to the callback URL when charge has been confirmed and the associated payment is completed.
            'extra' => 'another-params',
        ]);
    

    Response

    {
       "paymentUrl": "https://checkout.dizpay.com/xxxxx"
    }
    

    Path

    POST https://checkout.dizpay.com/v1/invoice

    Params

    Parameter Type Required Description
    app_id String Yes Your app_id.
    order_number String Yes Order number. The size cannot exceed 36 bytes
    name String Yes Name of the cashier
    description String No Merchant's description of the order
    Default: Add crypto to the {{ name }} account.
    logo_url String No Displays a default logo if this field is not specified.
    payer_info Either email or mobile No Indicates which user info may be collected to resolve potential problems in the transaction.
    If not specified, the user info page will be skipped.
    pricing_type Either fixed_price or no_price Yes If set fixed_price, the payment amount is based on fiat currency code and amount. Otherwise, it is based on the crypto currency type and amount and in this case, the user won't see currency list. Instead, there is a direct digital currency address.
    currency One of USD, CNY, GBP, BTC, ETH, LTC, DASH, USDT, TUSD, GUSD, PAX, or USDC Yes If fixed_price is used, this should be a fiat currency. Otherwise, this should be a digital currency.
    rate One of okex, binance, huobi, or coinmarketcap No Use this field only when pricing_type is fixed_price.
    Default: coinmarketcap
    amount String Yes Price specified by merchant. If you use no_price, this determines the digital currency payment amount. Otherwise, the amount is determined by currency code and amount.
    crypto String No Comma separated array of strings specifying what cryptocurrencies the merchant wants to collect from the buyers. The order of the crypto list follows the same sequence. Available options are BTC, ETH, LTC, DASH, USDT, TUSD, GUSD, PAX, and USDC.
    locale One of auto, en, cn, ru, ko, or jp No Use automatically detected language by browser settings or specified language.
    success_url String No Redirect URL after payment success.
    cancel_url String No Redirect URL after charge failure. The buyer cancels the order or the payment expires.
    notify_url String No Sends information to this URL when the charge is confirmed and the payment is complete.
    extra String No You may pass additional data for later use in notify_url callback.