Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/pages/me/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,15 @@ The request body is JSON. The fields, in any order:
| `project_key` | yes | Your project, `pk_test_…` or `pk_live_…` |
| `subtype` | yes | An event your project defined and enabled, built-in or your own |
| `user_address` | backend | Who earns: the person's `did_oc` from their sign-in token. Accepted only when signed |
| `payment_amount_sats` | some | The payment, for an event priced as a share of one |
| `payment_amount_sats` | some | The payment in whole sats, for an event priced as a share of one |
| `action_label` | no | A short label shown on the receipt: up to 280 characters of plain text |
| `note` | no | A note shown to the person: up to 280 characters of plain text |
| `note` | no | Public plain text shown to the person, in the event's receipt: up to 280 characters |
| `is_agent` | no | `true` when an AI agent acted for the person |

A built-in event keeps only the text its class shows: `note` on a class A event,
`action_label` on a class B event, neither on class C. Your own events keep
both.

Sign the exact bytes you send, in one header:

```
Expand Down Expand Up @@ -355,7 +359,7 @@ Without the SDK, the header is
| 200 | `earned: false`, `reason: not_paying` | Outside your pay periods: no event recorded or charged |
| 400 | `invalid_user_address` | `user_address` is not a `did:oc` |
| 400 | `project_key_required`, `subtype_required` | A required field is missing |
| 400 | `payment_amount_sats_required` | The event is priced as a share of a payment and `payment_amount_sats` is missing |
| 400 | `payment_amount_sats_required` | The event is priced as a share of a payment and `payment_amount_sats` is missing, not above 0 or not whole sats |
| 400 | `idempotency_key_too_long` | `Idempotency-Key` is longer than 200 characters |
| 401 | `invalid_signature` | The header is there but does not verify (`stale_timestamp`, `future_timestamp`, `bad_signature`, `invalid_format`) |
| 401 | `signature_required` | A live project, or one requiring signed events, got an unsigned request |
Expand Down
Loading