Send EHF Invoice
With this API endpoint, you can export orders to Front Payment Go and get payment URLs in return.
Endpoint
POST https://demo-api.frontpayment.no/api/v1/connect/orders/invoice/create/ehf
Authentication
This endpoint requires a Bearer Token
for authentication. You will need to obtain this token from Frontpayment and include it in the Authorization
header of your request.
Request Payload
The request body should be a JSON object containing details about the products, order and customer.
{
"products": {
"0": {
"name": "Hair Wash",
"productId": "VFDDF",
"quantity": "1",
"rate": 51,
"discount": 0,
"tax": "0",
"amount": 51
}
},
"orderSummary": {
"subTotal": "51.00",
"totalTax": "0.00",
"totalDiscount": "0.00",
"grandTotal": "51.00"
},
"orderDate": "1754928405",
"customerDetails": {
"countryCode": "+47",
"msisdn": "46567468",
"email": "[email protected]",
"name": "Kari Nordmann",
"organizationId": "123456789,
"address": {
"street": "Luramyrveien 65",
"zip": "4313",
"city": "Sandnes",
"country": "NO"
}
},
"invoiceFeeApplicable": true,
"invoiceReferences": {
"referenceNo": "66346334",
"customerReference": "350530",
"receiptNo": "3535353345",
"invoiceInterval": 0,
"separateInvoices": true,
"invoiceMaturity":10
},
}
Validation Rules
Make sure your request meets the following requirements:
Field | Type | Description |
---|---|---|
products.*.name |
required | string |
Required. Name of the product. |
products.*.productId |
nullable | string |
Nullable. Unique identifier for the product. |
products.*.quantity |
required | numeric |
Required. Quantity of the product. |
products.*.rate |
required | numeric |
Required. Rate per unit of the product. |
products.*.discount |
nullable | numeric |
Nullable. Discount applied to the product. |
products.*.tax |
required | numeric |
Required. Tax rate |
products.*.amount |
required | numeric |
Required. Total amount for the product line item. |
orderSummary.subTotal |
required | numeric |
Required. Subtotal of all products before tax and discount. |
orderSummary.totalTax |
required | numeric |
Required. Total tax for the order. |
orderSummary.totalDiscount |
required | numeric |
Required. Total discount for the order. |
orderSummary.grandTotal |
required | numeric |
Required. Grand total of the order. |
orderDate |
required | string |
Required. Unix timestamp for the Date of the order. |
sendOrderBy.sms |
required | boolean |
Required. true or false |
sendOrderBy.email |
required | boolean |
Required. true or false |
sendOrderBy.invoice |
required | boolean |
Required. true or false |
isCreditCheckAvailable |
required | boolean |
Required. true or false |
invoiceAsPaymentOption |
required | boolean |
Required. true or false |
customerDetails.customerUuid |
nullable | string |
Nullable. |
customerDetails.countryCode |
required | string |
Required. Country code for the customer's phone number (e.g., "+47"). |
customerDetails.msisdn |
required | string |
Required. Mobile Subscriber ISDN Number (phone number). |
customerDetails.email |
required | email |
Required. Customer's email address. |
customerDetails.name |
required | string |
Required. Customer's full name. |
customerDetails.preferredLanguage |
required | string |
Required. Customer's language (e.g., NO , EN ). |
customerDetails.personalNumber |
required | string | max:11 |
Required. Customer's personal identification number, must be 11 characters. |
customerDetails.address.street |
required | string |
Required. Street address of the customer. |
customerDetails.address.zip |
required | string |
Required. Zip code of the customer's address. |
customerDetails.address.city |
required | string |
Required. City of the customer's address. |
customerDetails.address.country |
required |string |
Required. ISO Alpha-2 country code (e.g., NO ). Custom validation IsoAlpha2Country applies. |
invoiceReferences |
nullable | array |
Nullable. This field accepts an array of invoice reference. Can be omitted if there are no invoice references. |
invoiceReferences.referenceNo |
nullable | string |
Nullable. Any reference number for the order. |
invoiceReferences.customerReference |
nullable | string |
Nullable. Any reference for the customer. |
invoiceReferences.receiptNo |
nullable | string |
Nullable. Any number for the receipt. |
invoiceReferences.customerNotes |
nullable | string |
Nullable. Any notes from the customer. |
invoiceReferences.tnc |
nullable | string |
Nullable. Any notes from the customer for terms and conditions. |
internalReferences |
nullable | array |
Nullable . This field accepts an array of internal reference. Can be omitted if there are no internal reference. |
internalReferences.referenceNo |
nullable | string |
Nullable. Any reference number . |
internalReferences.notes |
nullable | string |
Nullable. Any string for interenal refernce note. |
Response
A successful request will return a 201 Created
status with the following JSON payload:
{
"status_code": 201,
"status_message": "OK",
"message": "orderAddedSuccessfully",
"is_data": false,
"data": {
"uuid": "ODR3506777330",
"customerUuid": "CSRT3463048878"
}
}
API returns a 500
or 510
error, it means something failed on the server side
{
"status_code": 500,
"status_message": "Internal Dependency Error",
"message": "internalErrorOccurredPleaseTryAgainLater",
"is_error": true,
"errors": {
"happenedAt": "String",
"internalErrorDetails": "Array"
}
}
{
"status_code": 510,
"status_message": "Execution Exception Occurred",
"message": "somethingWentWrong",
"is_error": true,
"errors": "Array"
}