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-order
Currently, 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",
"postalCode": "12345",
"city": "City Name",
"paperSize": "A4",
"media": "standard",
"afterTreatment": "none",
"duplex": "no",
"scaling": "auto",
"deliveryMethod": "postnord",
"partner": "<your partner id>",
"discreetPackaging": 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 |
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) |
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"
}
{
"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",
"postalCode": "12345",
"city": "City Name",
"paperSize": "A4",
"media": "standard",
"afterTreatment": "none",
"duplex": "no",
"scaling": "auto",
"deliveryMethod": "postnord",
"partner": "skrivutonline",
"discreetPackaging": 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",
postalCode: "12345",
city: "City Name",
paperSize: "A4",
media: "standard",
afterTreatment: "none",
duplex: "no",
scaling: "auto",
deliveryMethod: "postnord",
partner: "<your partner id>",
discreetPackaging: 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);
} 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].