# Examples

> Copy-ready bodies for the events most companies send to Baker: a deal won in a CRM, an order with its products, a refund, a lead moving through the pipeline, a historical backfill and an event named only by its ad click id. Each is checked against the live contract before it is published, so it is accepted exactly as shown.

Source: https://withbaker.com/docs/examples · Updated 2026-11-23

## A deal closed in your CRM

Send it the moment the deal is marked won, with the money on it.

```json
{
  "events": [
    {
      "event_name": "deal_won",
      "event_id": "deal-48213-won",
      "event_time": "2026-11-20T14:03:00Z",
      "user_data": {
        "email": "laura@example.com",
        "external_id": "crm-contact-9921"
      },
      "value": "1200.00",
      "currency": "EUR",
      "properties": {
        "pipeline": "Enterprise",
        "owner": "Marta"
      }
    }
  ]
}
```

## An order paid in your store

One event per order, with one line per product, so reports can break revenue down by product.

```json
{
  "events": [
    {
      "event_name": "purchase",
      "event_id": "order-100482",
      "user_data": {
        "email": "laura@example.com",
        "phone": "+34600111222",
        "fbp": "fb.1.1763650000000.1234567890"
      },
      "value": "89.90",
      "currency": "EUR",
      "items": [
        {
          "product_id": "SKU-TEE-01",
          "variant_id": "SKU-TEE-01-M",
          "quantity": 2,
          "price": "29.95"
        },
        {
          "product_id": "SKU-CAP-02",
          "quantity": 1,
          "price": "30.00"
        }
      ],
      "consent": {
        "analytics": "granted",
        "marketing": "granted"
      }
    }
  ]
}
```

## A refund

A refund is its own event, with the amount that went back as a positive number. Give it the refund's own id, and name the order in properties so the two can be read together.

```json
{
  "events": [
    {
      "event_name": "refund",
      "event_id": "order-100482-refund-1",
      "user_data": {
        "email": "laura@example.com"
      },
      "properties": {
        "order_id": "order-100482"
      },
      "value": "29.95",
      "currency": "EUR",
      "items": [
        {
          "product_id": "SKU-TEE-01",
          "variant_id": "SKU-TEE-01-M",
          "quantity": 1,
          "price": "29.95"
        }
      ]
    }
  ]
}
```

## A lead moving through your pipeline

Send each stage as it happens, so campaigns are judged on the leads sales kept, not only on form fills.

```json
{
  "events": [
    {
      "event_name": "qualified_lead",
      "event_id": "crm-contact-9921-qualified",
      "user_data": {
        "external_id": "crm-contact-9921",
        "email": "laura@example.com"
      }
    },
    {
      "event_name": "opportunity",
      "event_id": "deal-48213-opened",
      "user_data": {
        "external_id": "crm-contact-9921"
      },
      "value": "1200.00",
      "currency": "EUR"
    }
  ]
}
```

## A backfill of last year's history

Old events are welcome: give each its own event_time and event_id, and send up to 500 per request.

```json
{
  "events": [
    {
      "event_name": "deal_won",
      "event_id": "deal-30117-won",
      "event_time": 1735725600,
      "user_data": {
        "email": "jordi@example.com"
      },
      "value": "4800",
      "currency": "EUR"
    },
    {
      "event_name": "deal_lost",
      "event_id": "deal-30122-lost",
      "event_time": "2025-01-14T09:30:00+01:00",
      "user_data": {
        "email": "ana@example.com"
      }
    }
  ]
}
```

## A call booked from an ad click (gclid)

When all you kept is the click id the visitor arrived with, send it: it names the person and the campaign.

```json
{
  "events": [
    {
      "event_name": "schedule",
      "url": "https://example.com/book?utm_source=google&utm_campaign=brand",
      "user_data": {
        "gclid": "EAIaIQobChMI8sLd0tqZjwMVf0D_AR0abc"
      }
    }
  ]
}
```

## Need help?

Write to support@withbaker.com: a person answers within 24 hours. The OpenAPI description is at https://withbaker.com/docs/openapi.json.
