InitiatePayment

Endpoint

Overview

The "InitiatePayment" endpoint is a POST request. It is used to retrieve all available and enabled Payment Methods of your portal account with the commission charge that the customer may pay on the gateway. Detailed functionality of how to use this endpoint is explained in the Gateway Integration section.

The endpoint on Swagger is: Payment_InitiatePayment.

Now, we are going to declare the endpoint and its models along with each accepted parameter and possible value.

📘

Request Header

Add "Authorization": "Bearer {Token}" to request header. Token of demo configuration can be found here.


Request Model

The request is a POST request with the following parameters:

Input ParameterTypeDescription
InvoiceAmount numberThe transaction amount you need to charge your customer after applying coupon codes, taxes, fare updates, and so on.
CurrencyIso stringThe currency code that you need to charge your customer through. For full list please check here

📘

Note

We calculate the total amount of the invoice for a certain currency after applying the exchange rate.


Response Model

After viewing the Response Model that you will get as a result of your request, here, you will find full details about the Data Model of this API endpoint. Let's check it and its contents.

Response FieldTypeDescription
PaymentMethodId integerThe payment method ID that is used in MyFatoorah system to identify the method of payment
PaymentMethodAr stringPayment method Arabic name
PaymentMethodEn stringPayment method English name
IsDirectPayment boolean"true" or "false" to indicate if this payment method supports Direct Payment
ServiceCharge doubleThe transaction service charges based on the settings in the portal profile
TotalAmount doubleThe total amount that you should send before calling Execute Payment including the service charges after calculating it.
CurrencyIso stringThe currency code that you have sent in CurrencyIso
ImageUrl stringPayment icon URL that you can use to display it in your page for the customers

👍

Hint !

Initiate Payment is an optional step that return a list of Payment Methods that you need in Execute Payment. It does not execute or store any information about the payment. It just gets the proper information based on your MyFatoorah profile and calculates the service charges based on the settings there.


Sample Messages

{
  "InvoiceAmount": 100,
  "CurrencyIso": "KWD"
}
{
  "IsSuccess": true,
  "Message": "Initiated Successfully!",
  "ValidationErrors": null,
  "Data": {
    "PaymentMethods": [
      {
        "PaymentMethodId": 1,
        "PaymentMethodAr": "كي نت",
        "PaymentMethodEn": "KNET",
        "IsDirectPayment": false,
        "ServiceCharge": 0.5,
        "TotalAmount": 100.5,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://beta.myfatoorah.com/imgs/payment-methods/kn.png"
      },
      {
        "PaymentMethodId": 2,
        "PaymentMethodAr": "فيزا / ماستر",
        "PaymentMethodEn": "VISA/MASTER",
        "IsDirectPayment": true,
        "ServiceCharge": 0.5,
        "TotalAmount": 100.5,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://beta.myfatoorah.com/imgs/payment-methods/vm.png"
      },
      {
        "PaymentMethodId": 3,
        "PaymentMethodAr": "اميكس",
        "PaymentMethodEn": "AMEX",
        "IsDirectPayment": false,
        "ServiceCharge": 0.5,
        "TotalAmount": 100.5,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://beta.myfatoorah.com/imgs/payment-methods/ae.png"
      },
      {
        "PaymentMethodId": 5,
        "PaymentMethodAr": "بنفت",
        "PaymentMethodEn": "Benefit",
        "IsDirectPayment": false,
        "ServiceCharge": 0.5,
        "TotalAmount": 100.5,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://beta.myfatoorah.com/imgs/payment-methods/b.png"
      },
      {
        "PaymentMethodId": 6,
        "PaymentMethodAr": "مدى",
        "PaymentMethodEn": "MADA",
        "IsDirectPayment": false,
        "ServiceCharge": 0.5,
        "TotalAmount": 100.5,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://beta.myfatoorah.com/imgs/payment-methods/md.png"
      },
      {
        "PaymentMethodId": 7,
        "PaymentMethodAr": "البطاقات المدينة - قطر",
        "PaymentMethodEn": "Qatar Debit Cards",
        "IsDirectPayment": false,
        "ServiceCharge": 0.5,
        "TotalAmount": 100.5,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://beta.myfatoorah.com/imgs/payment-methods/np.png"
      },
      {
        "PaymentMethodId": 8,
        "PaymentMethodAr": "البطاقات المدينة - الامارات",
        "PaymentMethodEn": "UAE Debit Cards",
        "IsDirectPayment": false,
        "ServiceCharge": 0.5,
        "TotalAmount": 100.5,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://beta.myfatoorah.com/imgs/payment-methods/uaecc.png"
      },
      {
        "PaymentMethodId": 11,
        "PaymentMethodAr": "أبل الدفع",
        "PaymentMethodEn": "Apple Pay",
        "IsDirectPayment": false,
        "ServiceCharge": 0.5,
        "TotalAmount": 100.5,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://beta.myfatoorah.com/imgs/payment-methods/ap.png"
      }
    ]
  }
}