Skip to main content

Create Session for Invoice Order

The Create Invoice in Checkout Session API facilitates the seamless generation of invoices during the checkout process. This integrationendpoint isallows pivotal for merchants aimingyou to offerexport invoice-basedan paymentorder options,as especiallyan ininvoice regionsto whereFront suchPayment methodsGo. areUpon prevalent.successful submission, it returns:

  • Order UUID
  • Customer UUID
  • Bank ID Verification URL (for customer identity verification)

Key Use CasesRequest

  • E-commerce StoresEndpoint – Offer customers the option to pay by invoice at checkout.
  • Subscription Services – Automatically bill recurring clients via invoice.
  • B2B Transactions – Simplify corporate purchases with instant invoicing.
  • Point of Sale Systems – Generate invoices for in-store or kiosk purchases.
  • Order Management Systems – Integrate invoice creation into backend workflows for automated accounting.

Prerequisites

Before you start the integration, make sure you have:

1. API Access:

  • A valid API key and Bearer Token from Front Payment
  • Access to the demo and production environments

2. Technical Requirements:

  • Ability to make HTTPS API calls
  • Secure storage of tokens and keys
  • Callback endpoints to handle payment status updates

3. Test Environment:

Step 1: Create Invoice

To initiate an invoice order, your system will need to call the following endpoint to generate an order. For private customer this will give a Bank Id Verification Url and for corporate the order will be directly INVOICED.

Endpoint

