taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

patch-private-orders-ORDER_ID-forget.rst (2602B)


      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     Returned with ``TALER_EC_MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT``.
     37   :http:statuscode:`404 Not found`:
     38     The merchant backend could not find the order or the instance
     39     and thus cannot process the forget request.
     40     Returned with ``TALER_EC_MERCHANT_GENERIC_ORDER_UNKNOWN``
     41     or ``TALER_EC_MERCHANT_GENERIC_INSTANCE_UNKNOWN``.
     42   :http:statuscode:`409 Conflict`:
     43     The request includes a field that was not marked as forgettable, so
     44     the merchant cannot delete that field.
     45     Returned with ``TALER_EC_MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_NOT_FORGETTABLE``.
     46   :http:statuscode:`500 Internal Server Error`:
     47     The server experienced an internal failure.
     48     Returned with ``TALER_EC_GENERIC_DB_START_FAILED``,
     49     ``TALER_EC_GENERIC_DB_FETCH_FAILED``, or
     50     ``TALER_EC_GENERIC_DB_COMMIT_FAILED``.
     51 
     52   **Details:**
     53 
     54   .. ts:def:: ForgetRequest
     55 
     56     interface ForgetRequest {
     57 
     58       // Array of valid JSON paths to forgettable fields in the order's
     59       // contract terms.
     60       fields: string[];
     61     }