patch-charities-CHARITY_ID.rst (1455B)
1 .. http:PATCH:: /charities/{charity_id} 2 3 Modify a charity. 4 Only allowed if the request comes with the administrator bearer token. 5 6 **Request:** ``CharityRequest`` 7 8 **Response:** 9 10 :http:statuscode:`200 OK`: 11 The update succeeded. The response body is empty. 12 :http:statuscode:`400 Bad Request`: 13 The request was malformed. For example, the ``charity_id`` in the URL could 14 not be parsed, required JSON fields are missing, or ``max_per_year`` is 15 smaller than the current ``receipts_to_date`` of the charity. 16 Returned with error code ``TALER_EC_GENERIC_PARAMETER_MALFORMED`` or 17 ``TALER_EC_GENERIC_JSON_INVALID``. 18 :http:statuscode:`403 Forbidden`: 19 The request did not contain an accepted administrator bearer token in its header. 20 Returned with error code ``TALER_EC_GENERIC_TOKEN_PERMISSION_INSUFFICIENT``. 21 :http:statuscode:`404 Not Found`: 22 The charity ID is unknown to the Donau. 23 Returned with error code ``TALER_EC_DONAU_CHARITY_NOT_FOUND``. 24 :http:statuscode:`500 Internal Server Error`: 25 The Donau encountered an internal database error. 26 Returned with error code ``TALER_EC_GENERIC_DB_FETCH_FAILED``, 27 ``TALER_EC_GENERIC_DB_STORE_FAILED``, or 28 ``TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE``. 29 30 **Details:** 31 32 The request body has the same shape as :ts:type:`CharityRequest` used by 33 :http:POST:`/charities`. All fields are required and will replace the stored 34 values of the charity.