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

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