Navbar
Curl Python PHP
  • Introduction
  • Authentication
  • Errors
  • Rate limiting
  • Charges
  • Checkouts
  • Payouts
  • Currency API
  • Introduction

    BASE URL

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

    The DizPay API provides a simple and powerful REST API to integrate Bitcoin, USDT, Ethereum, Litecoin, Dash, and USDC payments into your business or application. This API reference provides information on available endpoints and how to interact with them.

    The DizPay API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

    Authentication

    Getting your API key

    Most requests to the DizPay API must be authenticated with an API key. You can get an API key in your Settings page after creating a DizPay merchant account.

    To get your API key, you can have to register yourself as a merchant .

    Follow the instructions to get your API key:

    1. To get a DizPay account, please register yourself as a merchant.
    2. Wait up to 24 hours until your merchant account is approved.
    3. Once you get approved, you can login your merchant dashboard.
    4. Go to the DEVELOPER page and get the App ID and App key.

    Note: NEVER reveal your app key to anyone.

    Signature & Using your API Key

    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 have to sign all the API requests. 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.

    Errors

    DizPay uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with DizPay's servers (these are rare).

    HTTP 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

    ERROR CODES

    All error messages include a type identifier and a human readable message.

    validation_error with status code 400 is returned when the validation of the resource fails on POST or PUT requests. Response contains errors field with a list of errors.

    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

    Error code examples json { "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
            }
        }
    }
    

    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 60 requests per minute to each user. If you send more requests than the specified limit, the server returns 1005 error code.

    Charges

    Create a charge order to request a cryptocurrency payment. When the received amount reaches the order amount, the received crypto will be credited to the merchant address automatically, and notify_url is called to notify your App/Website. Charges are identified by a unique code.

    Create a charge

    To get paid in cryptocurrency, you need to create a charge object and provide the user with a cryptocurrency address to which they must send cryptocurrency. Once a charge is created a customer must broadcast a payment to the blockchain before the charge expires.

    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

    Receive Callback Notification

    Payment callback (Payment notification) will be sent to merchant's notify_url when order status is changed to pending confirming, paid, invalid, canceled, refunded or expired.

    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.

    Order Status

    Value Status Description
    1 NEW Newly created charge or payout.
    2 COMPLETED Charge is confirmed by the network, and has been credited to the merchant.
    4 CANCELLED Payer canceled the payment.
    8 PROCESSING Charge or payout is processing by the blockchain network.
    16 DECLINED Charge or payout rejected by the network.
    32 UNDERPAID The payment is underpaid.
    64 OVERPAID The payment is overpaid.
    128 EXPIRED Payer did not pay within 48 hours.

    Checkouts

    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://example.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"
    }
    

    HTTP REQUEST

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

    Parameters

    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.

    Payouts

    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

    Currency API

    The DizPay currency APIs are public, authentication is not required. So, you do not have to add the signature key in the requests.

    Cryptocurrency Rates

    Gets the rate of the required cryptocurrencies.

    Example Request

      curl https://api.dizpay.com/v2/member/rates/cryptocurrency \
        -X POST \
        -H 'Content-Type: application/json' \
        -d '{"currency_list":"BTC,USDT"}'
    
      import requests
    
      r = requests.post('https://api.dizpay.com/v2/member/rates/cryptocurrency', json={
        "currency_list":"BTC,USDT"
      }, 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": "46869.96000000",
                "huobipro_usd_price": "31688.03216541",
                "okex_usd_price": "31678.13791100",
                "binance_usd_price": "31679.89043582",
                "deposit_gas_fee": "0",
                "withdrawal_fee": "0.00100000"
            },
            {
                "currency_code": "USDT",
                "erc20_token": 0,
                "usd_price": "1.00000000",
                "huobipro_usd_price": "1.00000000",
                "okex_usd_price": "0.97203699",
                "binance_usd_price": "1.03836418",
                "deposit_gas_fee": "20",
                "withdrawal_fee": "22"
            },
            {
                "currency_code": "USDT",
                "erc20_token": 1,
                "usd_price": "1.00000000",
                "huobipro_usd_price": "1.00000000",
                "okex_usd_price": "0.97203699",
                "binance_usd_price": "1.03836418",
                "deposit_gas_fee": "8.59",
                "withdrawal_fee": "16"
            }
        ]
    }
    

    HTTP Request

    POST member/rates/cryptocurrency

    Parameters

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

    Returns

    Field Description
    currency_code Cryptocurrency Code
    BTC: Bitcoin
    USDT: Tether USD
    ETH: Ethereum
    erc20_token 0 Bitcoin, ETH, OMNI-USDT, and other Non-token crypto
    1: USDT-ERC20, and other ERC20 Tokens
    usd_price Cryptocurrency price from Coinmarketcap.com
    huobipro_usd_price Cryptocurrency price from Houbi
    okex_usd_price Cryptocurrency price from Okex
    binance_usd_price Cryptocurrency price from Binance
    deposit_gas_fee Real-time deposit processing gas fee for collecting crypto to a merchant address
    withdrawal_fee Real-time withdrawl gas fee

    Fiat Currency Rates

    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"
        }
      ]
    }
    

    This API helps you to view all the fiat currency rates.

    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 Country name
    country_code Country code
    currency Currency name
    currency_code Currency code
    usd_rate the fiat currency price in USD