taler-docs

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

delete-private-products-PRODUCT_ID.rst (1757B)


      1 .. http:delete:: [/instances/$INSTANCE]/private/products/$PRODUCT_ID
      2 
      3   Delete information about a product.  By default this fails if the product
      4   is locked by anyone (for example because units are reserved by a shopping
      5   cart or an unpaid order).  Deletion can be forced using the ``force``
      6   query parameter, in which case any locks held on the product are released
      7   before it is deleted.  Note that forcing the deletion of a locked product
      8   may disrupt customer flows that depend on those locks (such as pending
      9   shopping carts), so it should be used with care.
     10 
     11   **Required permission:** ``products-write``
     12 
     13   **Request:**
     14 
     15   :query force: *Optional.* If set to ``yes``, the product is deleted even
     16     if it is currently locked, releasing any locks held on it.  Any other
     17     value (or omitting the parameter) keeps the default behavior of
     18     refusing to delete a locked product. 
     19     Since protocol **v32**.
     20 
     21   **Response:**
     22 
     23   :http:statuscode:`204 No content`:
     24     The backend has successfully deleted the product.
     25   :http:statuscode:`401 Unauthorized`:
     26     The request is unauthorized.
     27     Returned with ``TALER_EC_MERCHANT_GENERIC_UNAUTHORIZED``.
     28   :http:statuscode:`404 Not found`:
     29     The backend does not know the instance or the product.
     30     Returned with ``TALER_EC_MERCHANT_GENERIC_PRODUCT_UNKNOWN``.
     31   :http:statuscode:`409 Conflict`:
     32     The backend refuses to delete the product because it is locked
     33     and ``force`` was not set to ``yes``.
     34     Returned with ``TALER_EC_MERCHANT_PRIVATE_DELETE_PRODUCTS_CONFLICTING_LOCK``.
     35   :http:statuscode:`500 Internal Server Error`:
     36     The server experienced an internal failure.
     37     Returned with ``TALER_EC_GENERIC_DB_STORE_FAILED`` or
     38     ``TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE``.