Create Invoice Rest API

you can create invoice using the following API
POST /ApiInvoices/CreateInvoiceIso

INPUT PARAMETER
## Invoice Details
Parameter Description
Invoice ValueProduct Unit Price * Quantity of Products.
- Please note merchant should manually calculate and enter the subtotal.
Customer NameCustomer Name. (Required)
Customer BlockCustomer House Block Number
Customer StreetCustomer House Street Number
Customer House Building NoCustomer House Building Number.
Customer Civil IdCustomer Civil Id.
Customer AddressCustomer Address.
Customer ReferenceCustomer Reference ID
Display Currency Iso AlphaDisplay 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 IdCounty with Phone Code.
Please note user should enter value of each Country Code. (Each Country Codes differentiated by a Value).
Customer MobileCustomer Mobile Number "Without Country Code".
Customer EmailCustomer Email ID.
Send Invoice OptionSend 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 IdProduct Id. (Optional)
- Vendor can enter the Product Id, once it is created through MyFatoorah system.
Product NameProduct Name. (Required)
QuantityProduct Quantity. (Required)
Unit PriceProduct Unit Price. (Required)
Call Back URLReturn URL. (Required)
- "Should be in valid URL format".
LanguageInvoice Language. (Required)
- Please note user should enter value of each Language. Each Language (Arabic or English) options differentiated by a Value.
Expire DateInvoice 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 FieldsAPI 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 URLError URL (Required) "Should be Valid URL format".
RESPONSE PARAMETER
Parameter Description
IDOrder ID
Response MessageResponse Message.
Redirect URLURL to be redirected after success message Payment URL with all Payment Methods.
Payment Methods
Payment Method NamePayment Method Name
Payment Method URLPayment Method URL.
Please not User will be directly access to the Payment Gateway instead of MyFatoorah payment landing page
Payment Method CodePayment Method Code
API Custom FieldsAPI 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"
}