auto_write
automation

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

Changed on

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
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization codehttps://app.magistry.io/api/oauth/authorize
      Token URLhttps://app.magistry.io/api/oauth/token
      Scopesautomation:write

Headers

Idempotency-Key, string

Optional; honoured when sent. 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

object required
store_id, string uuid

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

title, string required

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

detail, string
payload, object

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

amount_cents, integer

Money at stake, if any. Needs currency.

currency, string
reversibility_class, 'reversible' | 'compensatable' | 'irreversible'
expires_at, string date-time
idempotency_key, string

Response

Result

object required
ok, boolean required
result, unknown required

Changes

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    11 more changes in this revision