For developers

Sitara API documentation

Send registrations, payments, renewals and refunds from your server to Sitara. Sitara matches each event to the creator whose code was used and calculates commission at the agreed rate. No SDK and no device IDs.

Overview

Endpoint URL

POST https://api.joinsitara.com/v2/in/<endpoint_id>

One endpoint URL per brand, shown in Attribution settings after you sign up. It identifies your account and is not a secret.

Authentication

Authorization: Bearer <key>

One test key (sk_test_…) and one live key (sk_live_…). The key decides the environment. Sitara shows a key only once and stores it hashed; regenerating a key revokes the previous one at once.

Project code
Every hybrid and revenue share campaign has an 8-character project code. Send it as project_code on every event.
Format
HTTPS only. One JSON event per request, at most 64 KiB. Amounts are integer strings in the smallest currency unit and times are UTC.
IP allowlist
Optional: up to 20 IP addresses or CIDR ranges, shared by both keys.

Quick start

  1. Generate a test key: Under Connection, generate the test key and store it in your server’s secret storage. Never put it in an App, a web page or a URL.
  2. Send events from your server: POST one JSON event per request to your endpoint URL with "Authorization: Bearer <key>" and "Content-Type: application/json". Put the project code in project_code.
  3. Complete the checklist: Open each project under Projects. Every item is ticked automatically when your test events arrive. Then submit the project for review.
  4. Go live: After Sitara approves the connection, generate the live key and switch your server to it. Live sales count once payment is complete.

Rules

  • HTTPS only. One event per request, at most 64 KiB. Unknown fields are rejected.
  • Amounts are integer strings in the smallest unit: JPY yen ("1200" = ¥1,200); USD, EUR and GBP cents or pence ("1299" = $12.99). Never decimals.
  • Times are UTC in ISO 8601 ending in Z and must reflect when the event actually occurred.
  • A 202 response means the event is stored; attribution runs asynchronously.
  • Retry network errors, 429 and 5xx with the same event_id and the same body (wait 1, 2, 4, 8, 16, 30 seconds). Never create a new event_id, order_id or refund_id for a retry.
  • Refunds send the amount of this refund only, each with its own refund_id. Send chargebacks as refunds.
  • Renewals need a new order_id and the subscription_id of the first payment. Refunds and renewals use the project code of the original order.
  • Send the code the customer entered: always on registrations and code redemptions, and on payments when a code was used. Sitara never guesses from IP addresses or devices.
  • customer_id is an anonymous ID from your system. Never send names, email addresses or phone numbers.

Events & fields

Event types

registration
A customer signed up with a code.
code_redemption
A customer entered a code without signing up or paying.
payment_succeeded
A payment succeeded (also the first payment of a subscription).
subscription_renewed
A subscription renewed and was charged.
refund
Money was returned (refund or chargeback).

Fields