POST https://demo-api.frontpayment.no/api/v1/connect/orders/invoice/submit
  • Method: POST
  • Authentication

    This endpoint requires a

  • Authorization: Bearer Token<token>
  • for authentication.
    You

    Payload willSchema

    needtoobtainthistokenfromFrontpaymentandincludeitinthe header request.

    BearerYOUR_FRONTPAID_BEARER_TOKEN

    Request

    requestbody JSONobjectcontainingdetailsabout
    Field Type Description
    products.*.name string Required. Product name.
    Authorizationproducts.*.productId stringOptional. Unique identifier (max: 25 chars).
    products.*.quantitynumericRequired. Quantity of yourproduct.
    products.*.ratenumericExample Authorization Header:Required. Unit rate/price.
    Authorization:products.*.discount numeric Optional. Discount applied.
    products.*.tax

    numeric Required. PayloadTax

    Theapplied.

    products.*.amountnumericRequired. Total amount after calculation.
    orderSummary.subTotalnumericRequired. Subtotal of all items.
    orderSummary.totalTaxnumericRequired. Total tax.
    orderSummary.totalDiscountnumericRequired. Total discount.
    orderSummary.grandTotalnumericRequired. Grand total.
    orderDatestringRequired. Order date (timestamp).
    referenceNostringOptional. Reference number.
    customerReferencestringOptional. Customer reference.
    invoiceIntervalnumericOptional. Invoice interval (allowed: 0,1,2).
    separateInvoicesbooleanOptional. Whether invoices should be aseparated.
    invoiceFeeApplicable boolean Required. theWhether order,invoice customer,fee andapplies.
    invoiceMaturitynumericOptional. Invoice maturity period.
    callback.callbackUrlurlOptional. General callback URLs.

    URL.
    callback.successstringRequired. Success callback URL.
    callback.failurestringRequired. Failure callback URL.
    settings.secureDetailsbooleanOptional. Enable secure details.
    orderFromstringOptional. Must be "DAMP" if present.
    fpgoUuidstringOptional. Must exist in App\Models\Order.
    customerDetails.typestringRequired. Customer type (private/corporate).
    customerDetails.countryCodestringRequired. Customer country code.
    customerDetails.msisdnstringRequired. Customer mobile number.
    customerDetails.emailemailRequired. Customer email address.
    customerDetails.namestringRequired. Customer full name.
    customerDetails.personalNumberstringOptional. Required if submitPayment.via=invoice. Must be 11 digits.
    customerDetails.preferredLanguagestringOptional. Preferred language.
    customerDetails.organizationIdstringRequired if corporate. Must be alphanumeric.
    customerDetails.address.streetstringRequired. Street address.
    customerDetails.address.zipstringRequired. ZIP code.
    customerDetails.address.citystringRequired. City.
    customerDetails.address.countrystringRequired. Country code (e.g., "NO").

    Example Request

    {
      "products": [
        {
          "name": "Router",
          "productId": "R_1",
          "quantity": "1",
          "rate": 40,
          "discount": 0,
          "tax": "0",
          "amount": 40
        }
      ],
      "orderSummary": {
        "subTotal": "40",
        "totalTax": "0",
        "totalDiscount": "0.00",
        "grandTotal": "40"
      },
      "orderDate": "1755150488",
      "customerDetails": {
        "type": "private",
        "countryCode": "+47",
        "msisdn": "46567468",
        "email": "[email protected]",
        "name": "Zahidul",
        "preferredLanguage": "en",
        "personalNumber": "28038712383",
        "organizationId": "",
        "address": {
          "street": "Klosterenget 144",
          "zip": "7030",
          "city": "Trondheim",
          "country": "NO"
        }
      },
      "referenceNo": "Dhaka",
      "customerReference": "3500",
      "invoiceInterval": 0,
      "separateInvoices": true,
      "invoiceFeeApplicable": true,
      "invoiceMaturity": 10,
      "callback": {
        "callbackUrl": "https://wp.frontpayment.no/?order_identifier=rRbl1FWZG59o&order_status=success",
        "success": "https://wp.frontpayment.no/?order_identifier=rRbl1FWZG59o&order_status=success",
        "failure": "https://frontpayment.no/?order_identifier=rRbl1FWZG59o&order_status=failed"
      }
    }
    

    Validation Rules

    Ensure your payload adheres to the following validation rules:

    FieldTypeDescription
    products.*.namestringRequired. Name of the product.
    products.*.productIdstringOptional. Unique identifier for the product. (max: 25 chars).
    products.*.quantitynumericRequired. Quantity of the product.
    products.*.ratenumericRequired. Rate per unit of the product.
    products.*.discountnumericOptional. Discount applied to the product.
    products.*.taxnumericRequired. Tax rate (e.g., 0, 12, 15, 25). Unless you have other configuration.
    products.*.amountnumericRequired. Total amount for the product line item.
    orderSummary.subTotalnumericRequired. Subtotal of all products before tax and discount.
    orderSummary.totalTaxnumericRequired. Total tax for the order.
    orderSummary.totalDiscountnumericRequired. Total discount for the order.
    orderSummary.grandTotalnumericRequired. Grand total of the order.
    orderDatestringRequired. Unix timestamp for the Date of the order, which must be current or future date.
    referenceNostringOptional. Reference number.
    customerReferencestringOptional. Customer reference.
    invoiceIntervalnumericOptional. Invoice interval (allowed: 0,1,2).
    separateInvoicesbooleanOptional. Whether invoices should be separated.
    invoiceFeeApplicablebooleanRequired. Whether invoice fee applies.
    invoiceMaturitynumericOptional. If specified, the value must be 10 for Private customers; for Corporate customers, the value may be 14, 30, or 45.
    customerDetails.typestringRequired. Customer type (private/corporate).
    customerDetails.countryCodestringRequired. Country code for the customer's phone number (e.g., "+47").
    customerDetails.msisdnstringRequired. Mobile Subscriber ISDN Number (phone number).
    customerDetails.emailemailRequired. Customer's email address.
    customerDetails.namestringRequired. Customer's full name.
    customerDetails.personalNumberstringRequired Customer's personal identification number, must be 11 characters.
    customerDetails.preferredLanguagestringOptional. Customer preferred language. Available languages are en,no,sv,da,de. If nothing is given it will set default to no.
    customerDetails.organizationIdstringRequired. if corporate. Must be alphanumeric.
    customerDetails.address.streetstringRequired. Street address of the customer.
    customerDetails.address.zipstringRequired. Zip code of the customer's address.
    customerDetails.address.citystringRequired. City of the customer's address.
    customerDetails.address.countrystringRequired. ISO Alpha-2 country code (e.g., NO). Custom validation IsoAlpha2Country applies.
    callback.callbackUrlurlRequired The URL to which Front Payment will send updates. Must be a valid url.
    callback.successurlRequired. The URL to redirect to upon successful payment.Must be a valid url.
    callback.failureurlRequired. The URL to redirect to upon failed payment.Must be a valid url.

    Response

    Example

    Success Response (HTTP 201)

    A successful request will return a 201 Created status with the following JSON payload.

    {
      "status_code": 201,
      "status_message": "OK",
      "message": "orderCreatedSuccessfully",
      "is_data": true,
      "data": {
        "orderUuid": "ODR4286244937",
        "customerUuid": "CSRT3419523642",
        "bankIdUrl": "https://auth.current.bankid.no/precheck/auth?...state=eyJvcmRlclV1aWQiOiJPRFI0Mjg2MjQ0OTM3IiwiY29ubmVjdCI6InllcyJ9"
      }
    }
    

    Other Responses

    Internal Error (500)

    {
      "status_code": 500,
      "status_message": "Internal Dependency Error",
      "message": "Internal Error Occurred Please Try Again Later",
      "is_error": true,
      "errors": {
        "happenedAt": "String",
        "internalErrorDetails": "Array"
      }
    }
    

    Execution Exception (510)

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

    Step 2: Bank ID Verification and Agreement Signing

    After successfully completing Step 1, you may receive one of two responses.

    When customer type is specified as private:

    • You will receive a bankIdUrl in the previous request response. You'll need to redirect the user to this URL, where they will be redirected to a Bank ID verification page to verify their identity.
    • Upon successful Bank ID verification, a credit check will be performed in the background by Front Payment.
    • If the credit check yields a positive score (minimum 315), the user will proceed to a document signing flow to finalize the invoice agreement.
    • Once the document is signed, an invoice will be created, and the user will be redirected to the callback.success URL.

    When customer type is specified as corporate:

    Your order will be invoiced directly, skipping the BankID verification and agreement signing steps.

    Our system will also notify your system of the payment status via the callbackUrl you provided in your initial request.

    The invoice distribution method is determined based on the information provided in the request. The system follows this priority order:

    1. EHF or E-invoice (Preferred) – Requires a valid P-number or organization number.
    2. Email – Used if EHF/E-invoice cannot be delivered.
    3. Postal Mail – Used if no valid email address is available or email delivery fails.

    If none of the above delivery methods are successful, our customer service team will notify the client to resolve the issue.

    Notifications via Callback URL

    For private customer, after BankID verification is completed successfully and for corporate customer immediately after order we will notify your server via the callbackUrl provided by you. For an invoice, our system will also notify you for any future status changes (example: SENT to INVOICED or INVOICED to PAID) in our system via callbackUrl. Follow the link below to learn how to handle callback data from your side.

    Go To Notication Via Callback Url Page