patch-private-pots-POT_ID.rst (1900B)
1 .. http:patch:: [/instances/$INSTANCE]/private/pots/$POT_ID 2 3 This is used to update a pot. 4 5 **Required permission:** ``pots-write`` 6 7 **Request:** 8 9 The request body must be a `PotModifyRequest`. 10 11 **Response:** 12 13 :http:statuscode:`204 No content`: 14 The pot has successfully modified. 15 :http:statuscode:`400 Bad Request`: 16 The pot ID parameter is malformed. 17 Returned with ``TALER_EC_GENERIC_PARAMETER_MALFORMED``. 18 :http:statuscode:`404 Not found`: 19 The pot or instance is unknown to the backend. 20 Returned with ``TALER_EC_MERCHANT_GENERIC_MONEY_POT_UNKNOWN``. 21 :http:statuscode:`409 Conflict`: 22 The pot total did not match the expected total 23 and thus resetting the pot failed. 24 Returned with ``TALER_EC_MERCHANT_PRIVATE_MONEY_POT_CONFLICTING_TOTAL`` or 25 ``TALER_EC_MERCHANT_PRIVATE_MONEY_POT_CONFLICTING_NAME``. 26 :http:statuscode:`500 Internal Server Error`: 27 The server experienced an internal failure. 28 Returned with ``TALER_EC_GENERIC_DB_STORE_FAILED``. 29 30 **Details:** 31 32 .. ts:def:: PotModifyRequest 33 34 interface PotModifyRequest { 35 36 // Description of the pot. Possibly included 37 // in the pot message. 38 description: string; 39 40 // Name of the pot. Must be unique per instance. 41 pot_name: string; 42 43 // Expected current totals amount in the pot. 44 // Should be given if ``new_pot_total`` is specified 45 // as this allows checking that the pot total did 46 // not change in the meantime. However, this is 47 // not enforced server-side, the client may choose 48 // to not use this safety-measure. 49 expected_pot_totals?: Amount[]; 50 51 // Expected new total amounts to store in the pot. 52 // Does **not** have to be in the same currencies as 53 // the existing amounts in the pot. Used to reset 54 // the pot and/or change the amounts. 55 new_pot_totals?: Amount[]; 56 }