The Create Order API allows you to programmatically create print orders through our service. This is particularly useful for businesses that want to integrate printing services directly into their applications.
The API is versioned to ensure backward compatibility. We recommend using the latest version.
POST https://skrivutonline.se/api/v1/create-orderCurrently, the API uses partner-based authentication. You need to include a valid partner ID in your request. Contact us to get a partner ID for your integration.
The API accepts JSON payloads with the following structure:
{
"files": [
{
"url": "https://example.com/document.pdf",
"filename": "document.pdf",
"copies": 1
}
],
"email": "[email protected]",
"name": "Customer Name",
"address": "Customer Address",
"addressLine2": "Apartment 4",
"postalCode": "12345",
"city": "City Name",
"countryCode": "SE",
"state": "",
"paperSize": "A4",
"media": "standard",
"afterTreatment": "none",
"duplex": "no",
"scaling": "auto",
"deliveryMethod": "postnord",
"partner": "<your partner id>",
"discreetPackaging": false,
"test": false
}| Field | Type | Required | Description |
|---|---|---|---|
| files | Array | Yes | Array of file objects to print |
| files[].url | String | Yes | Publicly accessible URL to download the PDF file |
| files[].filename | String | Yes | Name of the file |
| files[].copies | Number | No | Number of copies to print (default: 1) |
| String | Yes | Customer email address | |
| name | String | Yes | Customer name |
| address | String | Yes* | Delivery address (*not required if deliveryMethod is "pickup") |
| apartmentNr | String | No | Apartment number or additional address information |
| addressLine2 | String | No | Optional second address line, stored separately from address and apartmentNr |
| countryCode | String | No | Two-letter EU country code, for example SE, FI or DE. Defaults to SE when omitted, null or empty. Surrounding whitespace is removed and lowercase codes are accepted. |
| state | String | No | Optional region, county or state, for example an Irish county |
| postalCode | String | Yes* | Postal code (*not required if deliveryMethod is "pickup") |
| city | String | Yes* | City (*not required if deliveryMethod is "pickup") |
| paperSize | String | No | Paper size (default: "A4") |
| media | String | No | Paper type (default: "standard") |
| afterTreatment | String | No | After-treatment option (default: "none") |
| duplex | String | No | Duplex printing option (default: "no") |
| scaling | String | No | Scaling option (default: "auto") |
| deliveryMethod | String | No | Delivery method (default: "postnord") |
| partner | String | Yes | Partner ID (contact us to get your partner ID) |
| notificationPhone | String | No | Phone number for delivery notifications |
| lang | String | No | Language code (default: "sv") |
| discreetPackaging | Boolean | No | Whether to use discreet packaging (default: false) |
| test | Boolean | No | Validates and prices the request without creating an order (default: false) |
Delivery is available to these EU country codes: AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE. Other country codes return HTTP 400. The countryCode, addressLine2 and state fields are optional; requests without a country code continue to use Sweden.
Delivery outside Sweden adds 30 SEK per order, regardless of the number of files or copies. Priority delivery adds its usual 39 SEK as well. Test mode returns the same calculated price as a real order.
International orders require name, email, address, postalCode and city. Postal codes are strings and may contain letters or spaces. Pickup is available only with countryCode SE.
Use the same deliveryMethod values as for Swedish orders. For postnord, the service selects postnordUntrackable when the total package weight exceeds 150 grams. Tracking and priority selections use international tracked delivery. International orders are handled manually before shipping.
{
"files": [{
"url": "https://example.com/document.pdf",
"filename": "document.pdf",
"copies": 1
}],
"email": "[email protected]",
"name": "Customer Name",
"address": "12 Example Street",
"addressLine2": "Apartment 4",
"postalCode": "D02 XY12",
"city": "Dublin",
"countryCode": "IE",
"state": "County Dublin",
"deliveryMethod": "postnord",
"partner": "<your partner id>",
"test": true
}Not all combinations of paper size, media, and after-treatment are valid. The API will return an error if an invalid combination is provided. Here are some examples of valid combinations:
| Paper Size | After Treatment | Media |
|---|---|---|
| A3 | none | 160g |
| A3 | laminated | 160g |
| A4 | none | standard |
| A4 | spiralBinding | 100g |
| A5 | none | standard |
| A5 | laminated | standard |
The API returns JSON responses with the following structure:
{
"success": true,
"id": "b2822f925091433aab431e7fae0fadb5",
"price": 123.45,
"test": false
}The price is returned in SEK.
Set test to true to validate the request, process the PDF files, and calculate the price without creating or confirming an order. The returned ID is temporary and does not refer to a created order.
{
"success": true,
"id": "b2822f925091433aab431e7fae0fadb5",
"price": 123.45,
"test": true
}{
"success": false,
"error": "Error message describing what went wrong"
}The API may return the following HTTP status codes:
Here's an example of how to use the API with cURL:
curl -X POST https://skrivutonline.se/api/v1/create-order \
-H "Content-Type: application/json" \
-d '{
"files": [
{
"url": "https://example.com/document.pdf",
"filename": "document.pdf",
"copies": 1
}
],
"email": "[email protected]",
"name": "Customer Name",
"address": "Customer Address",
"addressLine2": "Apartment 4",
"postalCode": "12345",
"city": "City Name",
"countryCode": "SE",
"state": "",
"paperSize": "A4",
"media": "standard",
"afterTreatment": "none",
"duplex": "no",
"scaling": "auto",
"deliveryMethod": "postnord",
"partner": "skrivutonline",
"discreetPackaging": false,
"test": false
}'Here's an example of how to use the API with JavaScript:
async function createOrder() {
const orderData = {
files: [
{
url: "https://example.com/document.pdf",
filename: "document.pdf",
copies: 1
}
],
email: "[email protected]",
name: "Customer Name",
address: "Customer Address",
addressLine2: "Apartment 4",
postalCode: "12345",
city: "City Name",
countryCode: "SE",
state: "",
paperSize: "A4",
media: "standard",
afterTreatment: "none",
duplex: "no",
scaling: "auto",
deliveryMethod: "postnord",
partner: "<your partner id>",
discreetPackaging: false,
test: false
};
try {
const response = await fetch("https://skrivutonline.se/api/v1/create-order", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(orderData)
});
const result = await response.json();
if (result.success) {
console.log("Order created successfully with ID:", result.id);
console.log("Order price (SEK):", result.price);
} else {
console.error("Failed to create order:", result.error);
}
} catch (error) {
console.error("Error creating order:", error);
}
}If you need assistance with the API or want to become a partner, please contact us at [email protected].