Section 2 — The Measurement Stack · Last verified: MAY 2026

The Conversions API

Chapter 09 — The Conversions API

The Conversions API (CAPI) is the server-to-server companion to the pixel. OpenAI explicitly calls it a more reliable tracking source than the pixel alone and recommends running both when possible.

Endpoint

POST https://bzr.openai.com/v1/events?pid=<PIXEL-ID>
Authorization: Bearer <API-KEY>
Content-Type: application/json

Note the host: bzr.openai.com, not api.ads.openai.com. Conversions and Advertiser API live on different domains.

ValueRequiredDescription
pid (query string)YesPixel ID.
validate_only (body)NoWhen true, validates events without saving them.
events (body)YesArray of events. Up to 1,000 per batch.

Batch failure semantics

If one event in a batch fails, the entire batch fails. Build retry logic accordingly. Two options:

  1. Send small batches (10–50 events) so a single bad event doesn’t kill a large batch.
  2. Validate first — set validate_only: true, identify the bad event, fix or drop it, then send for real.

In production, both. Validate periodically; send small batches.

Provisioning

Pixel ID and Conversions API key are both created from the Conversions tab inside Ads Manager. The Pixel ID is shared between pixel and CAPI — same identifier, both transports. The API key is a separate secret used only by CAPI.

Key difference from the pixel

The pixel captures oppref automatically. The Conversions API does not. The advertiser is responsible for capturing oppref from the landing page (or from the __oppref cookie the pixel stored) and passing it on the server-side event.

The standard pattern on a Shopify store:

  1. User clicks ad → lands on PDP. URL contains oppref query parameter.
  2. Pixel captures oppref, writes it to __oppref cookie.
  3. Server-side checkout webhook fires. Backend reads oppref from session/cart metadata (which was populated from the cookie or query string at landing).
  4. Backend sends order_created to Conversions API with oppref included.

Without that bridge, server-side events lose the click attribution.

Example event

curl -X POST "https://bzr.openai.com/v1/events?pid=<PIXEL-ID>" 
  -H "Authorization: Bearer <API-KEY>" 
  -H "Content-Type: application/json" 
  --data '{
    "validate_only": false,
    "events": [{
      "id": "order_12345",
      "type": "order_created",
      "timestamp_ms": 1773892800000,
      "oppref": "oppref_abc",
      "source_url": "https://shop.example.com/checkout/confirmation",
      "action_source": "web",
      "data": {
        "type": "contents",
        "amount": 2599,
        "currency": "USD",
        "contents": [{
          "id": "sku_123",
          "name": "Starter bundle",
          "content_type": "product",
          "quantity": 1
        }]
      }
    }]
  }'

Server event metadata fields

FieldRequiredDescription
idYesUnique event identifier. Used with type to deduplicate.
typeYesStandard event name or custom.
timestamp_msYesEvent time in ms. Within last 7 days, no more than 10 minutes ahead.
custom_event_nameConditionalRequired when type is custom.
opprefNoOpenAI privacy-preserving identifier. Forward when available.
source_urlConditionalRequired when action_source is web.
action_sourceNoOne of web, mobile_app, offline, physical_store, phone_call, email, other.
userNoOptional user fields that improve attribution accuracy.
opt_outNotrue opts the event out of future user-level personalisation. Defaults to false.
dataYesEvent data matching the type. See Chapter 11.