auto_write
cs

Propose a remedy on a customer thread the way the CS agent proposes one: a partial refund the customer keeps the item fo

Changed on

Propose a remedy on a customer thread the way the CS agent proposes one: a partial refund the customer keeps the item for, a full refund on a return, a cancel, a gift card, a single-use discount code on the next order, or a free replacement of named products. It moves no money and calls no shop: the store's own remedy policy (ladder, tier caps, gift-card and discount ceilings, fraud and high-value-customer gates, the photograph rule for a replacement, daily cap) decides it like the agent's own proposal, and the result is one action awaiting approval (evaluation_id) or refused by that policy (blocked with the reason). Nothing runs until it is approved — through the action approval or by a person in the inbox. amount is in the store's currency and required for a refund or gift card; a cancel refunds what the shop computes. percent is required for a discount: it is issued as that share of the thread's order total, as a fixed amount; without an order in the store's currency it stays a percentage whose value nobody can count. line_items (Magistry variant ids and quantities) is required for a replacement and priced at the variants' prices when proposed; defect_evidence names the photograph on the thread that shows the defect, which the policy requires. The result states amount_minor and currency — the merchant's own money, the number an approval or a write grant is checked against — or amount_unknown, which only a person can approve. order_id is the Magistry order id, defaulting to the thread's order; it must be one of the customer's own orders on the thread (order_not_on_thread otherwise), and a refund, cancel or replacement needs one (order_required). Amounts are cut down to the currency's minor units. The result names the order (order_id, order_name). A second call for the same open action returns the first (result: already_proposed) with the earlier proposal's amount; requested_amount is what this call asked, in major units — when the two differ, the requested amount was not proposed. Requires an idempotency_key.

post/api/v1/tools/cs_remedy_propose

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
      Scopescs:write

Headers

Idempotency-Key, string

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

object required
thread_id, string uuid required
kind, 'partial_refund_keep_item' | 'return_full_refund' | 'cancel_order' | 'gift_card' | 'discount_next_order' | 'replacement' required
amount, number

Refund or gift-card amount in the store currency; required for those.

percent, number

Discount percentage; required for discount_next_order.

line_items, object[]

The products a replacement sends; required for replacement.

defect_evidence, object

For a replacement: which photograph on the thread shows the defect, and what it shows.

order_id, string uuid

Magistry order id (cs_orders), one of the customer's own orders on the thread; default: the thread's order.

reason, string required

Why — recorded on the proposal and shown to the approver.

idempotency_key, string required

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

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