GetPaymentStatus

Endpoint

Overview

The "GetPaymentStatus" endpoint is a POST request. It is used to check the status of your invoice to assure that the payment has been done successfully or not. Detailed functionality of how to use this endpoint is explained in the Payment Inquiry section.

The endpoint on Swagger is: Payment_GetPaymentStatus.

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 Parameter

Type

Description

Key

string

Refers to the invoice number or payment ID based on the key type

KeyType

string

"InvoiceId" Refers to the invoice number that is generated by MyFatoorah

"PaymentId" the value is returned upon having any update on the invoice payment

"CustomerReference" The reference used to link your orders in the store

👍

PaymentId

We strongly recommend to use the value PaymentId (which is returned in the CallBackURL ) to inquire the payment status, this will get you full information about the invoice that you can use within your application. As long as there is not payment or transactions done for a certain invoice, you can inquire using InvoiceId


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 Field

Type

Description

InvoiceId

number

Represents the invoice ID that was used in the inquiry call

InvoiceStatus

string

"Pending"
"Paid"
"Canceled"

InvoiceReference

string

Invoice reference that is generated by MyFatoorah

CustomerReference

string

The customer reference data associated with the invoice

CreatedDate

string

The creation date of the invoice

ExpiryDate

string

The expiry date for the invoice

InvoiceValue

number

Invoice total value with the actual base account currency

Comments

string

Comments that are associated with the invoice (mainly used portal use users)

CustomerName

string

The customer name that was save along with the invoice

CustomerMobile

string

Customer mobile number

CustomerEmail

string

Customer email address

UserDefinedField

string

The user defined filed that was stored during the invoice creation

InvoiceDisplayValue

string

Invoice value that is displayed in case of different currency from the base one

DueDeposit

number

The amount that will be deposited to the vendor

DepositStatus

string

The deposit status of the invoice, if it is "Deposited" or "Not Deposited".

InvoiceItems

Array of InvoiceItemModel objects

InvoiceTransactions

Array of InvoiceTransactionModel objects

InvoiceItemModel

Response Field

Type

Description

ItemName

string

Invoice item name that is stored with the invoice

Quantity

integer

Item quantity

UnitPrice

number

Item unit price

Weight

number

100 >= Weight > 0
Weight in kg

Width

number

200 >= Width > 0
Width in cm

Height

number

160 >= Height > 0
Height in cm

Depth

number

200 >= Depth > 0
Depth in cm

InvoiceTransactionModel

Response Field

Type

Description

TransactionDate

string

The date of the transaction related to the invoice

PaymentGateway

string

The gateway the transaction was processed through

ReferenceId

string

The reference that is generated by the payment gateway

TrackId

string

The track number that is used to track the transaction with the gateway

TransactionId

string

The transaction ID

PaymentId

string

The payment ID that is assigned to this transaction

AuthorizationId

string

The authorization ID that is assigned to this transaction

TransactionStatus

string

The status of the transaction as follows:

  • InProgress
  • Succss
  • Failed

TransationValue

string

The value of the transaction

CustomerServiceCharge

string

The service charges considered on the customer during the transaction

DueValue

string

The amount value of this transaction

PaidCurrency

string

The currency that was used to pay the transaction

PaidCurrencyValue

string

The currency value that was used to pay the transaction

Currency

string

Transaction currency

Error

string

The error message that might be associated with the transaction.
This error is from the acquirer bank / platform

ErrorCode

string

The MyFatoorah error code. Kindly, refer to the Error Codes table.

📘

Transactions

Transactions information are totally related to the gateway response that came from the acquirer bank / platform. Not necessarily to have information to all the fields, and this was designed only to provide you information about all transactions that happened for a certain invoice

Error Codes

Code

Explanation

MF001

3DS authentication failed, possible reasons (user inserted a wrong password, cardholder/card issuer are not enrolled with 3DS, or the issuer bank has technical issue).

MF002

The issuer bank has declined the transaction, possible reasons (invalid card details, insufficient funds, denied by risk, the card is expired/held, or card is not enabled for online purchase).

MF003

The transaction has been blocked from the gateway, possible reasons (unsupported card BIN, fraud detection, or security blocking rules).

MF004

Insufficient funds

MF005

Session timeout

MF006

Transaction canceled

MF007

The card is expired.

MF008

The card issuer doesn't respond.

MF009

Denied by Risk

MF010

Wrong Security Code

MF020

Unspecified Failure


Sample Message

Now, you can get all information about the invoice transactions and suppliers - if exist - and the deposit amount of each supplier.

