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.
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:
| Field | Type | Description |
|---|---|---|
customers |
array |
Required |
customers.* |
string |
Required email / customer uuid / phone number of customer. |
products.*.name |
string |
Required Name of the product. |
products.*.productId |
string |
Optional Unique identifier for the product. |
products.*.quantity |
numeric |
Required Quantity of the product. |
products.*rate |
numeric |
Required Rate per unit of the product. |
products.*.discount |
numeric |
Optional Discount applied to the product. |
products.*.tax |
numeric |
Required Tax rate must be (e.g., 0, 12, 15, 25), Unless you have other configuration. |
products.*.amount |
numeric |
Required Total amount for the product line item. |
orderSummary.subTotal |
numeric |
Required Subtotal of all products before tax and discount. |
orderSummary.totalTax |
numeric |
Required Total tax for the order. |
orderSummary.totalDiscount |
numeric |
Required Total discount for the order. |
orderSummary.grandTotal |
numeric |
Required Grand total of the order. |
sendOrderBy.sms |
boolean |
Nullable If you want to send order paytment link via customer phone number. |
sendOrderBy.email |
boolean |
Nullable If you want to send order payment link via email. |
orderDate |
string |
Required Provide Current / Future Date as Unix timestamp for the Date of the order. |
referenceNo |
string |
Nullable Any reference number. |
customerReference |
string |
Nullable Any value for customer reference. |
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"
}