propose_write
general

Propose the value one field of a store should have, as its single owner.

Changed on

The scope checked depends on resource_kind: variant needs catalog:write, campaign needs ads:write; the broad write covers every kind. A token without it is refused 403 insufficient_scope with required_scopes. Creates an approval card and answers 202 with status: "proposed", plan_action_id, where and approve_url; nothing is declared until the merchant approves it in Magistry, whatever the connection's auto-apply setting. The checks below then run at approval. A field has at most one owner, enforced by a unique index. The merchant grants this app a field in Settings → Developers → Connected apps; without that grant the answer is 409 no_policy, and while another owner holds the field it is 409 held_by_other with held_by; a field whose outside change the merchant kept is 409 merchant_kept until a store rule allows declaring it again. Declaring reaches nothing outside Magistry: a reconciler reads the row and is the only code that writes to the platform, and it may still refuse the value (a price under the margin floor), which the declaration's status then reports. Declarable fields: variant: price, compare_at_price (needs catalog:write); campaign: status, daily_budget, bidding (needs ads:write). A declaration always expires, at most 30 days out.

post/api/v1/intent

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
      Scopeswrite

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 to act on. Defaults to the store the credential was issued for.

resource_kind, 'variant' | 'campaign' required
resource_ref, string required

The id of the variant or campaign, in Magistry.

field, string required
desired, union required

The value the field should have. Its shape depends on the field — variant.price: a positive number; variant.compare_at_price: a positive number, or null to clear it; campaign.status: one of "active", "paused"; campaign.daily_budget: a positive number; campaign.bidding: a JSON object.

reason, string
expires_at, string date-time

Clamped to 30 days.

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