Skip to main content

Send EHF Invoice

With this API endpoint, you can export orders to Front Payment Go and get payment URLs in return. 


Endpoint

POST 

Authentication

This

endpoint

The

API

returns a
Endpoint:https://demo-api.frontpayment.no/api/v1/connect/orders/invoice/create/ehf
Method:POST
Authorization:Bearer
Payload Validations:
'products.*.name' => 'required|string',
'products.*.productId' => 'nullable|string',
'products.*.quantity' => 'required|numeric',
'products.*.rate' => 'required|numeric',
'products.*.discount' => 'nullable|numeric',
'products.*.tax' => 'required|numeric',
'products.*.amount' => 'required|numeric',
'orderSummary.subTotal' => 'required|numeric',
'orderSummary.totalTax' => 'required|numeric',
'orderSummary.totalDiscount' => 'required|numeric',
'orderSummary.grandTotal' => 'required|numeric',
'orderDate' => 'required|string',
'customerDetails.countryCode' => 'required|string',
'customerDetails.msisdn' => 'required|string',
'customerDetails.email' => 'required|email',
'customerDetails.name' => 'required|string',
'customerDetails.organizationId' => 'required|string|regex:/^\d{9}$/',
'customerDetails.address' => 'required|array',
'customerDetails.address.street' => 'required|string',
'customerDetails.address.zip' => 'required|string',
'customerDetails.address.city' => 'required|string',
'customerDetails.address.country' => 'required|string|in:ISO Alpha 2',
'invoiceFeeApplicable' => 'required|boolean',
'invoiceReferences' => 'nullable|array',
'invoiceReferences.referenceNo' => 'nullable|string',
'invoiceReferences.customerReference' => 'nullable|string',
'invoiceReferences.receiptNo' => 'nullable|string'
'invoiceInterval' => 'sometimes|numeric|in:0,1,2',
'separateInvoices' => 'sometimes|boolean',
'invoiceFee' => 'sometimes|numeric',
'invoiceMaturity' => 'sometimes|numeric',
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.

Example Authorization Header: Authorization: Bearer YOUR_FRONTPAID_BEARER_TOKEN

Request Payload

: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": {
        "type": "corporate",
        "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:

FieldTypeDescription
products.*.namerequired | stringRequired. Name of the product.
Response Structureproducts.*.productId :nullable | string Nullable.
{Unique "status_code":identifier 201,for "status_message":the "OK",
    "message": "orderAddedSuccessfully",
    "is_data": true,
    "data": "Array"
}

{ "status_code": 510, "status_message": "Execution Exception Occurred", "message": "somethingWentWrong", "is_error": true, "errors": "Array" }


product.
Example Responseproducts.*.quantity :required | numeric Required. Quantity of the product.
products.*.raterequired | numericRequired. Rate per unit of the product.
products.*.discountnullable | numericNullable. Discount applied to the product.
products.*.taxrequired | numericRequired. Tax rate
products.*.amountrequired | numericRequired. Total amount for the product line item.
orderSummary.subTotalrequired | numericRequired. Subtotal of all products before tax and discount.
orderSummary.totalTaxrequired | numericRequired. Total tax for the order.
orderSummary.totalDiscountrequired | numericRequired. Total discount for the order.
orderSummary.grandTotalrequired | numericRequired. Grand total of the order.
orderDaterequired | stringRequired. Unix timestamp for the Date of the order.
dueDateForPaymentLinkrequired | stringRequired. Unix timestamp for the due date of the payment link.
sendOrderBy.smsrequired | booleanRequired. true or false
sendOrderBy.emailrequired | booleanRequired. true or false
sendOrderBy.invoicerequired | booleanRequired. true or false
isCreditCheckAvailablerequired | booleanRequired. true or false
invoiceAsPaymentOptionrequired | booleanRequired. true or false
customerDetails.customerUuidnullable | stringNullable.
customerDetails.countryCoderequired | stringRequired. Country code for the customer's phone number (e.g., "+47").
customerDetails.msisdnrequired | stringRequired. Mobile Subscriber ISDN Number (phone number).
customerDetails.emailrequired | emailRequired. Customer's email address.
customerDetails.namerequired | stringRequired. Customer's full name.
customerDetails.preferredLanguagerequired | stringRequired. Customer's language (e.g., NO, EN).
customerDetails.personalNumberrequired | string | max:11Required. Customer's personal identification number, must be 11 characters.
customerDetails.address.streetrequired | stringRequired. Street address of the customer.
customerDetails.address.ziprequired | stringRequired. Zip code of the customer's address.
customerDetails.address.cityrequired | stringRequired. City of the customer's address.
customerDetails.address.countryrequired|stringRequired. ISO Alpha-2 country code (e.g., NO). Custom validation IsoAlpha2Country applies.
invoiceReferencesnullable | arrayNullable. This field accepts an array of invoice reference. Can be omitted if there are no invoice references.
invoiceReferences.referenceNonullable | stringNullable. Any reference number for the order.
invoiceReferences.customerReferencenullable | stringNullable. Any reference for the customer.
invoiceReferences.receiptNonullable | stringNullable. Any number for the receipt.
invoiceReferences.customerNotesnullable | stringNullable. Any notes from the customer.
invoiceReferences.tncnullable | stringNullable. Any notes from the customer for terms and conditions.
internalReferencesnullable | arrayNullable . This field accepts an array of internal reference. Can be omitted if there are no internal reference.
internalReferences.referenceNonullable | stringNullable. Any reference number .
internalReferences.notesnullable | stringNullable. 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"
    }
}

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"
}