Tutorial: Payments API

Introduction to the MBanq Cloud Payments API:

📘

API Reference for Payments API's and Webhooks

The MBanq Cloud Payments API is a powerful endpoint that enables developers to perform various types of payments across different payment rails. It is a crucial component for initiating and managing Payments within the MBanq ecosystem. To utilize the Transfer API effectively, developers should also have a solid understanding of webhook subscriptions and their functionality.

The Payments API allows you to create, submit, and manage transfers. It supports different payment types such as SWIFT, ACH, RDC, and more. By leveraging this API, you can seamlessly handle funds and facilitate secure and efficient payment transactions.

In this tutorial, we will walk you through the steps involved in creating Payments and performing various operations using the MBanq Cloud Transfer API.

📘

Payments Requests

Let's get started with the step-by-step process:

Create Payments

The following code snippet demonstrates how to create a payment from a current account to another account via SWIFT network:

curl -X POST https://api.cloud.mbanq.com/graphql \
     -H "Content-Type: application/json" \
     -d '{
         "query": "mutation {
              createPayment(
                input: { 
                  paymentType: "CREDIT",
                  paymentRail: "SWIFT",
                  originator: {
                    accountId: "18388"
                  },
                  amount: 2500,
                  correlationId: "6B56xh4DxD5gmYzEjpuZn11dfsdfsd1f",
                  recipient: {
                    name: "Cemet Consulting LLC",
                    accountNumber: "951002824868",
                    contactNumber: "+13334449999",
                    address: {
                      line1: "415 N Oakhurst", 
                      line2: "Dr, Apt 106",    
                      stateCode: "AZ",
                      countryCode: "US",       
                      postalCode: "85288",
                      city: "bangalore"
                    },
                    bankInformation: {              
                      swiftCode: "CITILULX",
                      agent: {
                        name: "Citibank Luxembourg",
                        identifier: "CITILULX",
                        country: "LU",
                        address: [
                          "31 Z.A. Bourmicht",
                          "L-8070 Bertrange"
                        ],
                        stateOrProvince: "Luxembourg District",
                        city: "Bertrange",
                        postalCode: "8070"
                      }
                    }
                  },
                  reference: "Paramguru Payment",
                  forFurtherCredit: "MV VYSYA BANK ACC NUM1234656"
                }
              ) {
                   id
               }
         }"
     }'

This table provides an overview of the parameters used in the given cURL statement for creating a payment via GraphQL. Each parameter has a corresponding value type and a definition that clarifies its purpose in the payment creation process:

ParameterValue TypeDefinition
queryStringThe GraphQL query specifying the mutation operation and its parameters.
mutationStringThe type of GraphQL operation, indicating that it is a mutation.
createPayment.input.paymentTypeStringThe type of the transfer, e.g., "CREDIT".
createPayment.input.paymentRailStringThe payment type of the transfer, e.g., "SWIFT".
createPayment.input.originator.accountIdStringThe Originator Account ID. e.g., "92486353"
createPayment.input.amountFloatThe amount of the payment.
createPayment.input.recipient.nameStringName of recipient. e.g., "Cemet Consulting LLC"
createPayment.input.recipient.recipientIdStringRecipient ID. e,g., "234324"
createPayment.input.recipient.address.line1StringThe Address Line-1 of recipient, e.g., "415 N Oakhurst".
createPayment.input.recipient.address.line2StringThe Address Line-2 of recipient, e.g., "Dr, Apt 106".
createPayment.input.recipient.address.stateCodeStringThe State code of recipient, e.g.,"AZ"
createPayment.input.recipient.address.countryCodeArrayThe Country code of recipient, e.g.,"US"
createPayment.input.recipient.address.postalCodeStringThe Postal code of recipient, e.g.,"85288"
createPayment.input.recipient.address.postalCodeStringCity of Recipient Address
createPayment.input.recipient.bankInformation.swiftCodeStringSWIFT/BIC code for the recipient's bank.
createPayment.input.recipient.bankInformation.agent.nameStringName of the agent/intermediary bank.
createPayment.input.recipient.bankInformation.agent.identifierStringIdentifier of the agent bank.
createPayment.input.recipient.bankInformation.agent.countryStringCountry code of the agent bank (ISO format, e.g., "LU").
createPayment.input.recipient.bankInformation.agent.addressList of StringAddress of the agent bank’s address.
createPayment.input.recipient.bankInformation.agent.stateOrProvinceStringState or province of the agent bank.
createPayment.input.recipient.bankInformation.agent.cityStringCity where the agent bank is located.
createPayment.input.recipient.bankInformation.agent.postalCodeStringPostal code of the agent bank.
createPayment.input.referenceStringReference or description for the payment.
createPayment.input.forFurtherCreditStringOptional note indicating the ultimate beneficiary account details.

This table provides an overview of the parameters used in the given data object. Each parameter has a corresponding value type and a definition that clarifies its purpose in the context of payment creation.

ParameterValue TypeDefinition
dataObjectThe data object containing the result of the transfer creation.
createPaymentObjectThe object representing the created payment.
createPayment.idStringThe ID of the created payment.

If the request is successful, the response will contain the paymentID:

{
    "data": {
        "createPayment": {
            "id": "158715",
            "resourceId": "158715"
        }
    }
}