Siren

Report a Sale

POST /event/sale — create a SaleTriggered event from an external commerce system.

Requires Siren Pro

Last updated: October 28, 2026

POST /siren/v1/event/sale

Creates a SaleTriggered event from a checkout that did not run through a Siren-aware WordPress commerce extension. Used by custom bridges that route sales from an external commerce stack into Siren’s attribution pipeline.

If you are integrating a new commerce platform from scratch, prefer building a Siren extension that fires SaleTriggered directly from the platform’s webhook. The request takes only the fields below, not a general-purpose sale envelope.

Request Body:

FieldTypeRequiredDescription
sourcestringYesThe originating system, such as "woocommerce" or "shopify". Used as the event source and to derive the binding type (<source>_order). 1 to 249 characters.
externalIdstringYesThe order or transaction ID in the originating system. Used as the binding ID for refund matching. 1 to 32 characters, or a number.
totalnumericYesOrder total as a decimal in the order’s currency (e.g., 49.99). Siren converts it to the currency’s stored scale, so 49.99 USD is stored as 4999, and a 5000 JPY order is stored as 500000. Send the amount as it appears on the order, never pre-multiplied. From 0 to 999,999,999.99.
trackingIdintegerYesThe opportunity ID from the visitor’s earlier site-visit tracking. Becomes the event’s opportunityId. A whole number from 0 to 9,007,199,254,740,991.
currencystringNoA currency code your organization uses, matched exactly, so usd isn’t USD. If omitted, the sale is in your organization’s default currency. A percentage program that doesn’t pay in this currency holds its reward for review.
itemsarrayNoLine items: [{ externalId, lineId, name, quantity, amount }]. amount is the per-unit price as a decimal in the order’s currency, like total. If provided, each item becomes a transaction detail entry. If omitted, a single Order line with the total is created. Up to 500 items. Each amount runs from 0 to 999,999,999.99, quantity is a whole number from 1 to 1,000,000, and name and externalId hold up to 255 characters. lineId is optional, your own id for the order line, up to 191 characters, which a refund can name the line by. Each item’s amount times its quantity, added across all items, can’t pass 999,999,999.99.

Example Request:

POST /wp-json/siren/v1/event/sale
Authorization: Basic c2lyZW4tdHJhY2tpbmc6YWJjZCBlZmdoIGlqa2wgbW5vcA==
Content-Type: application/json

{
  "source": "shopify",
  "externalId": "ORD-1004",
  "trackingId": 4218,
  "total": 49.99,
  "items": [
    { "externalId": "SKU-1", "name": "Annual Plan", "quantity": 1, "amount": 49.99 }
  ]
}

Example Response:

HTTP/1.1 200 OK
X-Siren-OID: 4218
Access-Control-Expose-Headers: X-Siren-OID

The X-Siren-OID header echoes the resolved opportunity ID. The JSON body says what Siren did with the sale: status is created (a transaction and at least one conversion were recorded), recorded (the transaction was recorded but no program awarded a conversion), duplicate (this order was sent before, so nothing new was recorded), unattributed (the tracking ID matches no opportunity, so nothing was recorded), or ignored (no active program takes sales). The body also carries created, transactionId, conversions, and message. conversions lists each conversion’s id and status, and a conversion whose reward is held because the sale is in another currency reads pending even when its program auto-approves. A recorded sale that earns nothing adds a reason: no_engagement, engagement_used, engagement_ended, or not_awarded.

Errors:

A field outside its limits answers 400 in the validation shape. Items that add up to too much fail with “items must add up to no more than 999999999.99 across all lines.” A currency your organization doesn’t use fails with type UNKNOWN_CURRENCY and “currency must be a currency code this organization uses, such as USD or one of its custom currencies.”

If Siren can’t record the sale after two tries, it answers 500 with “The sale could not be recorded, and nothing was saved. It is safe to send it again.” On Siren Cloud, every part of a sale is saved or none is, so a failed sale leaves nothing behind.

On Siren Cloud, send the same body to https://api.sirenaffiliates.com/siren/v1/event/sale with Authorization: Bearer sk_live_..., using an API key that holds event:sale or event:*. An organization can send 5,000 events a minute, and over that the API answers 429 with Retry-After. While your organization’s processing is paused, Siren Cloud can answer 202 or 429, as Events describes.

Internally this fires SaleTriggered, which kicks off the standard conversion pipeline: programs are evaluated, conversions are awarded, and obligations are issued. See the attribution pipeline for what happens after.

Your privacy choices

Account, checkout and chat you request work without optional tracking. Choose whether to allow these other uses on this website.

You can change or withdraw your choices at any time using “Privacy choices.” We remember your choice for 180 days. Read our privacy policy.