Record a payment
Record a payment, renewal, refund or free trial from your own checkout or billing. Needs a key with the Revenue and payments: write permission (keys made before permissions: the events, write or admin scope). amount is integer minor units (4900 is 49.00). transactionId makes the call safe to retry: the same id is recorded once. A refund sends refunded: true with the sale’s transactionId and takes the sale’s attribution. timestamp may go back 365 days. The payment is attributed, converted to the site’s currency and announced on Realtime like a payment from a connected provider. trial: true records a free trial start instead: amount may be 0 or left out (when sent, it is the price the trial converts to and is not revenue), it is attributed like a sale, never announced as one, and converts when the same customer pays within 60 days. An amount of 0 without trial is refused.
Authorizations
An API key that starts with cs_sk_, created under API and MCP, API keys. A key covers every site of its workspace or a chosen list, and carries permissions per resource (Analytics, Revenue and payments, Goals and events, Funnels, Sites, Notes, Alerts) and extras (Visitor details, Raw events export, Team members, Workspace name, See API keys, Manage API keys). A change acts for the key's creator, with their current role. A request outside them answers 403 naming the missing permission.
Body
Required for a payment: the amount in minor units of the currency (4900 is 49.00 USD), at least 1. For a refund, the amount refunded. With trial: true it may be 0 or left out; when sent, it is the price the trial converts to and is not counted as revenue.
0 <= x <= 1000000000000Response
Sent before: nothing new was recorded.