patch-private-templates-TEMPLATE_ID.rst (1558B)
1 .. http:patch:: [/instances/$INSTANCE]/private/templates/$TEMPLATE_ID 2 3 This is used to update a template. It is useful when we need to change information in the template or when we have mistake some information. 4 5 **Required permission:** ``templates-write`` 6 7 **Request:** 8 9 The request must be a `TemplatePatchDetails`. 10 11 **Response:** 12 13 :http:statuscode:`204 No content`: 14 The template has successfully modified. 15 :http:statuscode:`400 Bad Request`: 16 The request body is malformed. 17 Returned with ``TALER_EC_GENERIC_PARAMETER_MALFORMED``. 18 :http:statuscode:`404 Not found`: 19 The template(ID) is unknown to the backend. 20 Returned with ``TALER_EC_MERCHANT_GENERIC_TEMPLATE_UNKNOWN``. 21 :http:statuscode:`500 Internal Server Error`: 22 The server experienced an internal failure. 23 Returned with ``TALER_EC_GENERIC_DB_STORE_FAILED``, 24 ``TALER_EC_GENERIC_DB_FETCH_FAILED`` or 25 ``TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE``. 26 27 **Details:** 28 29 30 .. ts:def:: TemplatePatchDetails 31 32 interface TemplatePatchDetails { 33 34 // Human-readable description for the template. 35 template_description: string; 36 37 // OTP device ID. 38 // This parameter is optional. 39 otp_id?: string; 40 41 // Additional information in a separate template. 42 template_contract: TemplateContractDetails; 43 44 // Key-value pairs matching a subset of the 45 // fields from ``template_contract`` that are 46 // user-editable defaults for this template. 47 // Since protocol **v13**. 48 editable_defaults?: Object; 49 }