{
  "Key": "32090",
  "KeyType": "invoiceid"
}
{
  "IsSuccess": true,
  "Message": "",
  "ValidationErrors": null,
  "Data": {
    "InvoiceId": 1689719,
    "InvoiceStatus": "Paid",
    "InvoiceReference": "2022001311",
    "CustomerReference": "",
    "CreatedDate": "2022-09-18T09:21:04.183",
    "ExpiryDate": "September 19, 2022",
    "ExpiryTime": "00:21:04.183",
    "InvoiceValue": 100,
    "Comments": null,
    "CustomerName": "12",
    "CustomerMobile": "+96545454545",
    "CustomerEmail": null,
    "UserDefinedField": null,
    "InvoiceDisplayValue": "1,230.000 SR",
    "DueDeposit": 97.05,
    "DepositStatus": "Not Deposited",
    "InvoiceItems": [
      {
        "ItemName": "Test",
        "Quantity": 1,
        "UnitPrice": 100,
        "Weight": null,
        "Width": null,
        "Height": null,
        "Depth": null
      }
    ],
    "InvoiceTransactions": [
      {
        "TransactionDate": "2022-09-18T09:21:36.33",
        "PaymentGateway": "VISA/MASTER",
        "ReferenceId": "226106311831",
        "TrackId": "18-09-2022_1269519",
        "TransactionId": null,
        "PaymentId": "07071689719126951974",
        "AuthorizationId": "021299",
        "TransactionStatus": "Succss",
        "TransationValue": "100.000",
        "CustomerServiceCharge": "0.000",
        "DueValue": "100.000",
        "PaidCurrency": "KD",
        "PaidCurrencyValue": "100.000",
        "IpAddress": "156.193.110.50",
        "Country": "Egypt",
        "Currency": "KD",
        "Error": null,
        "CardNumber": "545454xxxxxx5454",
        "ErrorCode": ""
      }
    ],
    "Suppliers": []
  }
}
{
    "IsSuccess": true,
    "Message": "",
    "ValidationErrors": null,
    "Data": {
        "InvoiceId": 458281,
        "InvoiceStatus": "Paid",
        "InvoiceReference": "2021000093",
        "CustomerReference": null,
        "CreatedDate": "2021-02-08T17:04:25.257",
        "ExpiryDate": "February 15, 2021",
        "InvoiceValue": 2504.300,
        "Comments": null,
        "CustomerName": "name",
        "CustomerMobile": "965123456",
        "CustomerEmail": "[email protected]",
        "UserDefinedField": null,
        "InvoiceDisplayValue": "2,504.300 KD",
        "InvoiceItems": [
            {
                "ItemName": "name",
                "Quantity": 20,
                "UnitPrice": 123.400,
                "Weight": null,
                "Width": null,
                "Height": null,
                "Depth": null
            },
            {
                "ItemName": "Shipping Fees",
                "Quantity": 1,
                "UnitPrice": 36.300,
                "Weight": null,
                "Width": null,
                "Height": null,
                "Depth": null
            }
        ],
        "InvoiceTransactions": [
            {
                "TransactionDate": "2021-02-08T20:53:04.023",
                "PaymentGateway": "VISA/MASTER",
                "ReferenceId": "060645828135583363_3D",
                "TrackId": "08-02-2021_355833",
                "TransactionId": "060645828135583363",
                "PaymentId": "060645828135583363",
                "AuthorizationId": "033802",
                "TransactionStatus": "Succss",
                "TransationValue": "2,504.300",
                "CustomerServiceCharge": "75.229",
                "DueValue": "2,579.530",
                "PaidCurrency": "KD",
                "PaidCurrencyValue": "2,579.530",
                "Currency": "KD",
                "Error": null,
                "CardNumber": "512345xxxxxx0008",
                "ErrorCode": ""
            }
        ],
        "Suppliers": [
            {
                "SupplierCode": 1,
                "SupplierName": "first supplier",
                "InvoiceShare": 600.000,
                "ProposedShare": null,
                "DepositShare": 590.925
            },
            {
                "SupplierCode": 2,
                "SupplierName": "second supplier",
                "InvoiceShare": 600.000,
                "ProposedShare": 600.000,
                "DepositShare": 600.000
            },
            {
                "SupplierCode": 3,
                "SupplierName": "third supplier",
                "InvoiceShare": 600.000,
                "ProposedShare": 600.000,
                "DepositShare": 600.000
            },
            {
                "SupplierCode": 4,
                "SupplierName": "fourth supplier",
                "InvoiceShare": 668.000,
                "ProposedShare": 668.000,
                "DepositShare": 640.776
            }
        ]
    }
}


Did this page help you?