Skip to main content

Overview

Sanka exposes workspace-scoped REST endpoints. Tokens you generate carry your workspace_id and are used as Bearer JWTs across all endpoints.

Generate an access token

  1. Sign in to the app and open Developers → API.
  2. Click Create Token, choose Full Access (POST+GET) or Regular (GET only), then save.
  3. Copy the Access Token (shown once) and Refresh Token to a safe place.

Base URLs

  • https://app.sanka.com/
  • Local dev: http://app.localhost:8000/

Authentication

All endpoints use:
Authorization: Bearer <access_token>
Refresh: POST /api/token/refresh/ with body { "refresh": "<refresh_token>" }.

Quickstart examples (cURL)

List orders:
curl -X GET \
  "https://app.sanka.com/ja/api/v1/orders/?page=1&amount=30" \
  -H "Authorization: Bearer <access_token>"
List items:
curl -X GET \
  "https://app.sanka.com/ja/api/v1/items" \
  -H "Authorization: Bearer <access_token>"
List contacts + companies:
curl -X GET \
  "https://app.sanka.com/ja/api/v1/contacts" \
  -H "Authorization: Bearer <access_token>"
Create a subscription:
curl -X POST \
  "https://app.sanka.com/ja/api/v1/subscriptions/create" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{ "cid": "<contact_or_company_id>", "subscription_status": "active", "items": [{ "id": "<item_id>", "amount": 1 }], "currency": "JPY" }'
Create an invoice:
curl -X POST \
  "https://app.sanka.com/ja/api/v1/invoices/create" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{ "cid": "<contact_or_company_id>", "status": "scheduled", "items": [{ "id": "<item_id>", "amount": 1 }], "currency": "JPY" }'
Refresh your token:
curl -X POST \
  "https://app.sanka.com/ja/api/token/refresh/" \
  -H "Content-Type: application/json" \
  -d '{ "refresh": "<refresh_token>" }'

Try it in the API reference

Open the Developers tab and use the OpenAPI-backed API Reference. Set Authorization: Bearer <token> when trying any endpoint.