Field Format Required for Rule
event_id String, 1–128 letters, digits, - or _e.g. evt_20261009_0001 all events Unique per event in this project and environment. Resend the same event with the same event_id and the same body.
project_code 8-character project codee.g. K7QM2XPA all events The project the event belongs to (shown in Attribution settings). Refunds and renewals use the project code of the original order.
type registration, code_redemption, payment_succeeded, subscription_renewed, refunde.g. payment_succeeded all events What happened.
occurred_at ISO 8601 UTC time ending in Ze.g. 2026-10-09T10:30:00.000Z all events When it actually happened (for payments: when the payment succeeded), not when you send it. At most 5 minutes in the future.
customer_id String, 1–128 letters, digits, - or _e.g. cus_8f2a91 all events Anonymous, stable ID of the customer in your system. Never an email, phone number or name.
order_id String, 1–128 letters, digits, - or _e.g. ord_100045 payment_succeeded, subscription_renewed, refund Unique per payment or renewal. A refund sends the order_id of the payment it refunds.
amount Integer string in the smallest unit (JPY yen; USD, EUR and GBP cents)e.g. 1200 payment_succeeded, subscription_renewed, refund Amount actually paid after discounts, greater than 0. A refund sends only the amount of this refund.
currency JPY, USD, EUR or GBPe.g. JPY payment_succeeded, subscription_renewed, refund Must match the currency agreed for the collaboration.
refund_id String, 1–128 letters, digits, - or _e.g. rfd_5521 refund Unique per refund (also for chargebacks).
subscription_id String, 1–128 letters, digits, - or _e.g. sub_7781 subscription_renewed Required for renewals; also send it on the first payment of a subscription.
tax_amount Integer string in the smallest unite.g. 109 optional · only payment_succeeded, subscription_renewed Tax included in amount. Required when the agreed calculation basis excludes tax; always recommended.
fee_amount Integer string in the smallest unite.g. 180 optional · only payment_succeeded, subscription_renewed App Store / Google Play / payment-provider fee withheld from this payment. Required for the net-proceeds basis; always recommended.
shipping_amount Integer string in the smallest unite.g. 0 optional · only payment_succeeded, subscription_renewed Shipping included in amount. Required only when the agreed basis excludes tax and shipping.
code String, 1–64 letters, digits, - or _ (case-insensitive)e.g. SPRING24 registration, code_redemption The promo or invite code the customer entered. Send it on registrations and code redemptions, and on payments when one was used.

Examples

Replace <endpoint_id> and the project code with yours from Attribution settings, and read the key from an environment variable.

curl

curl -X POST "https://api.joinsitara.com/v2/in/<endpoint_id>" \
  -H "Authorization: Bearer $SITARA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"event_id":"evt_0001","project_code":"ABCD2345","occurred_at":"2026-10-09T10:30:00.000Z","customer_id":"cus_8f2a91","type":"payment_succeeded","order_id":"ord_100045","amount":"1200","currency":"JPY","tax_amount":"109","fee_amount":"180","subscription_id":"sub_7781","code":"SPRING24"}'

Node.js

// Node.js 18+: run on your server only.
const event = {
  "event_id": "evt_0001",
  "project_code": "ABCD2345",
  "occurred_at": "2026-10-09T10:30:00.000Z",
  "customer_id": "cus_8f2a91",
  "type": "payment_succeeded",
  "order_id": "ord_100045",
  "amount": "1200",
  "currency": "JPY",
  "tax_amount": "109",
  "fee_amount": "180",
  "subscription_id": "sub_7781",
  "code": "SPRING24"
};
const response = await fetch('https://api.joinsitara.com/v2/in/<endpoint_id>', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.SITARA_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify(event),
});
// 202: stored. On a network error, 429 or 5xx, retry later with the same event.
console.log(response.status, await response.json());

Python

# Python 3: run on your server only.
import json, os, urllib.request

event = {
    "event_id": "evt_0001",
    "project_code": "ABCD2345",
    "occurred_at": "2026-10-09T10:30:00.000Z",
    "customer_id": "cus_8f2a91",
    "type": "payment_succeeded",
    "order_id": "ord_100045",
    "amount": "1200",
    "currency": "JPY",
    "tax_amount": "109",
    "fee_amount": "180",
    "subscription_id": "sub_7781",
    "code": "SPRING24"
}
request = urllib.request.Request(
    "https://api.joinsitara.com/v2/in/<endpoint_id>",
    data=json.dumps(event).encode("utf-8"),
    method="POST",
    headers={"Authorization": f"Bearer {os.environ['SITARA_API_KEY']}", "Content-Type": "application/json"},
)
with urllib.request.urlopen(request, timeout=10) as response:  # raises on 4xx/5xx
    print(response.status, json.load(response))

Registration with a code

{
  "event_id": "evt_0004",
  "project_code": "ABCD2345",
  "occurred_at": "2026-10-09T10:30:00.000Z",
  "customer_id": "cus_8f2a91",
  "type": "registration",
  "code": "SPRING24"
}

