This walks through creating an organization and its first payroll entity with a partner API key. Use the sandbox while you build: https://api.sandbox.odinpayroll.com.
1. Create an API key
Sign in to the Odin Payroll app as a partner administrator, open Settings, API keys, and create a key. It starts with opk_ and is shown once. Store it in your secret manager.
export ODIN_KEY="opk_..."
export ODIN_API="https://api.sandbox.odinpayroll.com"
2. Check who you are
The active context tells you which partner the key belongs to and what it may do.
curl -s "$ODIN_API/v1/me/context" -H "Authorization: Bearer $ODIN_KEY"
The response includes scope.id, your partner id, and the list of scopes the key has.
3. Create an organization
curl -s -X POST "$ODIN_API/v1/partners/$PARTNER_ID/organizations" \
-H "Authorization: Bearer $ODIN_KEY" -H "Content-Type: application/json" \
-d '{ "name": "Northwind Holdings" }'
4. Create a payroll entity
curl -s -X POST "$ODIN_API/v1/organizations/$ORGANIZATION_ID/payroll-entities" \
-H "Authorization: Bearer $ODIN_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: northwind-retail-1" \
-d '{
"legalName": "Northwind Retail LLC",
"admin": { "firstName": "Owen", "lastName": "Brooks", "email": "owen@northwind.example", "phone": "5555550100" },
"termsAccepted": true
}'
The entity starts with status: "onboarding" and kybStatus: "new". Verification happens next, and a payroll_entity.kyb_status_changed event tells you when it passes.
5. Listen for events
Add a webhook endpoint in Settings, Webhooks and verify each delivery.