Send Payment Link
With this API endpoint, you can export orders to Front Payment Go and get Order Uuid and Customer Uuid in return.
Endpoint
POST https://demo-api.frontpayment.no/api/v1/connect/orders/payment-link/create
Authentication
This endpoint 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.
Request Payload
The 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"
},
"sendOrderBy": {
"sms": true,
"email": false
},
"orderDate": "1703040812",
"dueDateForPaymentLink": "1703040812",
"customerDetails": {
"type": "private",
"countryCode": "+47",
"msisdn": "46567468",
"email": "[email protected]",
"name": "Kari Nordmann",
"preferredLanguage": "en",
"personalNumber": "12345678901",
"address": {
"street": "Luramyrveien 65",
"zip": "4313",
"city": "Sandnes",
"country": "NO"
}
},
"isCreditCheckAvailable": true,
"invoiceAsPaymentOption": true,
"referenceNo": null,
"customerReference": null,
"secureDetails": true,
"callback": {
"callbackUrl": "https://example.com/callback-url"
}
}
Validation Rules
Make sure your request meets the following requirements:
Field | Type | Description |
---|---|---|
products.*.name |
required | string |
Required |
products.*.productId |
nullable | string |
Optional |
products.*.quantity |
required | numeric |
Required |
products.* |
required | numeric |
Required |
products.*.discount |
nullable | numeric |
Optional |
products.*.tax |
required | numeric |
Required0 , 12 , 15 , 25 ), Unless you have other configuration. |
products.*.amount |
required | numeric |
Required |
orderSummary.subTotal |
required | numeric |
Required |
orderSummary.totalTax |
required | numeric |
Required |
orderSummary.totalDiscount |
required | numeric |
Required |
orderSummary.grandTotal |
required | numeric |
Required |
sendOrderBy |
required | array |
Requiredsms or email field value is true |
sendOrderBy.sms |
required | boolean |
Requiredtrue |
sendOrderBy.email |
required | boolean |
Requiredtrue |
orderDate |
required | string |
Required |
dueDateForPaymentLink |
required | string |
Required |
customerDetails.countryCode |
required | string |
Required |
customerDetails.msisdn |
required | string |
Required |
customerDetails.email |
required | email |
Required |
customerDetails.name |
required |
|
Required |
customerDetails.preferredLanguage |
nullable | string |
Optionalen , no , sv , da , de . If nothing is given it will set default to no . |
customerDetails.type |
required | string |
Requiredprivate or corporate . |
customerDetails.personalNumber |
nullable | string
|
Optionalprivate then you can used this for add personal number. |
customerDetails.organizationId |
required | string |
Conditional Requiredcorporate then this field is required. Otherwise you can add this as null or remove from payload. |
customerDetails.address.street |
required | string |
Required |
customerDetails.address.zip |
required | string |
Required |
customerDetails.address.city |
required | string |
Required |
customerDetails.address.country |
required | string |
RequiredNO ). Custom validation IsoAlpha2Country applies. |
isCreditCheckAvailable |
required | boolean |
Requiredtrue . |
invoiceAsPaymentOption |
required | boolean |
Requiredtrue . |
referenceNo |
nullable | string |
Nullable |
customerReference |
nullable | string |
Nullable |
|
|
|
callback.callbackUrl |
required |
|
RequiredHTTP GET request. |
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": false,
"data": {
"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"
}
Notifications via Callback URL
The callbackUrl
is an endpoint on your server that our system will call via an HTTP GET
request whenever the status of the specified order changes from its initial state.
See the link below to understand how to work with the callback URL on your side and how to verify the request sent from our side.