post-private-webhooks.rst (1649B)
1 .. http:post:: [/instances/$INSTANCE]/private/webhooks 2 3 This is used to create a webhook. 4 5 **Required permission:** ``webhooks-write`` 6 7 **Request:** 8 9 The request must be a `WebhookAddDetails`. 10 11 **Response:** 12 13 :http:statuscode:`204 No content`: 14 The creation of the webhook is successsful. 15 16 :http:statuscode:`400 Bad Request`: 17 The request body is malformed. 18 :http:statuscode:`404 Not found`: 19 The merchant instance is unknown or it not in our data. 20 :http:statuscode:`409 Conflict`: 21 A webhook with this ID already exists. 22 Returned with ``TALER_EC_MERCHANT_PRIVATE_POST_WEBHOOKS_CONFLICT_WEBHOOK_EXISTS``. 23 :http:statuscode:`413 Request entity too large`: 24 The uploaded body is to long, it exceeds the size limit. 25 Returned with an error code of 26 ``TALER_EC_GENERIC_UPLOAD_EXCEEDS_LIMIT``. 27 :http:statuscode:`500 Internal Server Error`: 28 The server experienced an internal failure. 29 Returned with ``TALER_EC_GENERIC_DB_START_FAILED``, 30 ``TALER_EC_GENERIC_DB_FETCH_FAILED``, 31 ``TALER_EC_GENERIC_DB_SOFT_FAILURE`` or 32 ``TALER_EC_GENERIC_DB_COMMIT_FAILED``. 33 34 **Details:** 35 36 .. ts:def:: WebhookAddDetails 37 38 interface WebhookAddDetails { 39 40 // Webhook ID to use. 41 webhook_id: string; 42 43 // The event of the webhook: why the webhook is used. 44 event_type: WebhookEventType; 45 46 // URL of the webhook where the customer will be redirected. 47 url: string; 48 49 // Method used by the webhook 50 http_method: string; 51 52 // Header template of the webhook 53 header_template?: string; 54 55 // Body template by the webhook 56 body_template?: string; 57 58 }