Skip to main content

Create Session for Reservation

With this API endpoint, you can export reservations to Front Payment Go and get checkout URLs in return. 

Step

1:SubmitReservation

Third-party

submit

Authentication:

ThisendpointrequiresaBearer

Validation Rules

Endpoint :systems can create a reservation and generate a payment link by calling the following endpoint.

Endpoint:
POST https://demo-api.frontpayment.no/api/v1/connect/reservations/create

Method : POST
Authorization:Bearer
Payload Validations:
'customerDetails' => 'required|array',
'customerDetails.customerUuid' => 'required|string',
'customerDetails.type' => 'required|string|in:private,corporate',
'customerDetails.countryCode' => 'required|string',
'customerDetails.msisdn' => 'required|string',
'customerDetails.email' => 'required|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',
'orderDate' => 'required|string',
'dueDateForPaymentLink' => 'required|string',
'referenceNo' => 'nullable|string',
'customerReference' => 'nullable|string',
'sendOrderBy' => 'required|array',
'sendOrderBy.sms' => 'required|boolean',
'sendOrderBy.email' => 'required|boolean',
'products' => 'required|array',
'products.*.name' => 'required|string',
'products.*.productId' => 'nullable|string',
'products.*.rate' => 'required|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.grandTotal' => 'required|numeric',
'chargeValidity' => 'nullable|string|regex:/^\d+$/',   // charge will be availableToken for 90authorization.

days
if null given 'customerNotes' => 'nullable|string', 'tnc' => 'nullable|string', 'submitPayment' => 'required|array', 'submitPayment.via' => 'required|string|in:visa,mastercard', 'callback' => 'nullable|array', 'callback.success' => 'nullable|string', 'callback.failure' => 'nullable|string', 'settings' => 'sometimes|array', 'settings.isChargePartiallyRefundable' => 'sometimes|boolean'
Example

Request Payload

:Example
{
  "customerDetails": {
    "uuid": "",
    "type": "private",
    "countryCode": "+47",
    "msisdn": "46567468",
    "email": "[email protected]"[email protected]",
    "name": "Kari Nordmann"Nafees",
    "preferredLanguage": "en",
    "personalNumber": null,
    "organizationId": null,
    "address": {
      "street": "Luramyrveien 65"Dhaka",
      "zip": "4313"3500",
      "city": "Sandnes"Cumilla",
      "country": "NO"
    }
  },
  "orderDate": "1720 Sep,Aug, 2023"2024",
  "dueDateForPaymentLink": "1695041918"1724294524",
  "referenceNo": null,
  "customerReference": null,
  "sendOrderBy": {
    "sms": false,
    "email": truefalse
  },
  "products": {
    "0": {
      "name": "Test",
      "productId": null,
      "rate": 1000,
      "tax": "0",
      "amount": 1000
    }
  },
  "chargeValidity" : "55",
    "orderSummary": {
    "subTotal": 1000.00,
    "totalTax": 0,
    "grandTotal": 1000.00
  },
  "chargeValidity": "55",
  "customerNotes": null,
  "tnc": null,
  "submitPayment": {
    "via": "visa"
  },
  "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"
  },
  "settings": {
    "secureDetails": false,
    "isChargePartiallyRefundable": true
  }
}

FieldTypeDescription
customerDetailsarrayRequired. Customer details information.
customerDetails.typestringRequired. Customer type (private or corporate).
customerDetails.countryCodestringRequired. Country dialing code (e.g., +47).
customerDetails.msisdnstringRequired. Mobile phone number without country code.
customerDetails.emailemailRequired. Valid customer email address.
customerDetails.namestringRequired. Full name of the customer.
customerDetails.preferredLanguagestringRequired. Preferred language (e.g., en, no).
customerDetails.personalNumberstringOptional. Must be exactly 11 digits if provided.
customerDetails.organizationIdstringRequired if type=corporate. Alphanumeric only.
customerDetails.addressarrayRequired. Customer address details.
customerDetails.address.streetstringRequired. Street name.
customerDetails.address.zipstringRequired. Postal code.
customerDetails.address.citystringRequired. City name.
customerDetails.address.countrystringRequired. Country code (ISO).
orderDatestringRequired. Order date (validated by custom rule).
dueDateForPaymentLinkstringRequired. Timestamp for payment link validity.
referenceNostringOptional. Reference number.
customerReferencestringOptional. Customer reference ID.
sendOrderByarrayRequired. Notification preferences.
sendOrderBy.smsbooleanRequired. Whether to send order by SMS.
sendOrderBy.emailbooleanRequired. Whether to send order by email.
productsarrayRequired. List of product items.
products.*.namestringRequired. Product name.
products.*.productIdstringOptional. Product identifier (max: 25 chars).
products.*.ratenumericRequired. Product rate.
products.*.taxnumericRequired. Product tax.
products.*.amountnumericRequired. Total product amount.
orderSummary.subTotalnumericRequired. Order subtotal.
orderSummary.totalTaxnumericRequired. Total tax.
orderSummary.grandTotalnumericRequired. Grand total amount.
customerNotesstringOptional. Notes from customer.
tncstringOptional. Terms and conditions.
chargeValiditystringOptional. Validity in minutes (digits only).
submitPaymentarrayRequired. Payment submission details.
submitPayment.viastringRequired. Payment method (visa, mastercard).
callbackarrayOptional. Callback URLs.
callback.callbackUrlurlOptional. General callback URL.
callback.successurlOptional. Success redirect URL.
callback.failureurlOptional. Failure redirect URL.
settingsarrayOptional. Additional settings.
settings.secureDetailsbooleanOptional. Whether secure details are enabled.
settings.isChargePartiallyRefundablebooleanOptional. Whether partial refunds are allowed.

Example Success Response Structure :

{
  "status_code": 201,
  "status_message": "OK",
  "message": "Reservation Submitted Successfully",
  "is_data": true,
  "data": {
    "customerUuid":"String", "orderUuid": "String",
      "checkoutUrl": "String"
    }
}

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

Example Response :
{
    "status_code": 202,
    "status_message": "OK",
    "message": "Order Submitted Successfully",
    "is_data": true,
    "data": {.
      "customerUuid":"CSRT1098785092"CSRT3463048878",
    "reservationUuid": "RES3855804929"RES4161996022",
    "paymentUrl": "https://v1.checkout.bambora.com/a403d3df20af4888bd8f7dd38f3cd7f1"aa7ec3f47b0d45b286bcc595ab0d9613"
  }
}


Step 2: Payment Process

  • From the success response in Step 1, the user is redirected to the paymentUrl.

  • The preselected payment method (visa, mastercard, visa/dankort) will be shown, but the user can change it.

  • After successful payment:

    • The third-party system is notified via the provided callbackUrl.
    • The user is redirected to the success or failure URL provided in the request payload.

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