Create Invoice Rest API
you can create invoice using the following API
POST /ApiInvoices/CreateInvoiceIso
INPUT PARAMETER | |
---|---|
## Invoice Details | |
Parameter | Description |
Invoice Value | Product Unit Price * Quantity of Products. - Please note merchant should manually calculate and enter the subtotal. |
Customer Name | Customer Name. (Required) |
Customer Block | Customer House Block Number |
Customer Street | Customer House Street Number |
Customer House Building No | Customer House Building Number. |
Customer Civil Id | Customer Civil Id. |
Customer Address | Customer Address. |
Customer Reference | Customer Reference ID |
Display Currency Iso Alpha | Display Currency Iso Alpha Display Currency in Invoice. Note: User should enter value of each Display Currency. (Each Display Currency differentiated by a Value). Invoice Value will be considering based on Display Currency Value and converting to KD. |
Country Code Id | County with Phone Code. Please note user should enter value of each Country Code. (Each Country Codes differentiated by a Value). |
Customer Mobile | Customer Mobile Number "Without Country Code". |
Customer Email | Customer Email ID. |
Send Invoice Option | Send Invoice Options. (SMS, Email and Link) - Please note user should enter value of each Invoice option. Each sending options differentiated by a Value. |
## Invoice Item Details | |
Product Id | Product Id. (Optional) - Vendor can enter the Product Id, once it is created through MyFatoorah system. |
Product Name | Product Name. (Required) |
Quantity | Product Quantity. (Required) |
Unit Price | Product Unit Price. (Required) |
Call Back URL | Return URL. (Required) - "Should be in valid URL format". |
Language | Invoice Language. (Required) - Please note user should enter value of each Language. Each Language (Arabic or English) options differentiated by a Value. |
Expire Date | Invoice Expiry Date Please note user should enter the future date and time as per the below format. Date: YYYY-MM-DD Time: HH:MM:SS |
API Custom Fields | API Custom Fields. Field dedicated to integration with schools. Field to send some data related with school student. Note: User can fill any value by comma separated values Example: "ApiCustomFileds" : "StudentAge=15, StudentGrade=100, StudentFileNumber=10". |
Error URL | Error URL (Required) "Should be Valid URL format". |
RESPONSE PARAMETER | |
---|---|
Parameter | Description |
ID | Order ID |
Response Message | Response Message. |
Redirect URL | URL to be redirected after success message Payment URL with all Payment Methods. |
Payment Methods | |
Payment Method Name | Payment Method Name |
Payment Method URL | Payment Method URL. Please not User will be directly access to the Payment Gateway instead of MyFatoorah payment landing page |
Payment Method Code | Payment Method Code |
API Custom Fields | API Custom Fields |
Sample Request Body
{
"InvoiceValue": 1200,
"CustomerName": "Customer01",
"CustomerBlock": "string",
"CustomerStreet": "string",
"CustomerHouseBuildingNo": "string",
"CustomerCivilId": "string",
"CustomerAddress": "string",
"CustomerReference": "string",
"DisplayCurrencyIsoAlpha": "KWD",
"CountryCodeId": 1,
"CustomerMobile": "99999999",
"CustomerEmail": "[email protected]",
"SendInvoiceOption": 3,
"InvoiceItemsCreate": [
{
"ProductId": null,
"ProductName": "Product01",
"Quantity": 12,
"UnitPrice": 100
}
],
"CallBackUrl": "https://www.flipkart.com/",
"Language": 2,
"ExpireDate": "2019-01-22T09:08:12.624Z",
"ApiCustomFileds": "string",
"ErrorUrl": "https://www.amazon.in/"
}
Sample Response body
{
"Id": 5059,
"IsSuccess": true,
"Message": "Record Created Successfully!",
"RedirectUrl": "https://demo.MyFatoorah.com/ie/020479505932",
"FieldsErrors": null,
"PaymentMethods": [
{
"PaymentMethodName": "KNET",
"PaymentMethodUrl": "https://demo.MyFatoorah.com/En/PayInvoice/Checkout?invoiceKey=020479505932&paymentGatewayId=1",
"PaymentMethodCode": "kn"
},
{
"PaymentMethodName": "VISA/MASTER",
"PaymentMethodUrl": "https://demo.MyFatoorah.com/En/PayInvoice/Checkout?invoiceKey=020479505932&paymentGatewayId=6",
"PaymentMethodCode": "vm"
}
],
"ApiCustomFileds": "string"
}
Updated almost 5 years ago