Skip to main content

Update Payment Link

With this API endpoint, you can update payment link which status is yet in SENT.


Endpoint

POST https://demo-api.frontpayment.no/api/v1/connect/orders/{{orderUuid}}/update-payment-link

Authorization

To access this endpoint, include a Bearer Token in the Authorization header of your request. You can obtain this token from Frontpayment.

Example Authorization Header: Authorization: Bearer YOUR_FRONTPAID_BEARER_TOKEN

Request Payload

Send the following parameters as a JSON object in the request body:

{
    "products": [
        {
            "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"
    },
    "sendOrderBy": {
        "sms": false,
        "email": true
    },
    "customerDetails": {
        "type": "private",
        "countryCode": "+47",
        "msisdn": "46567468",
        "email": "[email protected]",
        "firstName": "",
        "name": "Kari Nordmann",
        "preferredLanguage": "en",
        "personalNumber": "12345678901",
        "address": {
            "street": "Luramyrveien 65",
            "zip": "4313",
            "city": "Sandnes",
            "country": "NO"
        }
    },
    "invoiceAsPaymentOption": true,
    "referenceNo": null,
    "customerReference": null,
    "secureDetails": true,
}

Validation Rules

Make sure your request meets the following requirements:

FieldTypeDescription
products.*.namestringRequired Name of the product.
products.*.productIdstringOptional Unique identifier for the product.
products.*.quantitynumericRequired Quantity of the product.
products.*ratenumericRequired Rate per unit of the product.
products.*.discountnumericOptional Discount applied to the product.
products.*.taxnumericRequired Tax rate must be (e.g., 0, 12, 15, 25), Unless you have other configuration.
products.*.amountnumericRequired Total amount for the product line item.
orderSummary.subTotalnumericRequired Subtotal of all products before tax and discount.
orderSummary.totalTaxnumericRequired Total tax for the order.
orderSummary.totalDiscountnumericRequired Total discount for the order.
orderSummary.grandTotalnumericRequired Grand total of the order.
sendOrderBy.smsbooleanNullable If you want to send order paytment link via customer phone number.
sendOrderBy.emailbooleanNullableIf you want to send order payment link via email.
customerDetails.countryCodestringRequired if customerDetails.email is not given. Country code for the customer's phone number (e.g., "+47").
customerDetails.msisdnstringRequired if customerDetails.email is not given. Mobile Subscriber ISDN Number (phone number).
customerDetails.emailstringRequired if customerDetails.msisdn is not given. Customer's email address.
customerDetails.firstNamestringOptional Customer's First name.
customerDetails.namestringRequired Customer's full name.
customerDetails.preferredLanguagestringOptional Customer preferred language. Available languages are en, no, sv, da, de. If nothing is given it will set default to no.
customerDetails.typestringRequired You can provide customer type is private or corporate.
customerDetails.personalNumberstringOptional Customer's personal identification number, must be exactly 11 characters containing only numbers and cannot contain spaces. When Customer type is private then you can used this for add personal number.
customerDetails.organizationIdstringConditional Required Organization identification number, must contain only numbers and cannot contain spaces. When Customer type is corporate then this field is required. Otherwise you can add this as null or remove from payload.
customerDetails.address.streetstringRequired Street address of the customer.
customerDetails.address.zipstringRequired Zip code of the customer's address.
customerDetails.address.citystringRequired City of the customer's address.
customerDetails.address.countrystringRequired ISO Alpha-2 country code (e.g., NO). Custom validation IsoAlpha2Country applies.
invoiceAsPaymentOptionbooleanRequired Enable Invoice as payment option then set true.
referenceNostringNullable Any reference number.
customerReferencestringNullable Any value for customer reference.
secureDetailsbooleanOptional.If secureDetails is set to True, the order details will not be accessible until the user’s PNumber has been verified through BankID.

Response

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

{
    "status_code": 201,
    "status_message": "OK",
    "message": "orderUpdatedSuccessfully",
    "is_data": true,
    "data": {
        "uuid": "ODR3506777330",
        "paymentUrl": "https://stg.frontpayment.no/order/details/ODR3846674890"
    }
}

API returns a 400 or 404 error, it means order status is not sent or order is not found

{
    "status_code": 400,
    "status_message": "Conflict of Business Logic",
    "message": "orderStatusAlreadyPaid",
    "is_data": false,
    "data": null
}
{
    "status_code": 404,
    "status_message": "Order Not Found",
    "message": "orderNotFound",
    "is_data": false,
    "data": null
}

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