Skip to main content

Create Session for One - Time Payment Link

This API endpoint allows you to submit new orders to Front Payment and receive a payment URL in return.


Step 1: Create a Payment Link

To initiate a payment, your system will need to call our create endpoint to generate a payment link. This link will redirect your users to our secure hosted checkout page.

Endpoint

POST https://demo-api.frontpayment.no/api/v1/connect/orders/regular/submit

Authorization

This endpoint 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

The request body should be a JSON object containing details about the order, customer, and callback URLs.

{
  "products": [
    {
      "name": "Test Product",
      "productId": "1234",
      "quantity": 1,
      "rate": 4500,
      "discount": 0,
      "tax": 12,
      "amount": 4500
    }
  ],
  "orderSummary": {
    "subTotal": 4017.86,
    "totalTax": 482.14,
    "totalDiscount": 0.00,
    "grandTotal": 4500.00,
    "shippingCost": 0.00
  },
  "referenceNo": "",
  "customerReference": "",
  "orderDate": "1754556624",
  "withCustomer": true,
  "customerDetails": {
    "type": "private",
    "countryCode": "+47",
    "msisdn": "46567468",
    "email": "[email protected]",
    "name": "Kari Nordmann",
    "preferredLanguage": "en",
    "personalNumber": null,
    "address": {
      "street": "Luramyrveien 65",
      "zip": "4313",
      "city": "Sandnes",
      "country": "NO"
    }
  },
  "submitPayment": {
    "via": "visa"
  },
  "callback": {
    "callbackUrl": "https://your-callback-url.com/callback",
    "success": "https://your-callback-url.com/success",
    "failure": "https://your-callback-url.com/failure"
  }
}

Validation Rules

Ensure your payload adheres to the following validation rules:

Field Type Description
products.*.name string Required. The name of the product.
products.*.productId string Optional. The unique ID of the product.
products.*.quantity numeric Required. The number of units.
products.*.rate numeric Required. The price per unit.
products.*.discount numeric Optional. Any discount applied to the product.
products.*.tax numeric Required. The tax percentage. Must be one of `0`, `12`, `15`, or `25` unless otherwise configured.
products.*.amount numeric Required. The total amount for this product.
orderSummary.subTotal numeric Required. The subtotal of the order before tax and discounts.
orderSummary.totalTax numeric Required. The total tax for the order.
orderSummary.totalDiscount numeric Required. The total discount for the order.
orderSummary.grandTotal numeric Required. The final total of the order.
orderSummary.shippingCost numeric Optional. Shipping cost of order.
orderDate string Required. Unix timestamp for the Date of the order, which must be current or future date.
referenceNo string Optional. Any reference information from your side. example: Order Uuid generated from your application.
customerReference string Optional. Customer reference
withCustomer boolean Required. If `withCustomer` value is true then you must provide customer details
customerDetails.type string Optional. The customer type. Must be either `private` or `corporate`.
customerDetails.countryCode string Optional. The customer's phone country code.
customerDetails.msisdn string Optional. The customer's phone number.
customerDetails.email string Optional. The customer's email address.
customerDetails.name string Required. The customer's name.
customerDetails.preferredLanguage string Required. Customer preferred language. Available languages are en,no,sv,da,de. If nothing is given it will set default to no.
customerDetails.personalNumber string Optional. The customer's personal ID number (must be 11 characters).
customerDetails.address object Required. An object containing the customer's address.
customerDetails.address.street string Required. The street name.
customerDetails.address.zip string Required.The postal code.
customerDetails.address.city string Required. The city.
customerDetails.address.country string Required. The country code in ISO Alpha 2 format.
submitPayment.via string Required. The payment method. Must be `vipps`, `visa`, `mastercard`, `applepay`, or `googlepay`.
callback.callbackUrl url Required. The URL to which Front Payment will send updates.Must be a valid url.
callback.success url Required. The URL to redirect to upon successful payment.Must be a valid url.
callback.failure url Required. The URL to redirect to upon failed payment.Must be a valid url.

Response

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": "Order Submitted Successfully",
  "is_data": true,
  "data": {
    "orderUuid": "ODR123456789",
    "customerUuid": "CSRT40567996",
    "paymentUrl": "https://v1.checkout.bambora.com/a403d3df20af4888bd8f7dd38f3cd7f1"
  }
}

Error Responses

HTTP 500: Internal Dependency Error

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

HTTP 510: Execution Exception

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