{"templateId":"markdown","versions":[{"version":"v5","label":"v5 (current)","link":"/getting-started","default":true,"active":true,"folderId":"8a5edab2"},{"version":"v4","label":"v4","link":"/v4/getting-started","default":false,"active":false,"folderId":"8a5edab2"},{"version":"v3","label":"v3 (legacy)","link":"/v3/getting-started","default":false,"active":false,"folderId":"8a5edab2"}],"sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Getting Started","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"getting-started","__idx":0},"children":["Getting Started"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Follow this path when connecting a new app or testing an integration in"," ","sandbox."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"1-choose-an-environment","__idx":1},"children":["1. Choose an environment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Store the base URL and token outside your source code."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"export STALLION_BASE_URL=\"https://ship.stallion.ca/api/v5\"\nexport STALLION_TOKEN=\"your_v5_token\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://sandbox.stallion.ca/api/v5"]}," until your request bodies, error"," ","handling, and label-printing flow work end to end."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"2-create-a-token","__idx":2},"children":["2. Create a token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create your first v5 token in the dashboard under"," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings -> Integrations -> API"]},". Select only the scopes your integration"," ","needs and copy the token when it is shown."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For automated token rotation, create a token with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tokens:manage"]},", then use"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /tokens"]}," from the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/openapi#tag/Tokens"},"children":["API Reference"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"3-pick-scopes","__idx":3},"children":["3. Pick scopes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Start with the smallest useful scope set:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Workflow"},"children":["Workflow"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Typical scopes"},"children":["Typical scopes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Quote rates only"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rates:read"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create shipments and quote rates"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shipments:write"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rates:read"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Buy labels"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shipments:write"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rates:read"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["labels:create"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Schedule pickups"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pickups:write"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Track shipments"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tracking:read"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Update product customs data"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products:read"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products:write"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Classify and approve DDP products"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products:read"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products:classify"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products:approve"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Quote and book LTL freight"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ltl:read"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ltl:write"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/authentication-scopes"},"children":["Authentication & Scopes"]}," for the full scope"," ","model."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"4-make-a-test-request","__idx":4},"children":["4. Make a test request"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl \"$STALLION_BASE_URL/shipments?per_page=5\" \\\n  -H \"Authorization: Bearer $STALLION_TOKEN\" \\\n  -H \"Accept: application/json\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A successful list response returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["meta"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["links"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"5-send-json-requests","__idx":5},"children":["5. Send JSON requests"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For endpoints with a request body, include ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Content-Type: application/json"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"$STALLION_BASE_URL/rates\" \\\n  -H \"Authorization: Bearer $STALLION_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"to_address\": {\n      \"name\": \"Jane Doe\",\n      \"address1\": \"123 Main St\",\n      \"city\": \"Toronto\",\n      \"province_code\": \"ON\",\n      \"postal_code\": \"M5V 2T6\",\n      \"country_code\": \"CA\"\n    },\n    \"packages\": [\n      { \"weight\": 0.5, \"weight_unit\": \"lbs\", \"package_contents\": \"T-shirt\" }\n    ]\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the returned ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["service"]}," value when you buy a label."]}]},"headings":[{"value":"Getting Started","id":"getting-started","depth":1},{"value":"1. Choose an environment","id":"1-choose-an-environment","depth":2},{"value":"2. Create a token","id":"2-create-a-token","depth":2},{"value":"3. Pick scopes","id":"3-pick-scopes","depth":2},{"value":"4. Make a test request","id":"4-make-a-test-request","depth":2},{"value":"5. Send JSON requests","id":"5-send-json-requests","depth":2}],"frontmatter":{"seo":{"title":"Getting Started"}},"lastModified":"2026-06-11T19:57:13.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/getting-started","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}