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
- The POST API call for payments will create a payment in the system.
- Example: POSThttps://api.cloud.mbanq.com/v1/payments
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:
Parameter | Value Type | Definition |
---|---|---|
query | String | The GraphQL query specifying the mutation operation and its parameters. |
mutation | String | The type of GraphQL operation, indicating that it is a mutation. |
createPayment.input.paymentType | String | The type of the transfer, e.g., "CREDIT". |
createPayment.input.paymentRail | String | The payment type of the transfer, e.g., "SWIFT". |
createPayment.input.originator.accountId | String | The Originator Account ID. e.g., "92486353" |
createPayment.input.amount | Float | The amount of the payment. |
createPayment.input.recipient.name | String | Name of recipient. e.g., "Cemet Consulting LLC" |
createPayment.input.recipient.recipientId | String | Recipient ID. e,g., "234324" |
createPayment.input.recipient.address.line1 | String | The Address Line-1 of recipient, e.g., "415 N Oakhurst". |
createPayment.input.recipient.address.line2 | String | The Address Line-2 of recipient, e.g., "Dr, Apt 106". |
createPayment.input.recipient.address.stateCode | String | The State code of recipient, e.g.,"AZ" |
createPayment.input.recipient.address.countryCode | Array | The Country code of recipient, e.g.,"US" |
createPayment.input.recipient.address.postalCode | String | The Postal code of recipient, e.g.,"85288" |
createPayment.input.recipient.address.postalCode | String | City of Recipient Address |
createPayment.input.recipient.bankInformation.swiftCode | String | SWIFT/BIC code for the recipient's bank. |
createPayment.input.recipient.bankInformation.agent.name | String | Name of the agent/intermediary bank. |
createPayment.input.recipient.bankInformation.agent.identifier | String | Identifier of the agent bank. |
createPayment.input.recipient.bankInformation.agent.country | String | Country code of the agent bank (ISO format, e.g., "LU"). |
createPayment.input.recipient.bankInformation.agent.address | List of String | Address of the agent bank’s address. |
createPayment.input.recipient.bankInformation.agent.stateOrProvince | String | State or province of the agent bank. |
createPayment.input.recipient.bankInformation.agent.city | String | City where the agent bank is located. |
createPayment.input.recipient.bankInformation.agent.postalCode | String | Postal code of the agent bank. |
createPayment.input.reference | String | Reference or description for the payment. |
createPayment.input.forFurtherCredit | String | Optional 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.
Parameter | Value Type | Definition |
---|---|---|
data | Object | The data object containing the result of the transfer creation. |
createPayment | Object | The object representing the created payment. |
createPayment.id | String | The ID of the created payment. |
If the request is successful, the response will contain the paymentID:
{
"data": {
"createPayment": {
"id": "158715",
"resourceId": "158715"
}
}
}
Updated 3 months ago