{
  "info": {
    "name": "Skynet Shipment API",
    "description": "Partner API for Skynet: create shipments in the FS Logistik order system and track their status.\n\nDocumentation: https://docs.fslogistik.com\n\nThis collection is preloaded with the shared SANDBOX account. Nothing here is dispatched or invoiced.\n\nSetup:\n1. Run \"Get an API token\". It stores the token in the `apiKey` variable; every other request uses it.\n2. Change `reference` to something of your own (for example SKY-0001) before creating a shipment — the sandbox account is shared.\n3. For production, switch `baseUrl` to https://admin.fslogistik.com/api/v1 and set `email` / `password` to the account FS Logistik opens for you.\n\nThe sandbox is shared and cleared periodically: use made-up names and addresses, never real customer data.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://test-admin.sendpakke.nu/api/v1",
      "type": "string"
    },
    {
      "key": "email",
      "value": "sandbox@fslogistik.com",
      "type": "string"
    },
    {
      "key": "password",
      "value": "Sandbox-2026!",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "",
      "type": "string"
    },
    {
      "key": "reference",
      "value": "SKY-889271",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Get an API token",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "const body = pm.response.json();",
              "if (body.token) {",
              "    pm.collectionVariables.set('apiKey', body.token);",
              "    console.log('API token stored in the apiKey variable.');",
              "}"
            ]
          }
        }
      ],
      "request": {
        "auth": {
          "type": "noauth"
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/token",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "token"
          ]
        },
        "description": "Exchanges the account's panel credentials for a long-lived API token. Run this once; the token is stored in the apiKey variable and reused by every other request.\n\nThe password is never sent again after this call. If a token leaks, tell FS Logistik and it will be revoked.",
        "body": {
          "mode": "raw",
          "options": {
            "raw": {
              "language": "json"
            }
          },
          "raw": "{\n  \"email\": \"{{email}}\",\n  \"password\": \"{{password}}\",\n  \"name\": \"Skynet integration\"\n}"
        }
      },
      "response": [
        {
          "name": "201 Created",
          "status": "Created",
          "code": 201,
          "originalRequest": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "token"
              ]
            }
          },
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"token\": \"sk_live_9f2c41a7e8b34d05a6c1e7fbd9204e83\",\n  \"token_type\": \"Bearer\",\n  \"account\": \"SkyNet\",\n  \"created_at\": \"2026-08-27T14:02:11+02:00\"\n}"
        },
        {
          "name": "401 Invalid credentials",
          "status": "Unauthorized",
          "code": 401,
          "originalRequest": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "token"
              ]
            }
          },
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"success\": false,\n  \"message\": \"Invalid credentials.\"\n}"
        }
      ]
    },
    {
      "name": "Create a shipment",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/shipments",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments"
          ]
        },
        "description": "Registers a shipment on your account and returns the FS Logistik order number.\n\nNo pricing fields are accepted; any that are sent are ignored. Sending the same `reference` twice returns the existing shipment with 200 instead of creating a duplicate, so retrying after a timeout is safe.",
        "body": {
          "mode": "raw",
          "options": {
            "raw": {
              "language": "json"
            }
          },
          "raw": "{\n  \"reference\": \"{{reference}}\",\n  \"order_type\": \"package\",\n  \"content_description\": \"Textile samples\",\n  \"sender\": {\n    \"name\": \"Atlas Tekstil A.S.\",\n    \"phone\": \"+90 212 555 0134\",\n    \"email\": \"export@atlastekstil.com\",\n    \"company_name\": \"Atlas Tekstil A.S.\",\n    \"address\": {\n      \"street\": \"Mahmutbey Mah. Tasocagi Cad. No 12\",\n      \"city\": \"Istanbul\",\n      \"postal_code\": \"34218\",\n      \"country_code\": \"TR\"\n    }\n  },\n  \"receiver\": {\n    \"name\": \"Lise Andersen\",\n    \"phone\": \"+45 26 13 42 16\",\n    \"email\": \"lise.andersen@example.dk\",\n    \"address\": {\n      \"street\": \"Nyholms Alle 30 B, 2. th\",\n      \"city\": \"Rodovre\",\n      \"postal_code\": \"2610\",\n      \"country_code\": \"DK\"\n    }\n  },\n  \"packages\": [\n    {\n      \"quantity\": 1,\n      \"weight_kg\": 2.4,\n      \"length_cm\": 40,\n      \"width_cm\": 30,\n      \"height_cm\": 20\n    }\n  ]\n}"
        }
      },
      "response": [
        {
          "name": "201 Created",
          "originalRequest": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/shipments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shipments"
              ]
            }
          },
          "status": "Created",
          "code": 201,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"reference\": \"SKY-889271\",\n  \"order_number\": \"20260827004\",\n  \"status\": \"pending\",\n  \"created_at\": \"2026-08-27T14:12:08+02:00\"\n}"
        },
        {
          "name": "422 Validation failed",
          "originalRequest": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/shipments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shipments"
              ]
            }
          },
          "status": "Unprocessable Content",
          "code": 422,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"success\": false,\n  \"message\": \"Validation failed\",\n  \"errors\": {\n    \"packages.0.weight_kg\": [\"The weight must not be greater than 30.\"],\n    \"receiver.address.postal_code\": [\"The receiver postal code is required.\"]\n  }\n}"
        }
      ]
    },
    {
      "name": "Track a shipment",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/shipments/{{reference}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments",
            "{{reference}}"
          ]
        },
        "description": "Returns the current status of one shipment and its status history. Only shipments created by your own key are visible; anything else returns 404.\n\nNo prices, invoice data, or billing details are returned."
      },
      "response": [
        {
          "name": "200 OK",
          "originalRequest": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/shipments/{{reference}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shipments",
                "{{reference}}"
              ]
            }
          },
          "status": "OK",
          "code": 200,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"reference\": \"SKY-889271\",\n  \"order_number\": \"20260827004\",\n  \"status\": \"shipped\",\n  \"status_label\": \"Shipped\",\n  \"carrier\": \"ups\",\n  \"tracking_number\": \"1ZK919J46899000001\",\n  \"updated_at\": \"2026-08-29T09:41:55+02:00\",\n  \"history\": [\n    { \"status\": \"pending\", \"occurred_at\": \"2026-08-27T14:12:08+02:00\" },\n    { \"status\": \"processing\", \"occurred_at\": \"2026-08-28T08:30:11+02:00\" },\n    { \"status\": \"shipped\", \"occurred_at\": \"2026-08-29T09:41:55+02:00\" }\n  ]\n}"
        }
      ]
    },
    {
      "name": "List shipments",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/shipments?per_page=50&page=1",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments"
          ],
          "query": [
            {
              "key": "status",
              "value": "shipped",
              "disabled": true
            },
            {
              "key": "created_after",
              "value": "2026-08-01",
              "disabled": true
            },
            {
              "key": "per_page",
              "value": "50"
            },
            {
              "key": "page",
              "value": "1"
            }
          ]
        },
        "description": "Lists your account's shipments, newest first. Meant for reconciliation, not for polling individual shipments."
      },
      "response": [
        {
          "name": "200 OK",
          "originalRequest": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/shipments?per_page=50&page=1",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shipments"
              ],
              "query": [
                {
                  "key": "per_page",
                  "value": "50"
                },
                {
                  "key": "page",
                  "value": "1"
                }
              ]
            }
          },
          "status": "OK",
          "code": 200,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"data\": [\n    {\n      \"reference\": \"SKY-889271\",\n      \"order_number\": \"20260827004\",\n      \"status\": \"shipped\",\n      \"updated_at\": \"2026-08-29T09:41:55+02:00\"\n    }\n  ],\n  \"meta\": { \"page\": 1, \"per_page\": 50, \"total\": 1 }\n}"
        }
      ]
    }
  ]
}