Create Order
Purpose: Creates a new order and initiates the application process by sending an invitation SMS to the applicant. The application proceeds after the user accepts the invitation.
Endpoint Details
- HTTP Verb: POST
- URL Segment: /v3/order
- OpenAPI Spec: View in Swagger UI
- Notes: The requested Amount must be supported by at least one available campaign. If no matching campaign is found, the API returns a 400 Bad Request error.
Request Body (CreateOrderRequest)
This method requires a JSON body.
| Field Name | Description | Type | Additional Information |
|---|---|---|---|
clientId | The unique ID of the client creating the order. | string ($uuid) | Required. |
refNo | The client's own unique reference number for the order. | string | Required. Min 1, Max 14 characters. |
applicant | The applicant's contact and ID information. | Object | Required. See Applicant Schema |
amount | The current amount of the order. | double | Required. Non-decimal (e.g., 55000.00 is read as 55 000 SEK). |
currency | The currency code for the amount. | string | Required. Example: SEK. |
selectableCampaigns | A list of campaign IDs that the applicant can choose from. | array of integer | Nullable. List of numeric campaign identifiers. |
callbackUrl | The URL where asynchronous notifications (callbacks) will be sent. | string | Required. Example: https://www.yourdomain.com/callbacks/ |
orderInfo | Free-form data container for merchant-specific data. | Object | Nullable. See OrderInfo Schema |
Example Request
{
"clientId": "a1b1c1d1-e2f2-3g4h-5i6j-7k8l9m0n1o2p",
"refNo": "AB-10001",
"applicant": {
"nationalId": "199601121768",
"phoneNumber": "+46712345678"
},
"amount": 55000,
"currency": "SEK",
"selectableCampaigns": [
100001,
100002
],
"callbackUrl": "https://www.yourdomain.com/callbacks/",
"orderInfo": {
"usefulInfo": "This is an order",
"salesPersonId": "51"
}
}
Successful Response (201 Created)
The API returns an OrderResponse object containing the created Order.
For schema and examples, see the OrderResponse Schema page.
Error Responses
The following HTTP status codes are explicitly documented for this method:
| Status Code | Description |
|---|---|
| 400 Bad Request | The request body failed validation (e.g., missing a required field, invalid format, or the requested Amount is not supported by any campaign). |
| 401 Unauthorized | Authentication failure (e.g., missing or invalid API key/credentials). |
| 500 | Server Error |