Declare an ad credit, or update one with credit_id. Platform promotional credit (for example a Google Ads promotion) is
Changed onDeclare an ad credit, or update one with credit_id. Platform promotional credit (for example a Google Ads promotion) is lost on its expiry date if it is not spent. The Google Ads API does not return promotions, so a credit is declared in Magistry from the Billing page and re-declared when Billing shows a new consumed amount. Without credit_id: amount, currency and expires_on are required; platform defaults to google, spent_at_declaration to 0 and declared_on to today. With credit_id: a new Billing reading (spent_at_declaration, with declared_on, which defaults to today), expires_on, max_daily (null clears it), finish_buffer_days, event_multipliers (keys bfcm, christmas or an ISO date), status or note. spent_at_declaration never exceeds amount. A spend-to-earn promotion ("spend 900 within 60 days, get 640, use it within 60 days") is declared with threshold_amount, earn_days (from redeemed_on, default today) or earn_deadline, amount (the credit) and use_days; its plan is then an earn phase with a daily floor the Brain may not plan under, and it switches to the credit phase when the threshold is met (from synced spend, or threshold_met_on). Re-declare the qualifying spend Billing shows as spent_toward_threshold (threshold_read_on defaults to today). Writes only Magistry's own record of the credit and who declared it; nothing is written to an ad platform and no budget changes. Executes at once and returns the credit with its plan summary.
Request
- Base URLhttps://app.magistry.io
- Auth
- HTTP bearer
- or OAuth 2Authorization codehttps://app.magistry.io/api/oauth/authorizeToken URLhttps://app.magistry.io/api/oauth/tokenScopesads:write
Headers
Required, here or as idempotency_key in the body. A unique string you choose for this request; send the SAME key when retrying and the first answer is returned instead of writing twice (idempotent-replayed: true). The same key with other arguments is 409 idempotency_conflict. If the header and idempotency_key are both sent they must be equal.
Request body
Update this credit: its id as the list of credits returns it.
New credit only; default google.
New credit only: the promotion code as Billing shows it.
New credit only: the credit, in its currency (major units).
New credit only: ISO 4217 code.
New credit only.
The day the platform takes back what is unspent.
Consumed amount as Billing shows it on declared_on.
The day of that Billing reading; default today.
Days before expiry the plan aims to finish; default 4.
Cap on one day's target; null clears it.
Weight overrides: 'bfcm' (default 1.35), 'christmas' (24-26 December, default 0.5) or an ISO date.
New credit only; default from the caller (a person is operator, an app agent).
New promotion only: the spend that earns the credit.
Last day spend counts toward the threshold.
New promotion only: days from redeemed_on (default today) to earn it; sets earn_deadline.
Qualifying spend as Billing shows it on threshold_read_on.
The day of that reading; default today.
Update only: the day Billing shows the credit was earned.
Days the earned credit stays usable; expires_on defaults to earn_deadline + use_days.
Required. A unique string you choose for this request. Send the SAME key when retrying after a timeout and Magistry returns the original outcome instead of performing the write twice. Reusing a key with different arguments is refused rather than replayed.
Response
Tool result
Changes
- warning
added the new
method_not_allowedenum value to theerrorresponse property for the response status - warning
added the new
method_not_allowedenum value to theerrorresponse property for the response status - warning
added the new
method_not_allowedenum value to theerrorresponse property for the response status
11 more changes in this revision
- warning