Skip to main content

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 NameDescriptionTypeAdditional Information
clientIdThe unique ID of the client creating the order.string ($uuid)Required.
refNoThe client's own unique reference number for the order.stringRequired. Min 1, Max 14 characters.
applicantThe applicant's contact and ID information.ObjectRequired. See Applicant Schema
amountThe current amount of the order.doubleRequired. Non-decimal (e.g., 55000.00 is read as 55 000 SEK).
currencyThe currency code for the amount.stringRequired. Example: SEK.
selectableCampaignsA list of campaign IDs that the applicant can choose from.array of integerNullable. List of numeric campaign identifiers.
callbackUrlThe URL where asynchronous notifications (callbacks) will be sent.stringRequired. Example: https://www.yourdomain.com/callbacks/
orderInfoFree-form data container for merchant-specific data.ObjectNullable. 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 CodeDescription
400 Bad RequestThe request body failed validation (e.g., missing a required field, invalid format, or the requested Amount is not supported by any campaign).
401 UnauthorizedAuthentication failure (e.g., missing or invalid API key/credentials).
500Server Error