Skip to main content

Sales API

Every sales call: what to send, what comes back, and copy-ready examples.

On this page

List sales

GET/salesScope: sales:read

In the address and headers

fromquery, optional
text
toquery, optional
text
modelquery, optional
first, last, even, position, decay
channelquery, optional
youtube, instagram, tiktok, x, linkedin, facebook, email, dm, podcast, website, referral, direct, unknown, other
campaign_idquery, optional
id (UUID)
link_idquery, optional
id (UUID)
limitquery, optional
whole number. 1 or more, 100 or less, starts as 50
cursorquery, optional
text. up to 400 letters
statusquery, optional
matched, unknown, refunded, manual, disputed
curl "https://api.usetotems.com/v1/sales?status=unknown&limit=50" \
  -H "Authorization: Bearer $TOTEMS_KEY"
Answer, status 200 (sample data)
{
  "data": [
    {
      "id": "6f20adad-3b47-4c0e-9a55-1f2e3d4c5b6a",
      "occurred_at": "2026-11-28T11:34:55.767Z",
      "person_id": "6f20cc9c-3b47-4c0e-9a55-1f2e3d4c5b6a",
      "person_name": "Reese Demo",
      "amount_cents": 4913,
      "net_cents": 3276,
      "currency": "USD",
      "home_net_cents": 3276,
      "label": "Template pack",
      "source": "stripe",
      "first_touch": {
        "at": "2026-09-16T22:51:46.218Z",
        "title": "How I plan my week",
        "channel": "youtube",
        "content_id": "6f20eb8b-3b47-4c0e-9a55-1f2e3d4c5b6a"
      },
      "last_touch": {
        "at": "2026-11-25T17:34:55.767Z",
        "title": "Five pricing mistakes",
        "channel": "youtube",
        "content_id": "6f210a7a-3b47-4c0e-9a55-1f2e3d4c5b6a"
      },
      "match_method": "visitor",
      "status": "ok"
    }
  ],
  "next_cursor": "MjAyNi0xMS0yOCAwNDoxNDoyNS44MDI3NjcrMDB8ZTQ2MzVmYzktOTFhZS00MDNkLTllMTMtMDFjN2JlNWYxNGE3",
  "request_id": "req_..."
}

Add a trusted sale

POST/salesScope: sales:write

In the address and headers

Idempotency-Keyheader, optional
text. up to 200 letters

Body

external_idneeded
text. up to 200 letters
amount_centsneeded
whole number. 0 or more, 1,000,000,000,000 or less
currencyneeded
text
occurred_atoptional
UTC time
labeloptional
text. up to 200 letters
nameoptional
text. up to 200 letters
emailoptional
email
phoneoptional
text. up to 40 letters
visitor_idoptional
text. up to 40 letters
click_idoptional
text. up to 40 letters
stripe_customeroptional
text. up to 100 letters
fx_rateoptional
text
is_testoptional
true or false
curl -X POST "https://api.usetotems.com/v1/sales" \
  -H "Authorization: Bearer $TOTEMS_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "order-1001",
    "amount_cents": 200000,
    "currency": "USD",
    "email": "alex@example.com",
    "occurred_at": "2026-11-09T15:00:00Z",
    "label": "Coaching plan"
  }'
