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
    • Virtual Bank Accounts
Powered by GitBook
On this page
  • Example
  • Arguments
  • Filling fields
  1. Cashramp API

Payment Methods

Use addPaymentMethod to create a new payment method for a customer. You can then use the paymentMethod ID in mutations that require a payment method.

Example

mutation {
  addPaymentMethod(
    customer: "TWVyY2hhbnRDdXN0b21lci05ODFmYzVjMy1jNjYwLTQyMzAtYTgzNi0xM2EyOWZlMjRiOWY="
    paymentMethodType: "mtn_momo"
    fields: [
      { identifier: "name", value: "Jane Doe" }
      { identifier: "phone_number", value: "0246977890" }
    ]
  ) {
    id
    value # Friendly label (e.g., “Jane - 0246977890”)
    fields {
      identifier
      value
    }
  }
}

Arguments

Name
Type
Required
Description

customer

ID!

Yes

Global ID of the customer who owns the payment method.

paymentMethodType

String!

Yes

fields

[PaymentMethodFieldInput!]!

Yes

Key–value pairs that capture the details required by the rail (see below).

Filling fields

  1. Render inputs for each field definition in the chosen payment rail.

  2. Collect the user’s answers and map them to { identifier, value } objects.

Example for “GH · MTN Mobile Money”:

[
  { "identifier": "name", "value": "Test User" },
  { "identifier": "phone_number", "value": "0247890890" }
]
PreviousCustomersNextWithdraw Onchain

Last updated 10 days ago

Identifier of the rail to add (MoMo, bank transfer, etc.). .

Call to list available payment rails.

Payment rails
p2pPaymentMethodTypes