API documentation

Marketplace Activation

The API-specific activation steps the onboarding quickstart omits: connect Amazon and eBay commerce surfaces over OAuth, run shadow-mode margin and promo-hygiene checks, satisfy eBay's mandatory Marketplace Account Deletion compliance for a production keyset, federate signed dossiers into the shared audit ledger, and export escalation-ready proof packets. Surfaces run shadow-mode first and never enforce until you enable it.

Overview

Amazon and eBay run as Layer-A connector services that reuse the exact margin gate as Shopify, mint a signed Decision Dossier, and federate it into the cross-surface audit ledger. Activation is: connect the OAuth credential, observe in shadow mode, then enable enforcement.

SurfaceConnectGovernance routesStatus
AmazonLogin with Amazon (LWA)/amazon/pricing/verify, /amazon/promotions/verifyBeta — shadow-mode first
eBayeBay OAuth2/ebay/pricing/verify, /ebay/promotions/verifyBeta — shadow-mode first

Connect a surface (OAuth)

Each connector exchanges an authorization code for a refresh token, sealed per-org with the shared AES-256-GCM envelope. The org id is round-tripped through the OAuth state parameter. Credentials are read from env, never hardcoded.

# eBay: redirect the seller through eBay consent, then deliver the code here.
curl -X POST https://api.decionis.com/oauth/ebay/callback \
  -H "Content-Type: application/json" \
  -d '{
    "code": "<authorization_code>",
    "state": "<org_uuid>",
    "redirect_uri": "<your_ebay_RuName_redirect>"
  }'

# Amazon: same shape via Login with Amazon.
curl -X POST https://api.decionis.com/oauth/amazon/callback \
  -H "Content-Type: application/json" \
  -d '{"code":"<authorization_code>","state":"<org_uuid>","redirect_uri":"<your_redirect>"}'

# Response → { "connected": true, "org_id": "...", "has_refresh_token": true }

Shadow-mode checks

Normalize an order or promotion into the shared commerce signal and get a signed verdict. Shadow mode observes and records a dossier — it never blocks. Marketplace fees map onto the discount slot, so the same margin math applies as Shopify.

# Margin check (eBay; Amazon is identical with amazon_fees)
curl -X POST https://api.decionis.com/ebay/pricing/verify \
  -H "Content-Type: application/json" \
  -d '{"org_id":"<org_uuid>","order_id":"ORD-9","price":100,"ebay_fees":18,"cost_basis":55}'
# → { "decision": "block" | "review" | "authorize", "mode": "shadow", "dossier_id": "...", ... }

# Promo-hygiene check (flags unbounded / expired-active / deep-stackable promotions)
curl -X POST https://api.decionis.com/ebay/promotions/verify \
  -H "Content-Type: application/json" \
  -d '{"org_id":"<org_uuid>","promotionId":"PROMO-1","percentage":30}'
# → { "leaking": true, "reason": "unbounded", "mode": "shadow", "dossier_id": "...", ... }

eBay Marketplace Account Deletion (production keyset)

An eBay PRODUCTION keyset is marked Non Compliant until it exposes a public, UNAUTHENTICATED endpoint that answers eBay's validation challenge and accepts account-deletion notifications. Decionis serves this at api.decionis.com so eBay's credential-less request reaches it.

1. Configure the two env vars

EBAY_DELETION_ENDPOINT_URL must EXACTLY match the URL you register in the eBay console — it is part of the challenge hash. The verification token is 32–80 chars of [A-Za-z0-9_-] and must match the console.

EBAY_VERIFICATION_TOKEN=<32-80 char token, matches the eBay console>
EBAY_DELETION_ENDPOINT_URL=https://apps.decionis.com/ebay/marketplace-account-deletion

2. eBay validates with a GET challenge

On Save, eBay calls the endpoint with a challenge_code. The response is the hex SHA-256 of challengeCode + verificationToken + endpointURL — computed server-side; you do not implement it.

GET https://api.decionis.com/ebay/marketplace-account-deletion?challenge_code=<code>
# → 200 { "challengeResponse": "<sha256 hex>" }