Renewal

{
  "event_id": "evt_0003",
  "project_code": "ABCD2345",
  "occurred_at": "2026-11-09T10:30:00.000Z",
  "customer_id": "cus_8f2a91",
  "type": "subscription_renewed",
  "order_id": "ord_100311",
  "subscription_id": "sub_7781",
  "amount": "1200",
  "currency": "JPY",
  "tax_amount": "109",
  "fee_amount": "180"
}

Refund

{
  "event_id": "evt_0002",
  "project_code": "ABCD2345",
  "occurred_at": "2026-10-10T08:00:00.000Z",
  "customer_id": "cus_8f2a91",
  "type": "refund",
  "order_id": "ord_100045",
  "refund_id": "rfd_5521",
  "amount": "1200",
  "currency": "JPY"
}

Responses & errors

Success

HTTP 202
{"success":true,"data":{"event_id":"evt_0001","status":"received","reason":null,"duplicate":false}}

duplicate is true when the same event_id and body were already stored (safe retry).

Errors

Every error has the same shape:

{"success":false,"code":"INVALID_KEY","error":"Unknown or revoked secret key for this API address."}
HTTP code What to do
400 INVALID_JSON / UNKNOWN_FIELD Send valid JSON with the fields of this page only (customer codes go in "code").
400 INVALID_TYPE / MISSING_FIELD / FIELD_NOT_ALLOWED / SOURCE_REQUIRED Check the event type and the fields required for it.
400 INVALID_INPUT / INVALID_AMOUNT / INVALID_CURRENCY IDs: letters, digits, - and _. Amounts: positive integer strings; tax, fee and shipping not above amount. Currency JPY, USD, EUR or GBP.
400 INVALID_TIME / FUTURE_EVENT Send the real UTC time ending in Z and check your server clock.
400 INVALID_PROJECT_CODE / UNKNOWN_PROJECT Use the 8-character code of one of your projects (Projects tab).
400 HTTPS_REQUIRED Send over HTTPS.
401 INVALID_KEY Send "Authorization: Bearer <key>" with a current key of this account. Regenerated or revoked keys stop working at once.
403 IP_NOT_ALLOWED Add your server’s IP address to the IP allowlist or send from an allowed IP address.
404 ENDPOINT_NOT_FOUND Copy the endpoint URL from Attribution settings → API connection again.
409 EVENT_CONFLICT This event_id was stored with a different body. Do not overwrite or renumber it; check what your server sent.
413 BODY_TOO_LARGE Send one event of at most 64 KiB.
503 STORAGE_UNAVAILABLE / CONFIGURATION_REQUIRED / IP_HEADER_NOT_CONFIGURED Temporary problem on Sitara’s side. Retry the same event later.

Verification and going live

Each campaign is verified separately with your test key. The project page ticks each item automatically when your test events arrive:

  • A payment made with a creator’s code
  • A code entered at registration, followed by a payment without a code
  • The same event sent twice and counted once
  • A refund
  • A subscription renewal
  • When the campaign has invite codes: a registration with an invite code and the invited customer’s first payment

When every item is done, submit the project for review. Sitara reviews the live connection and confirms the product link that promotion links open. After approval, generate the live key and switch your server to it.

How sales are attributed

  • Sales are credited only through codes: the code on the event, a code the customer entered earlier, or the original order of a renewal. Sitara never guesses from IP addresses or devices.
  • Commission is calculated at the revenue share agreed with each creator and never exceeds the net revenue of the order (amount minus tax and store or payment fees).
  • Commission is confirmed only after the agreed refund window. Refunds reduce it in proportion.
  • Brands get 24 hours to check new data before it can be settled, and commission never goes past each creator’s budget.

For a longer explanation with an example, read Code-based attribution and refunds.

Get your keys

Sign up as a brand to get your endpoint URL, test key and project codes. Signing up and publishing campaigns are free.