Generate Withdrawals (Pay-Out)

Learn how to generate withdrawals

On generating a withdrawal request, the system initiates the creation of the withdrawal, and then background processing is created between Krayons PSP's bank account and the end user's bank account.

You must transmit all necessary information to facilitate the completion of the withdrawal request, like the deposit request. The Deposit and Withdrawal requests are similar, and they will be easy to implement. Upon receipt of this information, our system will reply with the withdrawal metadata.

Note:** If not all required fields are provided in your request, the API endpoint will return an error response.

INR Withdrawal Request

import axios from 'axios';

const options = {
  method: 'POST',
  url: 'https:/api.aqua.test.krayondigital.com/main/api/v1/deposits',
  headers: {
    'accept': 'application/json',
    'content-type': 'application/json',
    'Authorization': "Bearer YOUR-API-TOKEN"
  },
  data: {
    "amount": "500",
    "reference_id": "payout_1",
    "description": "first payout for the organization",
    "currency": "INR",
    "customer": {
      "reference_id": "krayon_1337",
      "country_code": "IN",
      "email": "[email protected]",
      "first_name": "elon",
      "last_name": "mush",
      "phone": "919895270111",
      "account_number": "1111111111"
    },
    "billing_address": {
      "country_code": "IN",
      "address_line1": "Address Line 1",
    },
    "additional_parameters":{
        "bank_code":"KKBK00000000",
        "bank_name": "ICICI BANK" // non mandatory

    },
    "payment_method": "IMPS",
    "type": "WITHDRAWAL"
  }
};

axios
  .request(options)
  .then(function (response) {
    console.log(response.data);
  })
  .catch(function (error) {
    console.error(error);
  });
import requests

url = "https:/api.aqua.test.krayondigital.com/main/api/v1/deposits"

payload = {
    "amount": "500",
    "reference_id": "payout_1",
    "description": "first payout for the organization",
    "currency": "INR",
    "customer": {
      "reference_id": "krayon_1337",
      "country_code": "IN",
      "email": "[email protected]",
      "first_name": "elon",
      "last_name": "mush",
      "phone": "919895270111",
      "account_number": "1111111111"
    },
    "billing_address": {
      "country_code": "IN",
      "address_line1": "Address Line 1",
    },
    "additional_parameters":{
        "bank_code":"KKBK00000000",
        "bank_name": "ICICI BANK" # non mandatory
    },
    "payment_method": "IMPS",
    "type": "WITHDRAWAL"
  }

headers = {
    "accept": "application/json",
    "content-type": "application/json",
 		"Authorization": "Bearer YOUR-API-TOKEN"
}

response = requests.post(url, json=payload, headers=headers)
print(response.text)
{
    "amount": "500",
    "reference_id": "payout_1",
    "description": "first payout for the organization",
    "currency": "INR",
    "customer": {
      "reference_id": "krayon_1337",
      "country_code": "IN",
      "email": "[email protected]",
      "first_name": "elon",
      "last_name": "mush",
      "phone": "919895270111",
      "account_number": "1111111111"
    },
    "billing_address": {
      "country_code": "IN",
      "address_line1": "Address Line 1",
    },
    "additional_parameters":{
        "bank_code":"KKBK00000000",
        "bank_name": "ICICI BANK"
    },
    "payment_method": "IMPS",
    "type": "WITHDRAWAL"
}

Response

{
    "data": {
        "id": "9a2c4a6b0d98486fbddb405ed7cbdaad",
        "organization": "org_1NSEcKMC5m5j24GY",
        "status": "PENDING",
        "qr_code": "",
        "customer_email": "[email protected]",
        "customer_country": "IN",
        "reference_id": "payout_1",
        "created_at": "2023-05-02T17:01:22.809084Z",
        "payment_details": null,
        "amount": 100.0,
        "symbol": "USDT",
        "type": "WITHDRAWAL",
        "payment_method": "IMPS",
        "description": "first payout for the organization",
        "return_url": "https://www.krayondigital.com",
        "webhook_url": "",
        "currency": "INR",
        "redirect_url": "",
        "payment_fee": 0,
        "net_amount": 0
    }
}

Please check the limits and payment methods for each region. Payment Methods
Please check deposits API ref for more information and response object fields. Create deposit
Please check the deposit object for more information. Deposit Object