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
InvoiceAmountnumberThe transaction amount you need to charge your customer after applying coupon codes, taxes, fare updates, and so on.
CurrencyIsostringThe 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
PaymentMethodIdintegerThe payment method ID that is used in MyFatoorah system to identify the method of payment
PaymentMethodArstringPayment method Arabic name
PaymentMethodEnstringPayment method English name
PaymentMethodCodestringCode that refers to the payment method
IsDirectPaymentboolean"true" or "false" to indicate if this payment method supports Direct Payment
ServiceChargedoubleThe transaction service charges based on the settings in the portal profile
TotalAmountdoubleThe 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
ImageUrlstringPayment icon URL that you can use to display it in your page for the customers
IsEmbeddedSupportedboolean"true" or "false" to indicate if this payment method supports Embedded Payment
PaymentCurrencyIsostringThe currency of the gateway in which the payment will be made

👍

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": 7,
        "PaymentMethodAr": "البطاقات المدينة  قطر",
        "PaymentMethodEn": "QPay",
        "PaymentMethodCode": "np",
        "IsDirectPayment": false,
        "ServiceCharge": 2.6,
        "TotalAmount": 102.6,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/np.png",
        "IsEmbeddedSupported": false,
        "PaymentCurrencyIso": "QAR"
      },
      {
        "PaymentMethodId": 6,
        "PaymentMethodAr": "مدى",
        "PaymentMethodEn": "MADA",
        "PaymentMethodCode": "md",
        "IsDirectPayment": false,
        "ServiceCharge": 1,
        "TotalAmount": 100,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/md.png",
        "IsEmbeddedSupported": true,
        "PaymentCurrencyIso": "SAR"
      },
      {
        "PaymentMethodId": 1,
        "PaymentMethodAr": "كي نت",
        "PaymentMethodEn": "KNET",
        "PaymentMethodCode": "kn",
        "IsDirectPayment": false,
        "ServiceCharge": 2,
        "TotalAmount": 100,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/kn.png",
        "IsEmbeddedSupported": false,
        "PaymentCurrencyIso": "KWD"
      },
      {
        "PaymentMethodId": 11,
        "PaymentMethodAr": "أبل الدفع",
        "PaymentMethodEn": "Apple Pay",
        "PaymentMethodCode": "ap",
        "IsDirectPayment": false,
        "ServiceCharge": 2,
        "TotalAmount": 100,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/ap.png",
        "IsEmbeddedSupported": true,
        "PaymentCurrencyIso": "QAR"
      },
      {
        "PaymentMethodId": 2,
        "PaymentMethodAr": "فيزا / ماستر",
        "PaymentMethodEn": "VISA/MASTER",
        "PaymentMethodCode": "vm",
        "IsDirectPayment": false,
        "ServiceCharge": 0.2,
        "TotalAmount": 100,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/vm.png",
        "IsEmbeddedSupported": true,
        "PaymentCurrencyIso": "KWD"
      },
      {
        "PaymentMethodId": 14,
        "PaymentMethodAr": "STC Pay",
        "PaymentMethodEn": "STC Pay",
        "PaymentMethodCode": "stc",
        "IsDirectPayment": false,
        "ServiceCharge": 0.2,
        "TotalAmount": 100,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/stc.png",
        "IsEmbeddedSupported": false,
        "PaymentCurrencyIso": "SAR"
      },
      {
        "PaymentMethodId": 8,
        "PaymentMethodAr": "كروت الدفع المدنية (الإمارات)",
        "PaymentMethodEn": "UAE Debit Cards",
        "PaymentMethodCode": "uaecc",
        "IsDirectPayment": false,
        "ServiceCharge": 2.6,
        "TotalAmount": 102.6,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/uaecc.png",
        "IsEmbeddedSupported": true,
        "PaymentCurrencyIso": "AED"
      },
      {
        "PaymentMethodId": 9,
        "PaymentMethodAr": "Visa/Master Direct 3DS Flow",
        "PaymentMethodEn": "Visa/Master Direct 3DS Flow",
        "PaymentMethodCode": "vm",
        "IsDirectPayment": true,
        "ServiceCharge": 2.6,
        "TotalAmount": 102.6,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/vm.png",
        "IsEmbeddedSupported": true,
        "PaymentCurrencyIso": "KWD"
      },
      {
        "PaymentMethodId": 20,
        "PaymentMethodAr": "Visa/Master Direct",
        "PaymentMethodEn": "Visa/Master Direct",
        "PaymentMethodCode": "vm",
        "IsDirectPayment": true,
        "ServiceCharge": 0.2,
        "TotalAmount": 100,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/vm.png",
        "IsEmbeddedSupported": true,
        "PaymentCurrencyIso": "KWD"
      },
      {
        "PaymentMethodId": 3,
        "PaymentMethodAr": "اميكس",
        "PaymentMethodEn": "AMEX",
        "PaymentMethodCode": "ae",
        "IsDirectPayment": false,
        "ServiceCharge": 2.6,
        "TotalAmount": 102.6,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/ae.png",
        "IsEmbeddedSupported": true,
        "PaymentCurrencyIso": "USD"
      },
      {
        "PaymentMethodId": 25,
        "PaymentMethodAr": "أبل باي (مدي)",
        "PaymentMethodEn": "Apple Pay (Mada)",
        "PaymentMethodCode": "ap",
        "IsDirectPayment": false,
        "ServiceCharge": 1,
        "TotalAmount": 100,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/ap.png",
        "IsEmbeddedSupported": true,
        "PaymentCurrencyIso": "KWD"
      },
      {
        "PaymentMethodId": 32,
        "PaymentMethodAr": "جوجل للدفع",
        "PaymentMethodEn": "GooglePay",
        "PaymentMethodCode": "gp",
        "IsDirectPayment": false,
        "ServiceCharge": 2,
        "TotalAmount": 100,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/gp.png",
        "IsEmbeddedSupported": true,
        "PaymentCurrencyIso": "KWD"
      },
      {
        "PaymentMethodId": 5,
        "PaymentMethodAr": "بنفت",
        "PaymentMethodEn": "Benefit",
        "PaymentMethodCode": "b",
        "IsDirectPayment": false,
        "ServiceCharge": 2.1,
        "TotalAmount": 100,
        "CurrencyIso": "KWD",
        "ImageUrl": "https://demo.myfatoorah.com/imgs/payment-methods/b.png",
        "IsEmbeddedSupported": false,
        "PaymentCurrencyIso": "BHD"
      }
    ]
  }
}