Skip to main content

Send EHF Invoice

With this API endpoint, you can createexport orders forto corporateFront customersPayment onlyGo and receiveget thepayment order UUID and customer UUIDURLs in return.


Endpoint

POST https://demo-api.frontpayment.no/api/v1/connect/orders/ehf/create

Authorization

Authentication

ToThis accessendpoint this endpoint, includerequires 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.

Example Authorization Header: Authorization: Bearer YOUR_FRONTPAID_BEARER_TOKEN

Request Payload

SendThe therequest followingbody parametersshould asbe a JSON object incontaining details about the requestproducts, body: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": "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": 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 required | string Required. Name of the product.
products.*.productId nullable | string OptionalNullable. 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 OptionalNullable. Discount applied to the product.
products.*.tax required | numeric Required. Tax rate must be (e.g., 0, 12, 15, 25), Unless you have other configuration.
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.
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 emailrequired | string Required. Customer's full name.
customerDetails.preferredLanguage nullable | string Optional. Customer preferred language. Available languages are en, no, sv, da, de. If nothing is given it will set default to no.
customerDetails.organizationId required | string Required. Organization identification number, must contain only numbers and cannot contain spacesspaces.
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.
invoiceInterval sometimes | numeric Optional. Default value is = 0. You can change it to 0, 1, 2. Daily = 0, Once a month = 1, Twice a month = 2.
invoiceFeeApplicable required | boolean Required. Default value is true.
invoiceMaturity sometimes | numeric Optional. Default value is 14. if you want to set the value then give your value 014, 30 or 1445.
separateInvoices sometimes | boolean Optional. Default value is true.
referenceNo nullable | string Nullable. Any reference number.
customerReference nullable | string Nullable. Any value for customer reference.reference .
callback.callbackUrl urlrequired | url:http,https Required. To receive real-time notifications on order state changes, you must provide a callback url. This is an server-to-server HTTP 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.

Go To Notication Via Callback Url Page