C
C
Cashramp
Search
K
Comment on page

Withdrawals

Withdrawals

To initiate a withdrawal payment request, you should use the initiateHostedPayment mutation.
initiateDeposit
mutation {
initiateHostedPayment(
paymentType: withdrawal,
amount: 100,
currency: usd,
countryCode: "NG",
reference: "test_ref_1",
redirectUrl: "https://useaccrue.com",
firstName: "Clinton",
lastName: "Mbah",
) {
id
hostedLink
status
}
}
  • paymentType: withdrawal
  • amount: The USD equivalent you want to off-ramp to a customer's local currency
  • currency: usd. The local currency equivalent your customer will receive is determined by the country
  • country: The two-letter ISO code of the country your customer is resident in.
  • reference: Your unique reference (optional)
  • redirectUrl: The URL you want us to redirect your customer to after the transaction is completed. (optional)
  • firstName: Your customer's first name
  • lastName: Your customer's last name
  • email: Your customer's email

Response

Returns a merchant payment request.
  • id: The ID of the payment request
  • hostedLink: A link to the hosted payment page you should redirect your customer to
  • status: The current status of the payment request
    • created: The initial state of your payment request upon creation.
    • picked_up: Your customer has chosen an agent to withdraw through.
    • completed: The payment request has been successfully completed. If it's a deposit, your balance will get credited. If it's a withdrawal, your balance will be debited.
    • canceled: The payment request was canceled. Either by the user or by dispute resolution.