How to make a payout to a bank account with code:
API URL for Step 2 | HTTP Method |
---|---|
https://dinardragon.com/execute |
POST |
EXPECTED FIELDS TO FINALIZE PAYOUT:
authcode (string) |
---|
Authentication code you obtained from Step 1 |
You will also need to provide an Authorization value in the header of your HTTP request. You provide your private key here.
{
"authcode": "6afc61f8c5e7738819b7021dc0664cab" //unique authentication code
}
SUCCESS:
HTTP RESPONSE:
code (integer) | accounts (array of objects) | charge_in_usd (float) | payment_id (string) | message (string) |
---|---|---|---|---|
HTTP Response Code, e.g. 200, 201 | Array of objects containing details of each payment in the payout you have just finalized | Amount in USD Dinar Dragon will charge your dashboard balance to make this payout | ID of entire payout | Confirmation message of payout completion |
CONTENTS OF EACH OBJECT IN ACCOUNTS (ARRAY OF OBJECTS):
accNo (integer) | amount (float) | bank (string) | country (string) | recipientname (string) | date (string) | time (string) | email (string) | uniqueid (string) |
---|---|---|---|---|---|---|---|---|
Account number of recipient bank account | Amount in USD to pay recipient bank account | Name of bank of recipient | Recipient country | Recipient name | Date of payment | Time of payment | Email address of account that made this payment | ID of individual payment |
FAIL:
code (integer) | error (string) |
---|---|
HTTP Response Code, e.g. 403, 400 | Error message that tells you why the request failed |
{
"code": 200,
"accounts": [
{
"amount": 50,
"bank": "somebank",
"country": "US",
"recipientname": "somename",
"accNo": 123456789,
"date": "2025-01-31",
"time": "14:35",
"email": "youremail@anemailprovider.com", //the email address linked to your account
"uniqueid": "df9a31ea528a3977", //save uniqueid in your database to use later to check payment status
},
{
"amount": 70,
"bank": "someotherbank",
"country": "SA",
"recipientname": "someothername",
"accNo": 987654321,
"date": "2025-01-31",
"time": "14:35",
"email": "youremail@anemailprovider.com", //the email address linked to your account
"uniqueid": "adec957cc3860ec6", //save uniqueid in your database to use later to check payment status
},
{
"amount": 75,
"bank": "yetanotherbank",
"country": "US",
"recipientname": "yetanothername",
"accNo": 111111111,
"date": "2025-01-31",
"time": "14:35",
"email": "youremail@anemailprovider.com", //the email address linked to your account
"uniqueid": "dd6b346e7d0ef747", //save uniqueid in your database to use later to check payment status
}
],
"charge_in_usd": 4.875,
"payment_id": "1617fcccd1f3269c", //save payment_id in your database to use later to check payment status
"message": "Payout successfully processed. The funds will be disbursed to the bank account(s) within 15 minutes."
}
{
"code": 400, //Fail
"error": "Your request failed because your authcode is invalid or has expired. Retry this payout with a new authcode.",
}
// Example JavaScript to call /execute API endpoint
async function executePayout(authcode) {
const data = {
authcode: authcode, // Authentication code from previous step
publickey: 'yourPublicKey',
privatekey: 'yourPrivateKey'
};
try {
const response = await fetch('https://dinardragon.com/execute', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
});
const result = await response.json();
if (result.code === 200) {
console.log('Payout executed successfully!');
} else {
console.error('Error:', result.error);
}
} catch (error) {
console.error('Error:', error);
}
}
// Assuming authcode is retrieved from Step 1
const authcode = 'yourAuthenticationCode';
executePayout(authcode); // Execute payout with the authcode
That's it! You're done. The payout is complete and your users will receive their funds within 15 minutes. You will also be able to see the payout on your dashboard.
General Functionality | Expected Input | Response |
---|---|---|
/execute - POST endpoint to finalize a payout using the authentication code received in Step 1. This action will transfer the funds to the specified bank accounts, and once executed, the transaction cannot be reversed. Make sure the authentication code is valid before executing the payout. |
- **authcode**: The unique authentication code received from the /get-authcode endpoint in Step 1 (string) - **privatekey**: Your private key in 'Authorization' field of headers (string) |
- **code**: HTTP response code (number) - **accounts**: Payment details (array of objects) - **payment_id**: Payment ID (string) - **charge_in_usd**: amount in USD Dinar Dragon will charge your dashboard balance to make this payout (number) - **message**: Success message (string) - **error**: If there's an issue, an error message (string) |
©2024 dinardragon.com. All rights reserved.