Dinar Dragon

Dinar Dragon API Documentation



How to make a payout to a bank account with code:

API URL for Step 3 HTTP Method

https://dinardragon.com/status

POST


STEP 3: Use the /status POST endpoint to check the status of payments in your payout. It will return the completion status of payments in the payout. Pass the following data to the /status POST endpoint:


EXPECTED FIELDS TO OBTAIN PAYMENT STATUS:

uniqueid (string) OR payment_id (string)

ID of an individual payment in your payout, as shown in payment data returned in Step 2

ID of entire payout, as shown in payment data returned in Step 2


You will also need to provide an Authorization value in the header of your HTTP request. You provide your private key here.


The data returned from this endpoint will be an array of objects accessible in the "payments" property of the response, where each object in the array contains information about the status one of your payments in the payout.


Here are examples of how to structure your HTTP body for this request:

Example - JSON Request Body For /status endpoint (single payment in payout)

                
                    //use this body when you only want the status of a single payment
                    {
                        "uniqueid": "df9a31ea528a3977" //unique ID for singular payment out of an entire payout
                    }
                
                

Example - JSON Request Body For /status endpoint (entire payout)

                
                    //use this body when you want the status of an entire payout with all its payments
                    {
                        "payment_id": "1617fcccd1f3269c" //unique ID for an entire payout
                    }
                
                

Here are the expected JSON responses:


SUCCESS:


HTTP RESPONSE:

code (integer) payments (array of objects)
HTTP Response Code, e.g. 200, 201 Array containing status results for payments

CONTENTS OF EACH OBJECT IN PAYMENTS (ARRAY OF OBJECTS):

uniqueid (string) status (integer)
ID of the payment you queried 0: Payment processing
1: Payment successful
2: Payment failed. Amount refunded to Dashboard balance

If your request failed, you will get this response:


FAIL:

code (integer) error (string)
HTTP Response Code, e.g. 403, 400 Error message that tells you why the request failed

If you are querying the status of only one payment from a payout, the "payments" array will return the status of just that payment as an array with only one status object.

JSON Response - Querying One Payment In Payout

                
                 {
                    "code": 200, //OK
                    "payments":
                    [
                        {
                            "uniqueid": "yourpaymentid", 
                            "status": 1 //payment successful
                        }
                    ]

                }
                
            

If you are querying the status of an entire payout, the "payments" array will return a list of objects that represent the status of every payment in the payout.

JSON Response - Querying Entire Payout

                
                 {
                    "code": 200,  //OK
                    "payments":
                    [
                        //Payment 1
                        {
                            "uniqueid": "firstpaymentid", 
                            "status": 0 //payment processing
                        },

                        //Payment 2
                        {
                            "uniqueid": "secondpaymentid", 
                            "status": 1 //payment successful
                        },

                        //Payment 3
                        {
                            "uniqueid": "thirdpaymentid", 
                            "status": 2 //payment failed
                        },

                        //......and so on

                   ]
                 }
                
            

If your request fails, you can expect a response in this format:

JSON Response - Fail

                
                    {
                        "code": 400, //Fail
                        "error": "Missing API key in request headers.",
                    }
                
            

Here are some code examples you can copy and paste:

Step 3 - Check Payment Status


            
            


That's it! Now you can query the status of your payouts.



Step 2 -- Execute Payout
Step 1 -- Get Authentication Code
General Functionality Expected Input Response
/status - POST endpoint to check the payment status of either an entire payout or a payment within a payout, using the ID of the payment. - **payment_id/uniqueid**: The ID of the payment. Note that uniqueid is for singular payments within a payout, payment_id is for entire payouts. (string)

- **privatekey**: Your private key in 'Authorization' field of headers (string)
- **code**: HTTP response code (number)

- **uniqueid**: Payment ID (string)

- **status**: 0=processing, 1=success, 2=fail (number)

- **error**: If there's an issue, an error message (string)


Step 2 -- Execute Payout
Step 1 -- Get Authentication Code

©2024 dinardragon.com. All rights reserved.