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"
    ownership: first_party
    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

[P2PPaymentMethodFieldInput!]!

Yes

Key–value pairs that capture the details required by the rail. Filling fields.

ownership

P2PPaymentMethodOwnership

No

Enum indicating if the payment method is first_party or third_party

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”:

Last updated