Skip to main content

Create Session for One - Time Payment Link

With thisThis API endpoint,endpoint allows you canto exportsubmit new orders to Front Payment Go and getreceive a payment URLsURL in return. 


Request

:
  • Method:
  • POST
  • Authorization:
  • Bearer <token>

    Error

  • Endpoint
  • :https://demo-api.frontpayment.no/api/v1/connect/orders/regular/submit
    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|in:0,12,15,25 (Unless you have other configuration)',
    'products.*.amount' => 'required|numeric',
    'orderSummary.subTotal' => 'required|numeric',
    'orderSummary.totalTax' => 'required|numeric',
    'orderSummary.totalDiscount' => 'required|numeric',
    'orderSummary.grandTotal' => 'required|numeric',
    'orderDate' => 'required|string',
    'dueDateForPaymentLink' => 'required|string',
    'sendOrderBy.sms' => 'required|boolean',
    'sendOrderBy.email' => 'required|boolean',
    'sendOrderBy.invoice' => 'required|boolean',
    'isCreditCheckAvailable' => 'required|boolean',
    'invoiceAsPaymentOption' => 'required|boolean',
    'customerDetails.customerUuid' => 'required|nullable|string',
    'customerDetails.type' => 'required|nullable|string|in:private,corporate',
    'customerDetails.countryCode' => 'required|nullable|string',
    'customerDetails.msisdn' => 'required|nullable|string',
    'customerDetails.email' => 'required|nullable|email',
    'customerDetails.name' => 'required|string',
    'customerDetails.preferredLanguage' => 'required|string',
    'customerDetails.personalNumber' => 'nullable|string|size:11',
    'customerDetails.organizationId' => 'required_if:customerDetails.type,corporate|nullable|string|regex:/^[a-zA-Z0-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',
    'invoiceReferences' => 'nullable|array',
    'invoiceReferences.referenceNo' => 'nullable|string',
    'invoiceReferences.customerReference' => 'nullable|string',
    'invoiceReferences.receiptNo' => 'nullable|string',
    'invoiceReferences.customerNotes' => 'nullable|string',
    'invoiceReferences.tnc' => 'nullable|string',
    'internalReferences' => 'nullable|array',
    'internalReferences.referenceNo' => 'nullable|string',
    'internalReferences.notes' => 'nullable|string',
    'submitPayment' => 'required|array',
    'submitPayment.via' => 'required|string|in:vipps,visa,mastercard,applepay,googlepay',
    'callback' => 'required|array',
    'callback.callbackUrl' => 'nullable|string|url',
    'callback.success' => 'required|string',
    'callback.failure' => 'required|string'

    Example Payload

    :
    {
      "products": [
        {
          "name": "Router",
          "productId": "R_1",
          "quantity": "1",1,
          "rate": 4500,
          "discount": 0,
          "tax": "12",12,
          "amount": 4500
        }
      ],
      "orderSummary": {
        "subTotal": "4017.86",86,
        "totalTax": "482.14",14,
        "totalDiscount": "0.00",00,
        "grandTotal": "4500.00"00
      },
      "orderDate": "2 Aug, 2023"1754556624",
      "dueDateForPaymentLink": "1691125906",
        "sendOrderBy"invoiceReferences": {
        "sms"referenceNo": false,
            "email": false,
            "invoice": falsenull,
      },
      "invoiceAsPaymentOption"withCustomer": true,
        "isCreditCheckAvailable": false,
      "customerDetails": {
        "type": "private",
        "countryCode": "+47",
        "msisdn": "46567468",
        "email": "[email protected]"[email protected]",
        "name": "Kari Nordmann",
        "preferredLanguage": "en",
        "personalNumber": null,
            "organizationId": null,
        "address": {
          "street": "Luramyrveien 65",
          "zip": "4313",
          "city": "Sandnes",
          "country": "NO"
        }
      },
      "invoiceReferences": null,
        "internalReferences": null,
        "submitPayment": {
        "via": "visa",
            "currency": "NOK"
      },
      "callback": {
        "callbackUrl": "https://www.frontpayment.no/your-callback-url.com/callback",
        "success": "https://www.frontpayment.no/your-callback-url.com/success",
        "failure": "https://www.frontpayment.no/your-callback-url.com/failure"
      }
    }
    


    Payload Schema

    FieldTypeDescription
    productsarrayAn array of product objects.
    Response Structureproducts.*.name :string The
    {name "status_code":of 202,the "status_message":product. "OK",
        "message": "Order Submitted Successfully",
        "is_data": true,
        "data": {
          "orderUuid": "String"
          "paymentUrl": "String"
        }
    }
    

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

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


    Required.
    Example Responseproducts.*.productId :string The unique ID of the product. Optional.
    products.*.quantitynumericThe number of units. Required.
    products.*.ratenumericThe price per unit. Required.
    products.*.discountnumericAny discount applied to the product. Optional.
    products.*.taxnumericThe tax percentage. Required. Must be one of 0, 12, 15, or 25 unless otherwise configured.
    products.*.amountnumericThe total amount for this product. Required.
    orderSummaryobjectAn object containing the summary of the order.
    orderSummary.subTotalnumericThe subtotal of the order before tax and discounts. Required.
    orderSummary.totalTaxnumericThe total tax for the order. Required.
    orderSummary.totalDiscountnumericThe total discount for the order. Required.
    orderSummary.grandTotalnumericThe final total of the order. Required.
    orderDatestringUnix timestamp for the Date of the order, which must be current or future date. Required.
    invoiceReferences.referenceNostringAny reference information from your side. example: Order Uuid generated from your application.
    withCustomerbooleanIf withCustomer value is true then you must provide customer details Required
    customerDetailsobjectAn object containing the customer's details.
    customerDetails.typestringThe customer type. Optional. Must be either private or corporate.
    customerDetails.countryCodestringThe customer's phone country code. Optional.
    customerDetails.msisdnstringThe customer's phone number. Optional.
    customerDetails.emailstringThe customer's email address. Optional.
    customerDetails.namestringThe customer's name. Required.
    customerDetails.preferredLanguagestringThe customer's preferred language. Required.
    customerDetails.personalNumberstringThe customer's personal ID number (must be 11 characters). Optional.
    customerDetails.addressobjectAn object containing the customer's address. Required.
    customerDetails.address.streetstringThe street name. Required.
    customerDetails.address.zipstringThe postal code. Required.
    customerDetails.address.citystringThe city. Required.
    customerDetails.address.countrystringThe country code in ISO Alpha 2 format. Required.
    invoiceReferences.receiptNostringThe receipt number. Optional.
    invoiceReferences.customerNotesstringNotes for the customer. Optional.
    invoiceReferences.tncstringTerms and conditions. Optional.
    internalReferencesobjectAn object for internal reference information. Optional.
    internalReferences.referenceNostringAn internal reference number. Optional.
    internalReferences.notesstringInternal notes. Optional.
    submitPaymentobjectAn object to define the payment method. Required.
    submitPayment.viastringThe payment method. Required. Must be vipps, visa, mastercard, applepay, or googlepay.
    callbackobjectAn object for callback URLs. Required.
    callback.callbackUrlstringThe URL to which Front Payment will send updates. Optional.
    callback.successstringThe URL to redirect to upon successful payment. Required.
    callback.failurestringThe URL to redirect to upon failed payment. Required.

    Response Structure

    Success Response (HTTP 202)

    {
      "status_code": 202,
      "status_message": "OK",
      "message": "Order Submitted Successfully",
      "is_data": true,
      "data": {
        "orderUuid": "ODR123456789",
        "paymentUrl": "https://v1.checkout.bambora.com/a403d3df20af4888bd8f7dd38f3cd7f1"
      }
    }
    

    Handling Callback

    Example: https://stg-api.frontpayment.no/api/v1/tests-callback?orderUuid=ODR10293993&status=PAID&createdAt=1753079134×tamp=1753079134&checksum=e076f553a751a0d04b929d40f086d4cb89ae3942a5bc170ccad336b3ab185ce9

     

    Responses

    ExampleHTTP Parameters:500: Internal Dependency Error

    ParameterDescription
    orderUuidUnique order identifier 
    status Payment status ('SENT',`PAID`, `FAILED`, etc.)
    createdAt UNIX timestamp when the payment occurred
    checksumSHA-256 hash to verify data integrity 

    Checksum Verification:

    To verify the integrity of the callback data:

    1. Extract the values of `orderUuid`, `status`, and `createdAt` from the callback request.
    2. Concatenate them in the following order:

     

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


    3.HTTP Generate510: aExecution SHA-256 hashException of the resulting string.
    4. Compare the generated hash with the `checksum` provided in the callback.

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

    Notifications via Callback URL

    Go To Notication Via Callback Url Page

    ✅ If they match: The callback is valid.
    ❌ If they don't match: The callback may have been tampered with—do not trust the data.