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

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

fields

[PaymentMethodFieldInput!]!

Yes

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

Filling fields

  1. Call p2pPaymentMethodTypes to list available payment rails.

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

  3. 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" }
]

Last updated