3. Account-deletion notifications

eBay POSTs an account-deletion notification; the endpoint acknowledges with 200. Decionis stores no eBay consumer PII, so there is nothing to purge beyond acknowledgement.

POST https://api.decionis.com/ebay/marketplace-account-deletion  →  200 { "ok": true }

Both methods are anonymous (eBay sends no credentials). Register the endpoint URL and verification token in the eBay Developer console under Alerts & Notifications, then Save — verification succeeds once the deployment has both env vars set.

Federation + proof packets

A connector federates its signed dossier into the cross-surface audit ledger. When the full dossier is included it is persisted and becomes retrievable, then exportable as a portable, signed proof packet for dispute escalation and audit.

# Federate a surface decision (connectors do this automatically when DECIONIS_PROTOCOL_URL is set)
curl -X POST https://api.decionis.com/v1/protocol/surfaces/decisions \
  -H "Authorization: Bearer ${DECIONIS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"surface":"ebay","decision":"authorize","org_id":"<org_uuid>","dossier_id":"<uuid>","dossier_sha256":"<hex>","mode":"shadow","dossier":{ ... }}'

# Export an escalation-ready proof packet for one dossier
curl "https://api.decionis.com/v1/protocol/dossiers/<dossier_id>/proof-packet?org_id=<org_uuid>" \
  -H "Authorization: Bearer ${DECIONIS_API_KEY}"
# → signature + ledger verification, proof bundle, and verify instructions

Ops spend-control gates

The ops vertical pack governs back-office spend (expense approvals, vendor payments, refunds/credits) over the same evaluate-decision pipeline. Gate 1 admits the request; Gate 2 authorizes the disbursement and detects duplicate payments.

# Gate 1 — spend admission
curl -X POST https://api.decionis.com/v1/protocol/ops/spend-admission/verify \
  -H "Authorization: Bearer ${DECIONIS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"object_type":"Expense","proposed_state":{"amount":5000,"currency":"USD","vendor_id":"V1"}}'

# Gate 2 — disbursement authority (blocks a duplicate vendor + invoice/amount)
curl -X POST https://api.decionis.com/v1/protocol/ops/disbursement-authority/verify \
  -H "Authorization: Bearer ${DECIONIS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"object_type":"VendorPayment","object_id":"PAY-1","proposed_state":{"amount":5000,"currency":"USD","vendor_id":"V1","invoice_number":"INV-1"},"actor":{"role":"Controller"},"context":{"requested_by":"alice","approved_by":"bob"}}'

Activation env

The env contract for marketplace activation. Connector credentials and the eBay compliance values are read from env, never hardcoded. For an eBay sandbox keyset, also point EBAY_API_BASE / EBAY_OAUTH_TOKEN_ENDPOINT at api.sandbox.ebay.com.

# eBay connector + compliance
EBAY_CLIENT_ID=...
EBAY_CLIENT_SECRET=...
EBAY_OAUTH_REDIRECT_URI=...            # your eBay RuName redirect
EBAY_VERIFICATION_TOKEN=...            # matches the eBay console
EBAY_DELETION_ENDPOINT_URL=https://apps.decionis.com/ebay/marketplace-account-deletion

# Amazon connector
AMAZON_LWA_CLIENT_ID=...
AMAZON_LWA_CLIENT_SECRET=...
AMAZON_OAUTH_REDIRECT_URI=...

# Federation into the shared ledger
DECIONIS_PROTOCOL_URL=https://api.decionis.com
DECIONIS_PROTOCOL_API_KEY=...

Reference paths

Related docs and the machine-readable contract.

NeedDocs path
Onboarding + first decisionhttps://docs.decionis.com/quickstart
Authentication and API keyshttps://docs.decionis.com/auth
Decision Dossier retrieval + verificationhttps://docs.decionis.com/decision-dossier
Decision Chain lineagehttps://docs.decionis.com/decision-chain
Shadow rollout evidencehttps://docs.decionis.com/shadow-reports
OpenAPI contracthttps://api.decionis.com/openapi/decionis-api.yaml