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 Deposit
  • Arguments
  • Response
  1. Hosted Ramp

Deposits

Initiate Deposit

Create a hosted deposit with the initiateHostedPayment mutation.

mutation {
  initiateHostedPayment(
    paymentType: deposit
    amount: 100
    currency: usd
    countryCode: "NG"
    reference: "test_ref_1"
    metadata: { customer_id: "2e7d57e2-a10e-4420-9d05-e109627a157a" }
    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 deposit.

amount

Decimal

Yes

Amount to charge the customer.

currency

Enum

Yes

usd to charge in USD, or local_currency to charge in the currency derived from 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 — Customer has selected an agent and is making the deposit.

  • completed — Deposit succeeded; your Cashramp balance is credited.

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

PreviousOverviewNextWithdrawals

Last updated 10 days ago