auto_write

Ask the merchant to approve something this app is about to do.

Creates a request the merchant sees on their Alerts screen, and emits approval.requested. A person approves or rejects it; no app can, including this one. The outcome arrives as approval.decided or approval.expired on this app's webhook subscription (subscribe to approval.*), and can be read with approval_status. A request with no decision by expires_at is closed as expired, which means NOT approved. expires_at defaults to 72 hours and must lie between 5 minutes and 7 days from now. Send an idempotency_key to make a retry safe: the same key with the same title, payload and amount returns the original request; a different one is 409 idempotency_conflict. At most 50 requests per app may be pending on a store.

post/api/v1/approvals

Request

  • Base URL: https://app.magistry.io
  • URL: https://app.magistry.io/api/v1/approvals
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.magistry.io/api/oauth/authorize, token URL https://app.magistry.io/api/oauth/token, scopes: automation:write)

Request body

store_idstring uuid

The store whose merchant decides. Defaults to the store the credential was issued for.

titlestring required

What the merchant is asked to approve, in one line.

detailstring
payloadobject

Anything the app needs back with the decision. At most 16 KB.

amount_centsinteger

Money at stake, if any. Needs currency.

currencystring
reversibility_class'reversible' | 'compensatable' | 'irreversible'
expires_atstring date-time
idempotency_keystring

Response

Result

okboolean required
resultunknown required

Changes

No recorded changes to this operation across all 2 revisions of this API.