A-pay Documentation
  • Documentation
    • โ‡๏ธAbout A-pay Platform
    • ๐Ÿ’ตSupported currencies
  • API Documentation
    • ๐Ÿš€Start Integration
    • ๐ŸˆGetting data about PS
    • ๐Ÿ“ƒPayment Page Integration
      • Payment Gateway
    • ๐Ÿ–ฅ๏ธAPI Integration
      • ๐Ÿ’ฐDeposit
        • Request to create a deposit
        • Deposit Activation
        • Deposit resend OTP
        • Deposit information
      • ๐Ÿ“คWithdrawal
      • ๐Ÿ”Lost transaction
        • Create lost transaction
        • Lost transaction information
    • ๐Ÿ”™Postback
    • ๐Ÿ“ˆSettlement
    • โ—Errors
  • ๐Ÿ‘จโ€๐Ÿ’ปOpenAPI Docs
Powered by GitBook
On this page
  1. API Documentation
  2. API Integration

Withdrawal

PreviousDeposit informationNextLost transaction

Last updated 20 days ago

Request to create a withdrawal

The section is similar to the section. Only the data required to create a withdrawal request will change.

Example of the responses:

Success
{
  "success": true,
  "status": "Pending",
  "order_id": "7fa13dbc3b79e05e",
  "data": {}
}
Error
{
  "success": false,
  "status": "Failed",
  "message": "Invalid request",
  "code": 400,
  "order_id": "7fa13dbc3b79e05e"
}

Withdrawal information

Examples of the responses:

Success
{
  "success": true,
  "status": "Success",
  "order_id": "7fa13dbc3b79e05e",
  "amount": 10,
  "currency": "INR",
  "payment_system": "mpesa",
  "custom_transaction_id": "custom123",
  "custom_user_id": "user123",
  "created_at": 1665135515
}
Error
{
  "success": false,
  "code": 400,
  "message": "Invalid request"
}

All the necessary information can be found in our .

๐Ÿ–ฅ๏ธ
๐Ÿ“ค
API documentation
Request to create a deposit

Request to create a withdrawal

post

Withdrawal creation.

When the withdrawal is confirmed, a callback request will be sent to the client's application handler with the Withdrawal webhook body

Authorizations
Query parameters
project_idnumberRequired

Project ID in the A-Pay system

Example: 123
Body
amountintegerRequired

Withdrawal amount

Example: 10
currencystring ยท enumRequired
Currency Payment systems
INR upi_fast, upi_fast_v, upi_fast_qr, upi_p2p, upi_a, paytm, phonepe, imps, imps_top, upi_link, upi_push, phonepe_fast, upi_fast_vip, imps
BDT nagad_api_v, bkash_a, apaybdt, upay, bkash_b, nagad_a, nagad_b, upay_w, bkash_p2p
PKR bankalfalah, easypaisa, jazzcash_l, nayapay_l, jazzcash_fast, pkr_w, jazzcash
KES mpesa
MMK wavepay_l
TND d17_l, flouci, flouci_l
BRL pix_p2p
MXN spei_p2p
KHR wing_l, ababank
NPR esewa, khalti, khalti_l, imepay_l
LKR ipay_l
ETB etb_fast
Example: INRPossible values:
payment_systemstring ยท enumRequired

Name of the payment system in A-Pay

Example: mpesaPossible values:
custom_transaction_idstring ยท max: 200Optional

Transaction ID in the client's system

Example: custom123
custom_user_idstring ยท max: 200Required

User ID in the client's system. Must be unique for each user

Example: user123
webhook_idstring ยท min: 7 ยท max: 7Optional

Id of a webhook that will be used to send a postback. If not filled then default webhook url will be used

Example: 42798
dataone ofRequired

Data depending on the specific payment system

or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
or
Responses
200
OK
application/json
Responseone of
or
400
Error
application/json
post
POST /Remotes/create-withdrawal?project_id=1 HTTP/1.1
Host: <domain>
apikey: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 176

{
  "amount": 10,
  "currency": "INR",
  "payment_system": "mpesa",
  "custom_transaction_id": "custom123",
  "custom_user_id": "user123",
  "webhook_id": 42798,
  "data": {
    "phone_number": "254712345678"
  }
}
{
  "success": true,
  "status": "Pending",
  "order_id": "7fa13dbc3b79e05e",
  "data": {}
}
Sequence diagram of the Withdrawal via API integration

Withdrawal information

get
Authorizations
Query parameters
project_idnumberRequired

Project ID in the A-Pay system

Example: 123
order_idstringRequired

Deposit ID in the A-Pay system

Example: 7fa13dbc3b79e05e
Responses
200
OK
application/json
Responseone of
or
400
Error
application/json
get
GET /Remotes/withdrawal-info?project_id=1&order_id=text HTTP/1.1
Host: <domain>
apikey: YOUR_API_KEY
Accept: */*
{
  "success": true,
  "status": "Success",
  "order_id": "7fa13dbc3b79e05e",
  "amount": 10,
  "currency": "INR",
  "payment_system": "mpesa",
  "custom_transaction_id": "custom123",
  "custom_user_id": "user123",
  "created_at": 1665135515
}
  • Request to create a withdrawal
  • POSTRequest to create a withdrawal
  • Withdrawal information
  • GETWithdrawal information