Skip to main content

Send Payment Link

With this API endpoint, you can export orders to Front Payment Go and get paymentOrder URLsUuid and Customer Uuid in return. 


Endpoint

POST 

Authentication

This

endpoint

The

Endpoint:https://demo-api.frontpayment.no/api/v1/connect/orders/payment-link/create
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',
'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' => '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|regex:/^\d{11}$/',
'customerDetails.organizationId' => 'required_if:customerDetails.type,corporate|nullable|string|regex:/^\d{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',
'callback.callbackUrl' => 'nullable|string|url'
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

:request body should be a JSON object containing details about the products, order and customer.

{
    "products": {
        "0": {
            "name": "Hair Wash",
            "productId": "VFDDF",
            "quantity": "1",
            "rate": 51,
            "discount": 0,
            "tax": "0",
            "amount": 51
        }
    },
    "orderSummary": {
        "subTotal": "51.00",
        "totalTax": "0.00",
        "totalDiscount": "0.00",
        "grandTotal": "51.00"
    },
    "orderDate": "1754928405",
    "dueDateForPaymentLink": "1703040812",
    "sendOrderBy": {
        "sms": true,
        "email": false,
        "invoice": false
    },
    "invoiceAsPaymentOption"orderDate": false,"1703040812",
    "isCreditCheckAvailable"dueDateForPaymentLink": false,"1703040812",
    "customerDetails": {
        "type": "private",
        "countryCode": "+47",
        "msisdn": "46567468",
        "email": "example@domain.test@yopmail.com",
        "customerUuid": "CSRT3672053467",
        "name": "Kari Nordmann",
        "preferredLanguage": "en",
        "personalNumber": null,"12345678901,
        "organizationId": null,
        "address": {
            "street": "Luramyrveien 65",
            "zip": "4313",
            "city": "Sandnes",
            "country": "NO"
        }
    },
    "invoiceReferences"isCreditCheckAvailable": {true,
    "invoiceAsPaymentOption": true,
    "referenceNo": "Dhaka",null,
    "customerReference": "3500",null,
    "receiptNo"secureDetails": "Cumilla",
        "customerNotes": "NO",
        "tnc": "adfsl"
    },
    "internalReferences": {
        "referenceNo": "Dhaka",
        "notes": "3500"
    },true,
    "callback": {
        "callbackUrl": "https://stg-api.frontpayment.no/api/v1/tests-callback"example.com/callback-url"
    }
}

Validation Rules

Make sure your request meets the following requirements:

FieldTypeDescription
products.*.namerequired | stringRequired. Name of the product.
Response Structureproducts.*.productId :nullable | string Nullable. Unique identifier for the product.
products.*.quantityrequired | numericRequired. Quantity of the product.
products.*.raterequired | numericRequired. Rate per unit of the product.
products.*.discountnullable | numericNullable. Discount applied to the product.
products.*.taxrequired | numericRequired. Tax rate
products.*.amountrequired | numericRequired. Total amount for the product line item.
orderSummary.subTotalrequired | numericRequired. Subtotal of all products before tax and discount.
orderSummary.totalTaxrequired | numericRequired. Total tax for the order.
orderSummary.totalDiscountrequired | numericRequired. Total discount for the order.
orderSummary.grandTotalrequired | numericRequired. Grand total of the order.
sendOrderBy.smsrequired | booleanRequired. Order will send sms then set true.
sendOrderBy.emailrequired | booleanRequired. Order will send email then set true.
orderDaterequired | stringRequired. Unix timestamp for the Date of the order.
dueDateForPaymentLinkrequired | stringRequired. Unix timestamp for the Due Date of the order.
customerDetails.countryCoderequired | stringRequired. Country code for the customer's phone number (e.g., "+47").
customerDetails.msisdnrequired | stringRequired. Mobile Subscriber ISDN Number (phone number).
customerDetails.emailrequired | emailRequired. Customer's email address.
customerDetails.namerequired | stringRequired. Customer's full name.
customerDetails.preferredLanguagenullable | stringNullable. Customer's language (e.g., NO, EN). Default value = NO
customerDetails.typerequired | stringRequired. You can provide customer type is private or corporate
customerDetails.personalNumberrequired | string | max:11Conditional Required. Customer's personal identification number, must be 11 characters. When Customer type is private then this field is required.
customerDetails.organizationIdrequired | string | max:9Conditional Required. Organization identification number, must be 9 characters. When Customer type is corporate then this field is required.
customerDetails.address.streetrequired | stringRequired. Street address of the customer.
customerDetails.address.ziprequired | stringRequired. Zip code of the customer's address.
customerDetails.address.cityrequired | stringRequired. City of the customer's address.
customerDetails.address.countryrequired | stringRequired. ISO Alpha-2 country code (e.g., NO). Custom validation IsoAlpha2Country applies.
isCreditCheckAvailablerequired | booleanRequired. Credit check option enable in checkout then set true.
invoiceAsPaymentOptionrequired | booleanRequired. Enable Invoice as payment option then set true.
referenceNonullable | stringNullable. Any reference number.
customerReferencenullable | stringNullable. Any value for customer reference .
callback.callbackUrlrequired | arrayRequired. The URL we will notify when order status changes.

Response

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

{
    "status_code": 201,
    "status_message": "OK",
    "message": "orderAddedSuccessfully",
    "is_data": true,false,
    "data": null{
        "uuid": "ODR3506777330",
        "customerUuid": "CSRT3463048878"
    }
}

API returns a 500 or 510 error, it means something failed on the server side

{
    "status_code": 500,
    "status_message": "Internal Dependency Error",
    "message": "internalErrorOccurredPleaseTryAgainLater",
    "is_error": true,
    "errors": {
        "happenedAt": "String",
        "internalErrorDetails": "Array"
    }
}

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


Example Response:
{
    "status_code": 201,
    "status_message": "OK",
    "message": "orderAddedSuccessfully",
    "is_data": false,
    "data": null
}

Handling Callback

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

 

Example Parameters:

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 + createdAt


3. Generate a SHA-256 hash of the resulting string.
4. Compare the generated hash with the `checksum` provided in the callback.

 

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