Answer, status 201 (sample data)
{
  "data": {
    "created": true,
    "id": "2a8faca9-7c15-4e2b-8d44-5b6a7c8d9e0f",
    "occurred_at": "2026-12-03T23:43:22.494Z",
    "amount_cents": 200000,
    "refunded_cents": 0,
    "disputed_cents": 0,
    "net_cents": 200000,
    "currency": "USD",
    "home_net_cents": 200000,
    "home_currency": "USD",
    "label": "Coaching plan",
    "source": "api",
    "status": "ok",
    "is_test": true,
    "manual_content_id": null,
    "match": {
      "method": "email",
      "person_id": "2a847cfa-7c15-4e2b-8d44-5b6a7c8d9e0f"
    },
    "credit": {
      "first": [
        {
          "content_id": null,
          "title": null,
          "channel": "unknown",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "last": [
        {
          "content_id": null,
          "title": null,
          "channel": "unknown",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "even": [
        {
          "content_id": null,
          "title": null,
          "channel": "unknown",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "position": [
        {
          "content_id": null,
          "title": null,
          "channel": "unknown",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "decay": [
        {
          "content_id": null,
          "title": null,
          "channel": "unknown",
          "share": 1,
          "amount_cents": 200000
        }
      ]
    },
    "refunds": [],
    "proof": [
      "$2,000 came from api on 3 Dec 2026, 23:43.",
      "We matched the sale with the same email.",
      "We found no tracked click in the 90 days before the sale. The credit is Unknown."
    ],
    "window_days": 90
  },
  "request_id": "req_..."
}

Sale and proof

GET/sales/{id}Scope: sales:read

In the address and headers

idin the path, needed
id (UUID)

The example uses a made-up id. Put one of your own in its place.

curl "https://api.usetotems.com/v1/sales/6f1d2c9a-3b47-4c0e-9a55-1f2e3d4c5b6a" \
  -H "Authorization: Bearer $TOTEMS_KEY"
Answer, status 200 (sample data)
{
  "data": {
    "id": "6f20adad-3b47-4c0e-9a55-1f2e3d4c5b6a",
    "occurred_at": "2026-11-28T11:34:55.767Z",
    "amount_cents": 4913,
    "refunded_cents": 1637,
    "disputed_cents": 0,
    "net_cents": 3276,
    "currency": "USD",
    "home_net_cents": 3276,
    "home_currency": "USD",
    "label": "Template pack",
    "source": "stripe",
    "status": "ok",
    "is_test": false,
    "manual_content_id": null,
    "match": {
      "method": "visitor",
      "person_id": "6f20cc9c-3b47-4c0e-9a55-1f2e3d4c5b6a"
    },
    "credit": {
      "first": [
        {
          "content_id": "6f20eb8b-3b47-4c0e-9a55-1f2e3d4c5b6a",
          "title": "How I plan my week",
          "channel": "youtube",
          "share": 1,
          "amount_cents": 3276
        }
      ],
      "last": [
        {
          "content_id": "6f210a7a-3b47-4c0e-9a55-1f2e3d4c5b6a",
          "title": "Five pricing mistakes",
          "channel": "youtube",
          "share": 1,
          "amount_cents": 3276
        }
      ],
      "even": [
        {
          "content_id": "6f20eb8b-3b47-4c0e-9a55-1f2e3d4c5b6a",
          "title": "How I plan my week",
          "channel": "youtube",
          "share": 0.33333333,
          "amount_cents": 1092
        },
        {
          "content_id": "6f214858-3b47-4c0e-9a55-1f2e3d4c5b6a",
          "title": "Email that gets replies",
          "channel": "email",
          "share": 0.33333333,
          "amount_cents": 1092
        }
      ],
      "position": [
        {
          "content_id": "6f20eb8b-3b47-4c0e-9a55-1f2e3d4c5b6a",
          "title": "How I plan my week",
          "channel": "youtube",
          "share": 0.4,
          "amount_cents": 1311
        },
        {
          "content_id": "6f214858-3b47-4c0e-9a55-1f2e3d4c5b6a",
          "title": "Email that gets replies",
          "channel": "email",
          "share": 0.2,
          "amount_cents": 655
        }
      ],
      "decay": [
        {
          "content_id": "6f20eb8b-3b47-4c0e-9a55-1f2e3d4c5b6a",
          "title": "How I plan my week",
          "channel": "youtube",
          "share": 0.00055876,
          "amount_cents": 2
        },
        {
          "content_id": "6f214858-3b47-4c0e-9a55-1f2e3d4c5b6a",
          "title": "Email that gets replies",
          "channel": "email",
          "share": 0.43960005,
          "amount_cents": 1440
        }
      ]
    },
    "refunds": [
      {
        "id": "6f216747-3b47-4c0e-9a55-1f2e3d4c5b6a",
        "amount_cents": 1637,
        "reason": "Asked for a refund",
        "occurred_at": "2026-11-30T11:34:55.767Z"
      }
    ],
    "proof": [
      "$49.13 came from stripe on 28 Nov 2026, 06:34.",
      "We matched the sale with a browser id from your own site."
    ],
    "window_days": 90
  },
  "request_id": "req_..."
}

Choose credit by hand

PATCH/sales/{id}/creditScope: sales:write

In the address and headers

idin the path, needed
id (UUID)
Idempotency-Keyheader, optional
text. up to 200 letters

Body

content_idneeded
id (UUID)
reasonneeded
text. up to 500 letters

The example uses a made-up id. Put one of your own in its place.

curl -X PATCH "https://api.usetotems.com/v1/sales/6f1d2c9a-3b47-4c0e-9a55-1f2e3d4c5b6a/credit" \
  -H "Authorization: Bearer $TOTEMS_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "content_id": "6f1d2c9a-3b47-4c0e-9a55-1f2e3d4c5b6a",
    "reason": "Alex told us on the call"
  }'
Answer, status 200 (sample data)
{
  "data": {
    "id": "2a8faca9-7c15-4e2b-8d44-5b6a7c8d9e0f",
    "occurred_at": "2026-12-03T23:43:22.494Z",
    "amount_cents": 200000,
    "refunded_cents": 0,
    "disputed_cents": 0,
    "net_cents": 200000,
    "currency": "USD",
    "home_net_cents": 200000,
    "home_currency": "USD",
    "label": "Coaching plan",
    "source": "api",
    "status": "ok",
    "is_test": true,
    "manual_content_id": "2a6e1d9c-7c15-4e2b-8d44-5b6a7c8d9e0f",
    "match": {
      "method": "email",
      "person_id": "2a847cfa-7c15-4e2b-8d44-5b6a7c8d9e0f"
    },
    "credit": {
      "first": [
        {
          "content_id": "2a6e1d9c-7c15-4e2b-8d44-5b6a7c8d9e0f",
          "title": "How I plan my week (new cut)",
          "channel": "youtube",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "last": [
        {
          "content_id": "2a6e1d9c-7c15-4e2b-8d44-5b6a7c8d9e0f",
          "title": "How I plan my week (new cut)",
          "channel": "youtube",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "even": [
        {
          "content_id": "2a6e1d9c-7c15-4e2b-8d44-5b6a7c8d9e0f",
          "title": "How I plan my week (new cut)",
          "channel": "youtube",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "position": [
        {
          "content_id": "2a6e1d9c-7c15-4e2b-8d44-5b6a7c8d9e0f",
          "title": "How I plan my week (new cut)",
          "channel": "youtube",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "decay": [
        {
          "content_id": "2a6e1d9c-7c15-4e2b-8d44-5b6a7c8d9e0f",
          "title": "How I plan my week (new cut)",
          "channel": "youtube",
          "share": 1,
          "amount_cents": 200000
        }
      ]
    },
    "refunds": [],
    "proof": [
      "$2,000 came from api on 3 Dec 2026, 23:43.",
      "We matched the sale with the same email.",
      "Someone on your team chose the credit by hand. The rules do not change it.",
      "A click shows part of the path. It does not prove one thing caused the sale."
    ],
    "window_days": 90
  },
  "request_id": "req_..."
}

Go back to the rules

DELETE/sales/{id}/creditScope: sales:write

In the address and headers

idin the path, needed
id (UUID)
Idempotency-Keyheader, optional
text. up to 200 letters

The example uses a made-up id. Put one of your own in its place.

curl -X DELETE "https://api.usetotems.com/v1/sales/6f1d2c9a-3b47-4c0e-9a55-1f2e3d4c5b6a/credit" \
  -H "Authorization: Bearer $TOTEMS_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Answer, status 200 (sample data)
{
  "data": {
    "id": "2a8faca9-7c15-4e2b-8d44-5b6a7c8d9e0f",
    "occurred_at": "2026-12-03T23:43:22.494Z",
    "amount_cents": 200000,
    "refunded_cents": 0,
    "disputed_cents": 0,
    "net_cents": 200000,
    "currency": "USD",
    "home_net_cents": 200000,
    "home_currency": "USD",
    "label": "Coaching plan",
    "source": "api",
    "status": "ok",
    "is_test": true,
    "manual_content_id": null,
    "match": {
      "method": "email",
      "person_id": "2a847cfa-7c15-4e2b-8d44-5b6a7c8d9e0f"
    },
    "credit": {
      "first": [
        {
          "content_id": null,
          "title": null,
          "channel": "unknown",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "last": [
        {
          "content_id": null,
          "title": null,
          "channel": "unknown",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "even": [
        {
          "content_id": null,
          "title": null,
          "channel": "unknown",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "position": [
        {
          "content_id": null,
          "title": null,
          "channel": "unknown",
          "share": 1,
          "amount_cents": 200000
        }
      ],
      "decay": [
        {
          "content_id": null,
          "title": null,
          "channel": "unknown",
          "share": 1,
          "amount_cents": 200000
        }
      ]
    },
    "refunds": [],
    "proof": [
      "$2,000 came from api on 3 Dec 2026, 23:43.",
      "We matched the sale with the same email.",
      "We found no tracked click in the 90 days before the sale. The credit is Unknown."
    ],
    "window_days": 90
  },
  "request_id": "req_..."
}

Add a refund

POST/sales/{id}/refundsScope: sales:write

In the address and headers

idin the path, needed
id (UUID)
Idempotency-Keyheader, optional
text. up to 200 letters

Body

external_idneeded
text. up to 200 letters
amount_centsneeded
whole number. 1 or more, 1,000,000,000,000 or less
reasonoptional
text. up to 300 letters
occurred_atoptional
UTC time

The example uses a made-up id. Put one of your own in its place.

curl -X POST "https://api.usetotems.com/v1/sales/6f1d2c9a-3b47-4c0e-9a55-1f2e3d4c5b6a/refunds" \
  -H "Authorization: Bearer $TOTEMS_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "refund-1001",
    "amount_cents": 50000,
    "reason": "Left early"
  }'
Answer, status 201 (sample data)
{
  "data": {
    "refund_id": "2a96110d-7c15-4e2b-8d44-5b6a7c8d9e0f",
    "created": true,
    "sale": {
      "id": "2a8faca9-7c15-4e2b-8d44-5b6a7c8d9e0f",
      "occurred_at": "2026-12-03T23:43:22.494Z",
      "amount_cents": 200000,
      "refunded_cents": 50000,
      "disputed_cents": 0,
      "net_cents": 150000,
      "currency": "USD",
      "home_net_cents": 150000,
      "home_currency": "USD",
      "label": "Coaching plan",
      "source": "api",
      "status": "ok",
      "is_test": true,
      "manual_content_id": null,
      "match": {
        "method": "email",
        "person_id": "2a847cfa-7c15-4e2b-8d44-5b6a7c8d9e0f"
      },
      "credit": {
        "first": [
          {
            "content_id": null,
            "title": null,
            "channel": "unknown",
            "share": 1,
            "amount_cents": 150000
          }
        ],
        "last": [
          {
            "content_id": null,
            "title": null,
            "channel": "unknown",
            "share": 1,
            "amount_cents": 150000
          }
        ],
        "even": [
          {
            "content_id": null,
            "title": null,
            "channel": "unknown",
            "share": 1,
            "amount_cents": 150000
          }
        ],
        "position": [
          {
            "content_id": null,
            "title": null,
            "channel": "unknown",
            "share": 1,
            "amount_cents": 150000
          }
        ],
        "decay": [
          {
            "content_id": null,
            "title": null,
            "channel": "unknown",
            "share": 1,
            "amount_cents": 150000
          }
        ]
      },
      "refunds": [
        {
          "id": "2a96110d-7c15-4e2b-8d44-5b6a7c8d9e0f",
          "amount_cents": 50000,
          "reason": "Left early",
          "occurred_at": "2026-12-03T23:43:23.449Z"
        }
      ],
      "proof": [
        "$2,000 came from api on 3 Dec 2026, 23:43.",
        "We matched the sale with the same email.",
        "We found no tracked click in the 90 days before the sale. The credit is Unknown.",
        "$500 was refunded, so every touch lost the same share."
      ],
      "window_days": 90
    }
  },
  "request_id": "req_..."
}
Was this useful?

Your answer stays in this browser.

Last checked: Made from the live API rulesPlain MarkdownSomething wrong? Tell us