Skip to main content

Submit Quick Order

With this API endpoint, you can submit a new quick order for a list of customers. You can add customers with their customer uuid, email and phone number. Country code and msisdn within phone number should be separated by "^".


Endpoint

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

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:

{
    "customers": [
        "CSRT1502423833",
        "+880^1934657823",
        "[email protected]"
    ],
    "orderDate": "{{orderDate}}",
    "dueDateForPaymentLink": "{{dueDate}}",
    "referenceNo": null,
    "customerReference": null,
    "products": {
        "0": { 
            "name": "Health Scan",
            "productId": null,
            "quantity": "2",
            "rate": 30,
            "discount": 0,
            "tax": "10",
            "amount": 60
        }
    },
    "sendOrderBy": {
        "sms": false,
        "email": true
    },
    "orderSummary": {
        "subTotal": 54.55,
        "totalTax": 5.45,
        "totalDiscount": 0.00,
        "grandTotal": 60.00
    },
    "customerNotes": null,
    "tnc": null

}

Validation Rules

Make sure your request meets the following requirements:

FieldTypeDescription
customersarrayRequired
customers.*stringRequired email / customer uuid / phone number of customer.
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.emailbooleanNullable If you want to send order payment link via email.
orderDatestringRequired Provide Current / Future Date as Unix timestamp for the Date of the order.
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.
callback.callbackUrlurlOptional To receive real-time notifications on order state changes, you must provide a callback url. This is an server-to-server HTTP GET request.

Response

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

{
    "status_code": 201,
    "status_message": "OK",
    "message": "quickOrderAddedSuccessfully",
    "is_data": false,
    "data": null
}

API returns a 417 error for payload validation errors

{
    "status_code": 417,
    "status_message": "Client Error",
    "message": "payloadValidationErrors",
    "is_error": true,
    "errors": "Array"
}

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

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