Cashramp
  • Introduction
    • Getting Started
    • Payment Rails
    • API Endpoints
    • Authentication
    • Webhooks
    • Integration Guide
    • SDKs
  • Hosted Ramp
    • Overview
    • Deposits
    • Withdrawals
    • Cancel Payment
  • Direct Ramp
    • Overview
    • Ramp Quotes
    • Deposits
    • Withdrawals
  • Onchain Ramp
    • Overview
    • On-Off Ramp
  • Cashramp API
    • Queries
    • Customers
    • Payment Methods
    • Withdraw Onchain
Powered by GitBook
On this page
  • Initiate Withdrawal
  • Arguments
  • Response
  1. Hosted Ramp

Withdrawals

Initiate Withdrawal

Create a hosted withdrawal with the initiateHostedPayment mutation.

mutation {
  initiateHostedPayment(
    paymentType: withdrawal
    amount: 100
    currency: usd
    countryCode: "NG"
    reference: "test_ref_1"
    metadata: { customer_id: "" }
    redirectUrl: "https://useaccrue.com"
    firstName: "Clinton"
    lastName: "Mbah"
    email: "test@useaccrue.com"
  ) {
    id
    hostedLink
    status
  }
}

Arguments

Name
Type
Required
Description

paymentType

Enum

Yes

Must be withdrawal.

amount

Decimal

Yes

The USD equivalent you want to off-ramp to a customer's local currency.

currency

Enum

Yes

usd. The local currency equivalent your customer will receive is determined by the countryCode.

countryCode

String

Yes

ISO-3166 alpha-2 code of the customer's country (e.g., NG).

reference

String

No

Your idempotent reference for reconciliation.

metadata

JSON

No

Arbitrary key–value data echoed in webhooks.

redirectUrl

String

No

URL to send the customer to after payment.

firstName

String

Yes

Customer's first name.

lastName

String

Yes

Customer's last name.

email

String

Yes

Customer's email address.

Response

Field
Type
Description

id

ID!

Global ID of the payment request.

hostedLink

String!

URL of the hosted checkout page—redirect the customer here.

status

Enum!

Current state of the request (values below).

status values:

  • created — Payment request has been created.

  • picked_up — We've received the crypto payment and assigned your customer an agent to withdraw through.

  • completed — Withdrawal succeeded.

  • canceled — Request was cancelled by the customer or via dispute resolution.

PreviousDepositsNextCancel Payment

Last updated 10 days ago