Send EHF Invoice
With this API endpoint, you can exportcreate orders tofor Frontcorporate Paymentcustomers Goonly and getreceive paymentthe URLsorder UUID and customer UUID in return.
Endpoint
POST https://demo-api.frontpayment.no/api/v1/connect/orders/ehf/create
Authentication
Authorization
ThisTo endpointaccess requiresthis endpoint, include a Bearer Token
for authentication. You will need to obtain this token from Frontpayment and include it in the Authorization
header of your request. You can obtain this token from Frontpayment.
Request Payload
TheSend requestthe bodyfollowing shouldparameters beas a JSON object containing details aboutin the products,request order and customer.body:
{
"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": "1703040812",
"customerDetails": {
"countryCode": "+47",
"msisdn": "46567468",
"email": "[email protected]",
"name": "Kari Nordmann",
"preferredLanguage": "en",
"organizationId": "123456789,
"address": {
"street": "Luramyrveien 65",
"zip": "4313",
"city": "Sandnes",
"country": "NO"
}
},
"invoiceInterval": 0,
"invoiceMaturity": 14,10,
"invoiceFeeApplicable": true,
"separateInvoices": true,
"referenceNo": null,
"customerReference": null,
"callback": {
"callbackUrl": "https://example.com/callback-url"
}
}
Validation Rules
Make sure your request meets the following requirements:
Field | Type | Description |
---|---|---|
products.*.name |
string |
Required |
products.*.productId |
string |
|
products.*.quantity |
numeric |
Required |
products.* |
numeric |
Required |
products.*.discount |
numeric |
|
products.*.tax |
numeric |
Required0 , 12 , 15 , 25 ), Unless you have other configuration. |
products.*.amount |
numeric |
Required |
orderSummary.subTotal |
numeric |
Required |
orderSummary.totalTax |
numeric |
Required |
orderSummary.totalDiscount |
numeric |
Required |
orderSummary.grandTotal |
numeric |
Required |
orderDate |
string |
Required |
customerDetails.countryCode |
string |
Required |
customerDetails.msisdn |
string |
Required |
customerDetails.email |
email |
Required |
customerDetails.name |
|
Required |
customerDetails.preferredLanguage |
string |
Optionalen , no , sv , da , de . If nothing is given it will set default to no . |
customerDetails.organizationId |
string |
Required |
customerDetails.address.street |
string |
Required |
customerDetails.address.zip |
string |
Required |
customerDetails.address.city |
string |
Required |
customerDetails.address.country |
string |
RequiredNO ). Custom validation IsoAlpha2Country applies. |
invoiceInterval |
numeric |
Optional0 . You can change it to 0 , 1 , 2 . Daily = 0 , Once a month = 1 , Twice a month = 2 . |
invoiceFeeApplicable |
boolean |
Requiredtrue . |
invoiceMaturity |
numeric |
Optional14 . if you want to set the value then give your value
or . |
separateInvoices |
boolean |
Optionaltrue . |
referenceNo |
string |
Nullable |
customerReference |
string |
Nullable |
callback.callbackUrl |
|
RequiredHTTP GET request. |
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"
}
Notifications via Callback URL
The callbackUrl
is an endpoint on your server that our system will call via an HTTP GET
request whenever the status of the specified order changes from its initial state.
See the link below to understand how to work with the callback URL on your side and how to verify the request sent from our side.