patch-private-orders-ORDER_ID-forget.rst (2058B)
1 .. http:patch:: [/instances/$INSTANCE]/private/orders/$ORDER_ID/forget 2 3 Forget fields in an order's contract terms that the merchant no 4 longer needs. 5 6 **Required permission:** ``orders-write`` 7 8 **Request:** 9 10 The request must be a `forget request <ForgetRequest>`. The fields specified 11 must have been marked as forgettable when the contract was created. Fields in 12 the request that are not in the `contract terms <ContractTerms>` are ignored. 13 14 A valid 15 JSON path is defined as a string beginning with ``$.`` that follows the dot 16 notation: ``$.wire_fee``, for example. The ``$`` represents the `contract terms <ContractTerms>` 17 object, and an identifier following a ``.`` represents the field of that 18 identifier belonging to the object preceding the dot. Arrays can be indexed 19 by an non-negative integer within brackets: ``$.products[1]``. An asterisk ``*`` 20 can be used to index an array as a wildcard, which expands the path into a 21 list of paths containing one path for 22 each valid array index: ``$.products[*].description``. For a path to be valid, 23 it must end with a reference to a field of an object (it cannot end with an 24 array index or wildcard). 25 26 **Response:** 27 28 :http:statuscode:`200 OK`: 29 The merchant deleted the specified fields from the contract of 30 order $ORDER_ID. 31 :http:statuscode:`204 No content`: 32 The merchant had already deleted the specified fields 33 from the contract of order $ORDER_ID. 34 :http:statuscode:`400 Bad request`: 35 The request is malformed or one of the paths is invalid. 36 :http:statuscode:`404 Not found`: 37 The merchant backend could not find the order or the instance 38 and thus cannot process the forget request. 39 :http:statuscode:`409 Conflict`: 40 The request includes a field that was not marked as forgettable, so 41 the merchant cannot delete that field. 42 43 **Details:** 44 45 .. ts:def:: ForgetRequest 46 47 interface ForgetRequest { 48 49 // Array of valid JSON paths to forgettable fields in the order's 50 // contract terms. 51 fields: string[]; 52 }