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.
Many calls to GetPaymentStatus
GetPaymentStatus endpoint has a rate limit. If you are going to send a lot of requests to the endpoint in a short duration, please contact the account manager to increase the rate limit for your account.
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 InProgress Succss Failed Canceled Authorize |
TransationValue | string | The value of the transaction |
CustomerServiceCharge | string | The service charges considered on the customer during the transaction |
TotalServiceCharge | string | Total service charge deducted from MyFatoorah side |
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 |
VatAmount | float | The value of the VAT amount for 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 the information about the invoice transactions and suppliers - if exist - and the deposit amount of each supplier.
{
"Key": "2725229",
"KeyType": "InvoiceId"
}
{
"IsSuccess": true,
"Message": "",
"ValidationErrors": null,
"Data": {
"InvoiceId": 2725229,
"InvoiceStatus": "Paid",
"InvoiceReference": "2023009517",
"CustomerReference": "",
"CreatedDate": "2023-09-14T13:49:17.623",
"ExpiryDate": "September 24, 2023",
"ExpiryTime": "13:49:17.623",
"InvoiceValue": 250,
"Comments": "",
"CustomerName": "MyFatoorah",
"CustomerMobile": null,
"CustomerEmail": "[email protected]",
"UserDefinedField": null,
"InvoiceDisplayValue": "0.000 KD",
"DueDeposit": 249.25,
"DepositStatus": "Not Deposited",
"InvoiceItems": [],
"InvoiceTransactions": [
{
"TransactionDate": "2023-09-14T13:49:49.8333333",
"PaymentGateway": "KNET",
"ReferenceId": "325710000447",
"TrackId": "14-09-2023_1702585",
"TransactionId": "325710007573919",
"PaymentId": "100325710000064334",
"AuthorizationId": "B89997",
"TransactionStatus": "Succss",
"TransationValue": "250.000",
"CustomerServiceCharge": "5.000",
"TotalServiceCharge": "5.000",
"DueValue": "255.000",
"PaidCurrency": "KD",
"PaidCurrencyValue": "255.000",
"VatAmount": "0.750",
"IpAddress": "197.58.83.203",
"Country": "Egypt",
"Currency": "KD",
"Error": null,
"CardNumber": null,
"ErrorCode": ""
}
],
"Suppliers": []
}
}
{
"IsSuccess": true,
"Message": "",
"ValidationErrors": null,
"Data": {
"InvoiceId": 2817877,
"InvoiceStatus": "Paid",
"InvoiceReference": "2023016636",
"CustomerReference": null,
"CreatedDate": "2023-10-04T14:40:56.723",
"ExpiryDate": "February 1, 2024",
"ExpiryTime": "14:40:56.723",
"InvoiceValue": 200,
"Comments": null,
"CustomerName": "Anonymous",
"CustomerMobile": "+965",
"CustomerEmail": null,
"UserDefinedField": null,
"InvoiceDisplayValue": "200.000 KD",
"DueDeposit": 104.894,
"DepositStatus": "Not Deposited",
"InvoiceItems": [],
"InvoiceTransactions": [
{
"TransactionDate": "2023-10-04T14:41:44.65",
"PaymentGateway": "VISA/MASTER",
"ReferenceId": "327711284480",
"TrackId": "04-10-2023_1722745",
"TransactionId": "284480",
"PaymentId": "07072817877172274574",
"AuthorizationId": "243320",
"TransactionStatus": "Succss",
"TransationValue": "200.000",
"CustomerServiceCharge": "0.000",
"TotalServiceCharge": "4.440",
"DueValue": "200.000",
"PaidCurrency": "KD",
"PaidCurrencyValue": "200.000",
"VatAmount": "0.666",
"IpAddress": "41.35.104.74",
"Country": "Egypt",
"Currency": "KD",
"Error": null,
"CardNumber": "545454xxxxxx5454",
"ErrorCode": ""
}
],
"Suppliers": [
{
"SupplierCode": 1,
"SupplierName": "Khaled",
"InvoiceShare": 200,
"ProposedShare": 90,
"DepositShare": 90
}
]
}
}
Updated 23 days ago