{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"98616bfc-81b2-46d2-b728-1a9393b73339","name":"PROFRAKT API DOCUMENTATION","description":"# Hey there!\n\n#### Welcome to the wonderful world of our JSON‐powered shipments REST API—your one-stop shop for everything from fetching estimated shipping costs, getting pickup locations, creating shipments to printing labels on cloud printers, plus some more.\n\n#### So whether you’re sipping coffee in Oslo or debugging at 2 AM in Timbuktu, here’s everything you need to hit the ground running! And if still should find yourself stumbling in the dark, please [reach out to us](https://rune@profrakt.no) and we will help you get you back on track in no-time!\n\n<img src=\"https://content.pstmn.io/e230ce46-e40d-4d49-9f60-124da950617b/c3BhY2VyXzI1LnBuZw==\">\n\n<img src=\"https://content.pstmn.io/443f4091-44ab-4374-8f9c-6c0e682b4669/cHJvZnJha3QtbG9nb190cmFuc3AucG5n\" width=\"100\" height=\"150\">\n\n<img src=\"https://content.pstmn.io/7a434b07-cd23-4fb3-8d0b-c374ae00b411/c3BhY2VyXzI1LnBuZw==\">\n\n#### ⚡If you rather would like to skip right to the chase instead of reading lengthy texts about stuff you probably already know, you'll find direct links to our end-points in the menu to the left, including examples of both requests and responses, and you'll find our [Swagger here](https://swagger.profrakt.no).\n\n#### Still, having a quick scroll through this does no harm, and might save you time later if you do. Either way, you'll get your module solved.\n\n<img src=\"https://content.pstmn.io/a7708dae-f501-47d5-a801-18abab48a52c/c3BhY2VyXzE1LnBuZw==\">\n\n## Getting Started: The Basics of Talking to Our API\n\n<img src=\"https://content.pstmn.io/6b15d3e5-5251-4532-bf55-02e2f9f4be7e/c3BhY2VyXzE1LnBuZw==\">\n\n#### **Base URL's**\n\nAll production requests live under a single base URL, [https://edi.no](https://edi.no). You’ll need your API key in all your calls—treat it like your toothbrush: keep it secret, keep it safe.\n\n**Prod. endpoint:** [https://edi.no](https://edi.no)  \n**Stage endpoint:** [https://edistage.adminpanel.no](https://edistage.adminpanel.no)\n\n<img src=\"https://content.pstmn.io/14ae2561-8cd3-4b16-9168-30089f4e5f89/c3BhY2VyXzE1LnBuZw==\">\n\n#### **Authentication**\n\nInclude these in your headers whenever you can, they never do any harm, only good.\n\n**X-Profrakt-Key**: \\[PROFRAKT_API_KEY\\]  \n**X-Profrakt-Sender**: \\[PROFRAKT_MANAGERSHIP_ID\\]\n\n<img src=\"https://content.pstmn.io/a98a9465-cff1-4cb1-b93a-88b7fd03d247/c3BhY2VyXzE1LnBuZw==\">\n\n#### **Headers & Payloads**\n\n- Always send Content-Type: application/json.\n    \n- Include X-Profrakt-Key and X-Profrakt-Sender in your headers.\n    \n- For GETs, parameters go in the query string; for POSTs, stick ’em in the JSON body.\n    \n- Keep your JSON **camelCased**—we like things tidy.\n    \n\n<img src=\"https://content.pstmn.io/ff3be6cb-fd0e-44e9-aeb0-798da00a2ca3/c3BhY2VyXzE1LnBuZw==\">\n\n#### **Responses You Love (and Some You Don’t)**\n\n- **200** OK / **201** Created → **Success!** Inspect the JSON body for your data.\n    \n- **4xx** “Client Oops” → Bad request, unauthorized, forbidden, or not found—double-check your payload and headers.\n    \n- **5xx** “Server Whoops” → We tripped on our end—retry or drop us a line if it persists.\n    \n\n<img src=\"https://content.pstmn.io/b6037f4c-f6dc-4948-960a-0ed2840d3f62/c3BhY2VyXzE1LnBuZw==\">\n\n#### **HTTPS Methods & Endpoints**\n\n| **Method** | **Endpoint** | What it does |\n| --- | --- | --- |\n| GET | /profile | Fetch your shipping “home bases” (managerships). |\n| GET | /agreements | See your carrier agreements, logos, available products & rules. |\n| GET | /printers | List available cloud printers you can print to and check their online status. |\n| GET | /partners | Find pickup/drop-off locations for every carrier (lockers optional). |\n| POST | /costs/v2 | Get quotes for many freight methods at once—fuel surcharge, tolls, all included. |\n| POST | /consignments | Create a shipment: returns IDs, labels & tracking. |\n| POST | /label-direct | Fire off your print job to a cloud printer. One or 100 labels at once? We're good to go. |\n\n<img src=\"https://content.pstmn.io/4a3bdeca-8348-4cec-b04a-965bd334425a/c3BhY2VyXzI1LnBuZw==\">\n\n#### **Some words on testing - Prod. environment vs Stage environment**\n\nCreated shipments on production will not be charged in any way before the label is actually received by a carrier, and there are no automatic pickups being ordered, so generally there are no problems testing on production, but it's a good practice to use dummy values for receivers mobile and email if you're doing this, so that notifications aren't sent from the carriers when you create your test shipments.\n\n<img src=\"https://content.pstmn.io/ebf57baf-4b81-4249-8849-2b56399eba5e/c3BhY2VyXzE1LnBuZw==\">\n\nIf you still want access to our stage environment (which aren't always updated with all possible freight methods and services), please reach out, and we will hook you up with it.\n\n<img src=\"https://content.pstmn.io/ac588551-79ac-4d1e-878f-1fec4f3b694f/c3BhY2VyXzI1LnBuZw==\">\n\n#### **Dictionary**\n\nWe don't expect you to know all the different terminology used within the shipping business, so in our API we've tried to be understandable for all, but here's a quick explanation of specific words you'll run across that might cause you to raise an eyebrow:\n\n- **Managership** - This is an address from where packages are sent. A key can have many shipping locations/managerships.\n    \n- **Consignment** - This is a shipment, and is what that generates the label.\n    \n- **Consignor** - This is the sender of the package.\n    \n- **Consignee** - This is the receiver of the package.\n    \n- **Booking** - This is an order of a physical pickup of goods. It can in other solutions be referred to as the 'booking of a shipment without ordering a pickup', but at our end we regard it as an order of a pickup.\n    \n\n<img src=\"https://content.pstmn.io/58b55b72-2dbf-4436-ad31-6d54f0c63a41/c3BhY2VyXzE1LnBuZw==\">\n\n<img src=\"https://content.pstmn.io/bba1e289-2f7c-417f-9d65-9f0cb0239221/cHJvZnJha3QtbG9nbyAoMikuanBn\" width=\"100\" height=\"111\">\n\n<img src=\"https://content.pstmn.io/c13ce950-99b6-4c8c-ad2e-ac300a83e7b4/c3BhY2VyXzI1LnBuZw==\">\n\n### Best-practise - Well, how we would have done it anyways.\n\nDepending on your task and weather or not this is a private app you're building, theres different ways to do this, but we'll give you a quick flow, and a thorough case, and you can cherry pick whatever from it you think would best suit your own app.\n\n<img src=\"https://content.pstmn.io/13b27403-1bb6-4807-928e-cfaa578d4f3c/c3BhY2VyXzE1LnBuZw==\">\n\n### **Quick flow:**\n\n**\\- GET /profile (API key req) - Get the available sender addresses.**\n\nStore the returned managership id's, you will need it in subseqent requests.\n\n**\\- GET /agreements (API key / Managership ID req) - Get the available shipping options, and their id's.**\n\nStore the response, or present to the user which they would like to use and only store their id's and names, and then give the user the option to change their options by doing a new request from which their pick their options.\n\n**\\- GET /printer (API key / Managership ID req) - Get available cloud printers and their id's**\n\nStore the id's and printer name if any, they are used for printing the labels later.\n\n**\\- POST /consignments (API key / Managership ID req) - Generate a shipment**\n\nThe response will include a link to the label and a tracking link for you to use at your side, as well as the id for the shipment.\n\n**\\- POST /label-direct (API key / Managership ID req) - Print the label(s)**\n\nDirectly after creating a shipment, send the print request to the specified printer, or present the link to the pdf for the user to download and print. We also offer a way to get the pdf directly if needed.\n\n<img src=\"https://content.pstmn.io/901d937a-3877-42b3-ad3b-ccb59c78720a/c3BhY2VyXzE1LnBuZw==\">\n\n#### **For the checkouts/front-ends:**\n\n**\\- GET /partners (API key / Managership ID req)** - Get potential pickup points.\n\nWe deliver pickup points for most carriers (Bring, Postnord, Helthjem, UPS, Porterbuddy\\*, Instabox\\*) in our API. Store the end-consumers chosen pickup point on the order.\n\n**\\- POST /costs/v2End (API key / Managership ID req)** - Get a dynamic estimated shipping cost.\n\nAssuming the end-consumer has given the send-to address and we have at least a total weight of the cart, query Profrakt to get the agreement price for the shipment. This is specifically usefull for B2B shipments, or for those sending large size packages where the \"volume weight\" often is higher than the \"real weight\", where in both cases freight can be costly depending on the end-consumers address.\n\n#### **Thorough flow (Incomplete):**\n\n**Pretended case:** _I am building an app for an eCom platform, and the app is going to be used by many different shops with no correlation to each other. It will be available for all eCom owners and I will use the given freight methods in the eComs checkout, presenting the method as well as a dynamic price for the freight cost._\n\n1. Most of the magic is controlled in the users settings for my app, so the first step would be to give my customer a settings page, and a place to give, and store, his Profrakt API key.\n    \n2. Then I need to be sure to store what the I need in the future from what I get from the API key. So when the API key is stored, the first thing is to get the available sender locations for the key, this will also give me the needed managership id for each of the locations owned by the key (The key can have many warehouses or shops for all I know.).\n    \n\nThis is done with a GET to the /profile end-point and the response will give me all available managerships (addresses from where the packages are sent) as well as their id's. The id is needed for both getting the available carrier agreements (different carriers), getting the clients estimated shipping prices, as well as pickup points and printing through cloud print, so I need to be sure to cache this.\n\nTypically an app asks the client to select one of the available managerships before setting up the rest of the flow, but it's possible to build it so that the user can also select which managership (sender location/address) is to be used for each shipment. For most apps/plugins only one specific managership is used though.\n\n**For all the following requests the API key and the Managership ID is sent in the requests header as X-Profrakt-Key and X-Profrakt-Sender.**\n\n3\\. Ok, the Api key and managership ID are stored, so the next is to pull which available carrier agreements the credentials hold. This is done through a GET request to the /partners endpoint. This will return all available carrier agreements the client has with Profrakt. This consist of several different carriers, each carrier has several different freight methods (products) and each freight method (product) might have several adittional services (services). The /agreements response also returns the rules for each freight method (product), but in most cases you will not have to take those into regards.\n\n<img src=\"https://content.pstmn.io/8f2b25c2-72f9-4b68-a219-a9d202dd6362/c3BhY2VyXzI1LnBuZw==\" alt=\"To%20be%20continued...\">\n\n### Common Pitfalls & How to Rescue Yourself\n\n| **Error type** | **Status code** | **Why it happens** | **Where to look/What to do** |\n| --- | --- | --- | --- |\n| Invalid JSON | 400 Bad Request | Malformed body (missing brace, stray comma). | Check your JSON syntax with a linter or \\[jsonlint.com\\]. |\n| Missing Auth | 401 Unauthorized | Missing, or wrong, API key and or Managership ID. | Verify your authorization headers. |\n| Forbidden | 403 Forbidden | You don’t have access to that resource. | Wrong, API key and/or Managership ID. Verify that you are requesting the correct environment, we've got both a production and a stage environment. |\n| Not Found | 404 Not Found | Endpoint typo or nonexistent resource ID. | Confirm the URL (ends with an “s”? capitalization?), check the ID you passed. |\n| Server Error | 500+ Server Error | Something exploded on our side. | Look at the response body for hints; if it’s cryptic, ping support with exact payload. |\n| Timeout | N/A (client) | Network issues or extremely slow operation. | Increase your timeout, retry once, or switch regions if supported. |\n| Validation Error | 422 Unprocessable Entity | Data violates business rules. | Inspect the errors array in the response; follow each validation message. |\n\n<img src=\"https://content.pstmn.io/3a8237f7-0ac8-44c2-91cd-27f7e37d5704/c3BhY2VyXzI1LnBuZw==\">\n\n## Conclusion\n\nOk, that should cover the basics, and then some, so dive into it and reach out to us the second you've spent more than 10 minutes on an issue without getting closer. We're here to help!\n\nGive us some time and we will further dive into details on every end-point below.\n\n<img src=\"https://content.pstmn.io/8145eb31-cc1b-4217-b6c7-47e9356acb30/c3BhY2VyXzI1LnBuZw==\">\n\n### **Happy coding!**","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"26498370","team":4848282,"collectionId":"98616bfc-81b2-46d2-b728-1a9393b73339","publishedId":"2sAYdkJ9Xu","public":true,"publicUrl":"https://api.profrakt.no","privateUrl":"https://go.postman.co/documentation/26498370-98616bfc-81b2-46d2-b728-1a9393b73339","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"light","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":null,"colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.10.0","publishDate":"2025-05-07T16:19:35.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/1170b7e2969e66ded3a8e75521e7c3ccc5155d6ab42b25fd4b5bb48aa40aeaf9","favicon":"https://profrakt.no/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://api.profrakt.no/view/metadata/2sAYdkJ9Xu"}