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',
'billingFrequency' => 'required|string', //(eg: monthly, weekly, daily)
'numberOfRepeats' => 'required|numeric',
'orderSummary.subTotal' => 'required|numeric',
'orderSummary.totalTax' => 'required|numeric',
'orderSummary.totalDiscount' => 'required|numeric',
'orderSummary.grandTotal' => 'required|numeric',
'orderSummary.initialCycleAmount' => 'nullable|numeric',
'orderSummary.payablePerCycle' => 'required|numeric',
'subscriptionStartDate' => 'required|string',
'subscriptionEndsDate' => 'required|string',
'dueDateForPaymentLink' => 'required|string',
'sendOrderBy.sms' => 'required|boolean',
'sendOrderBy.email' => 'required|boolean',
'customerDetails.type' => 'required|nullable|string',
'customerDetails.countryCode' => 'required|nullable|string',
'customerDetails.msisdn' => 'required|nullable|string',
'customerDetails.email' => 'required|nullable|email',
'customerDetails.name' => 'required|string',
'customerDetails.personalNumber' => 'nullable|string|max:11',
'customerDetails.organizationId' => 'required_if:customerDetails.type,corporate|nullable|string|regex:/^[a-zA-Z0-9]+$/',
'customerDetails.preferredLanguage' => 'required|string',
'customerDetails.address' => 'required|array',
'customerDetails.address.street' => 'required|string',
'customerDetails.address.zip' => 'required|string',
'customerDetails.address.city' => 'required|string',
'customerDetails.address.country' => 'required|string',
'customerNotes' => 'nullable|string',
'termsAndConditions' => 'nullable|string'
|
Example Payload |
: |
{
"products": {
"0": {
"name": "product 3",
"productId": null,
"quantity": "1",
"rate": "2000",
"discount": 0,
"tax": "0",
"amount": 2000
}
},
"orderSummary": {
"subTotal": "2000.00",
"totalTax": "0.00",
"totalDiscount": "0.00",
"grandTotal": "2000.00",
"initialCycleAmount": "500.00",
"payablePerCycle":"2000.00"
},
"billingFrequency":"month",
"numberOfRepeats":12,
"subscriptionStartDate": "21 Feb, 2023",
"subscriptionEndsDate": "21 Feb, 2024",
"dueDateForPaymentLink": "1677047770.652",
"sendOrderBy": {
"sms": false,
"email": true
},
"customerDetails": {
"customerUuid": "CSRT3798554634",
"type": "private",
"countryCode": "+47",
"msisdn": "46567468",
"email": "[email protected]",
"name": "Kari Nordmann",
"personalNumber": null,
"organizationId": "925710482",
"preferredLanguage": "no",
"address": {
"street": "Luramyrveien 65",
"zip": "4313",
"city": "Sandnes",
"country": "Norway"
}
},
"customerNotes":"test",
"termsAndConditions":"terms and conditions",
"submitPayment": {
"currency": "NOK"
}
}
|
Response Structure |
: |
{
"status_code": 201,
"status_message": "OK",
"message": "subscriptionRequestSuccessfullyHandled",
"is_data": Boolean,
"data": {
"subscriptionUuid": "String",
"orderUuid": "String",
"customerUuid":"String",
"checkoutUrl": "String"
}
}
|
Example Response |
: |
{
"status_code": 201,
"status_message": "OK",
"message": "subscriptionRequestSuccessfullyHandled",
"is_data": true,
"data": {
"subscriptionUuid": "SUB1812030514",
"orderUuid": "ODR3798113293",
"customerUuid": "CSRT3820359602",
"checkoutUrl": "https://demo-api.frontpayment.no/subscription/payment/details/SUB1812030514"
}
}
|