{"items":[{"type":"link","label":"Webhooks API","link":"/webhooks/openwebhooks","routeSlug":"/webhooks/openwebhooks","content":{"contentType":"overview","meta":{"name":"Webhooks API"},"children":[{"nodeType":"container","panels":[{"title":"Download OpenAPI description","titleTranslationKey":"download.description.title","children":[{"kind":"download","label":"openwebhooks.json","url":"/_bundle/Webhooks/openwebhooks.json?download"},{"kind":"download","label":"openwebhooks.yaml","url":"/_bundle/Webhooks/openwebhooks.yaml?download"}]},{"title":"Overview","titleTranslationKey":"info.title","children":[]},{"title":"Languages","titleTranslationKey":"languages.title","children":[{"kind":"languages","options":[{"key":"curl","title":"curl","lang":"curl"},{"key":"javascript","title":"JavaScript","lang":"JavaScript"},{"key":"node","title":"Node.js","lang":"Node.js"},{"key":"python","title":"Python","lang":"Python"},{"key":"java","title":"Java","lang":"Java"},{"key":"csharp","title":"C#","lang":"C#"},{"key":"php","title":"PHP","lang":"PHP"},{"key":"go","title":"Go","lang":"Go"},{"key":"ruby","title":"Ruby","lang":"Ruby"},{"key":"r","title":"R","lang":"R"},{"key":"payload","title":"Payload","lang":"Payload"}]}]},{"title":"Servers","titleTranslationKey":"servers.title","children":[{"kind":"servers","servers":[{"url":"https://developers.prana.software/webhooks/openwebhooks"}],"mode":"default"}]}],"children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"header","level":1,"label":"Webhooks API (1.0.0)","showPageActions":true},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[]}],"sectionId":"/webhooks/openwebhooks"}],"sectionId":"/webhooks/openwebhooks"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":1,"id":"section/tutorial"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Tutorial"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Con el sistema de "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"webhooks"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", puedes suscribirte a los eventos que se producen sobre la mayoría de recursos del sistema, de forma que puedes recibir notificaciones para que tu sistema reaccione como corresponda."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"La mayoría de recursos permiten suscribirse a los eventos de:"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"created"},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"updated"},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"deleted"},"children":[]}]}]}]}]}],"sectionId":"/webhooks/openwebhooks/section/tutorial"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":2,"id":"section/tutorial/recursos-con-soporte-de-webhooks"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Recursos con soporte de Webhooks"},"children":[]}]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Dominio"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Recurso"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Descripción"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Contact"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Customer"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Clientes"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Contact"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Supplier"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Proveedores"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Warehouse"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Article"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Artículos"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Warehouse"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Warehouse"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Almacenes"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Purchase"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Order"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Pedidos de proveedor"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Purchase"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Delivery-note"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Albaranes de proveedor"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Purchase"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Invoice"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Facturas de proveedor"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Sale"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Quote"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Presupuesto de cliente"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Sale"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Order"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Pedido de cliente"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Sale"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Delivery-note"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Albarán de cliente"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Sale"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Invoice"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Factura de cliente"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Sale"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Template-sale-invoice"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Plantilla de facturación periódica"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Accounting"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Account"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Cuentas contables"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Accounting"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Entry"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Asientos contables"},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"hr","attributes":{},"children":[]}]}],"sectionId":"/webhooks/openwebhooks/section/tutorial/recursos-con-soporte-de-webhooks"}],"sectionId":"/webhooks/openwebhooks/section/tutorial/recursos-con-soporte-de-webhooks"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":2,"id":"section/tutorial/obtencion-del-api-key"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Obtención del Api Key"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Para utilizar el sistema de webhooks, es necesario disponer de un Api Key desde el área del desarrollador."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Los pasos para obtenerlo son los siguientes:"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Accede a tu cuenta de PRANA."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Dirígete al área de \"Configuración\"."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Selecciona la opción \"Desarrolladores\"."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Haz clic en \"Añadir API Key\"."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Dale un nombre descriptivo a tu API Key y guarda los cambios."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Copia el valor del API Key generado y guárdalo en un lugar seguro. Este valor tendrás que pasarlo como cabecera, en todas las peticiones que hagas contra el sistema."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"image","inline":true,"attributes":{"alt":"Añadir ApiKey","src":"/assets/api-key.b0f0a3fe1ddd2feb5d7f6ddb8c94ab10e6718c7ed4e49e9f3188abacfb98ce21.0318cbda.png"},"children":[]}]}]},{"$$mdtype":"Node","type":"hr","attributes":{},"children":[]}]}],"sectionId":"/webhooks/openwebhooks/section/tutorial/obtencion-del-api-key"}],"sectionId":"/webhooks/openwebhooks/section/tutorial/obtencion-del-api-key"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":2,"id":"section/tutorial/recursos-y-eventos-a-los-que-puedes-suscribirte"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Recursos y eventos a los que puedes suscribirte"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Puedes obtener la lista completa de recursos y eventos a los que es posible suscribirse, de esta forma."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Request"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"GET /event-type\nContent-Type: application/json\nx-api-key: <API_KEY>\n","language":"http"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"GET /event-type\nContent-Type: application/json\nx-api-key: <API_KEY>\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Responses"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"200 OK"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Lista de tipos de evento disponibles en el sistema."},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"[\n  {\n    \"appName\": \"PRANA\",\n    \"eventDomain\": \"ACCOUNTING\",\n    \"resource\": \"ACCOUNT\",\n    \"eventName\": \"CREATED\",\n    \"semanticName\": \"PRANA.ACCOUNTING.ACCOUNT.CREATED\",\n    \"id\": \"c6e050ee-b2a8-4df9-bf80-7655be7afbdf\",\n    \"active\": true\n  },\n  {\n    \"appName\": \"PRANA\",\n    \"eventDomain\": \"ACCOUNTING\",\n    \"resource\": \"ACCOUNT\",\n    \"eventName\": \"DELETED\",\n    \"semanticName\": \"PRANA.ACCOUNTING.ACCOUNT.DELETED\",\n    \"id\": \"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d\",\n    \"active\": true\n  }\n]\n","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"[\n  {\n    \"appName\": \"PRANA\",\n    \"eventDomain\": \"ACCOUNTING\",\n    \"resource\": \"ACCOUNT\",\n    \"eventName\": \"CREATED\",\n    \"semanticName\": \"PRANA.ACCOUNTING.ACCOUNT.CREATED\",\n    \"id\": \"c6e050ee-b2a8-4df9-bf80-7655be7afbdf\",\n    \"active\": true\n  },\n  {\n    \"appName\": \"PRANA\",\n    \"eventDomain\": \"ACCOUNTING\",\n    \"resource\": \"ACCOUNT\",\n    \"eventName\": \"DELETED\",\n    \"semanticName\": \"PRANA.ACCOUNTING.ACCOUNT.DELETED\",\n    \"id\": \"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d\",\n    \"active\": true\n  }\n]\n"},"children":[]}]}]}],"sectionId":"/webhooks/openwebhooks/section/tutorial/recursos-y-eventos-a-los-que-puedes-suscribirte"}],"sectionId":"/webhooks/openwebhooks/section/tutorial/recursos-y-eventos-a-los-que-puedes-suscribirte"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":2,"id":"section/tutorial/subscribirse-a-eventos"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Subscribirse a eventos"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Para crear una nueva subscripción, debes hacer una petición POST indicando:"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"callbackUrl"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": URL de tu sistema donde deseas recibir las notificaciones"},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"secret"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": Palabra clave que usaremos para firmar cada mensaje"},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"events"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": Lista de cadenas con los nombres semánticos de los eventos a los que deseas suscribirte"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"POST /subscription\nContent-Type: application/json\nx-api-key: <API_KEY>\n{\n    \"callbackUrl\": \"https://url-de-tu-sistema.com/webhook\",\n    \"secret\": \"<PALABRA_SECRETA>\",\n    \"events\": [\n        \"PRANA.CONTACT.CUSTOMER.CREATED\",\n        \"PRANA.CONTACT.CUSTOMER.UPDATED\",\n        \"PRANA.CONTACT.CUSTOMER.DELETED\"\n    ]\n}\n","language":"http"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"POST /subscription\nContent-Type: application/json\nx-api-key: <API_KEY>\n{\n    \"callbackUrl\": \"https://url-de-tu-sistema.com/webhook\",\n    \"secret\": \"<PALABRA_SECRETA>\",\n    \"events\": [\n        \"PRANA.CONTACT.CUSTOMER.CREATED\",\n        \"PRANA.CONTACT.CUSTOMER.UPDATED\",\n        \"PRANA.CONTACT.CUSTOMER.DELETED\"\n    ]\n}\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"200 OK"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Obtendrás una respuesta con los datos de la suscripción creada."},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"{\n  \"subscriptionId\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n  \"responseState\": \"SUCCESS\",\n  \"errors\": null\n}\n","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"{\n  \"subscriptionId\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n  \"responseState\": \"SUCCESS\",\n  \"errors\": null\n}\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"handshake"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Al crear una nueva suscripción, el sistema realizará una petición "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"POST"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" a la URL indicada en "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"callbackUrl"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", para verificar que tu sistema está preparado para recibir las notificaciones."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"El sistema esperará una respuesta con código "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"200 OK"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" y cuerpo vacío, para considerar que la verificación ha sido correcta."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"El mensaje de esta petición, contendrá la siguiente información."},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"{\n  \"subscriptionId\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n  \"tenantInformation\": {\n    \"tenantId\": \"999999\",\n    \"userId\": \"aaaaaa999999\"\n  },\n  \"eventType\": {\n    \"appName\": \"webhook\",\n    \"eventDomain\": \"\",\n    \"resource\": \"\",\n    \"eventName\": \"handshake\",\n    \"semanticName\": \"webhook...handshake\",\n    \"id\": \"e53ae4e1-d970-43de-8bf5-f7be2954e46d\",\n    \"active\": true\n  },\n  \"payload\": \"{\\\"Type\\\":\\\"Acknowledge\\\"}\"\n}\n","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"{\n  \"subscriptionId\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n  \"tenantInformation\": {\n    \"tenantId\": \"999999\",\n    \"userId\": \"aaaaaa999999\"\n  },\n  \"eventType\": {\n    \"appName\": \"webhook\",\n    \"eventDomain\": \"\",\n    \"resource\": \"\",\n    \"eventName\": \"handshake\",\n    \"semanticName\": \"webhook...handshake\",\n    \"id\": \"e53ae4e1-d970-43de-8bf5-f7be2954e46d\",\n    \"active\": true\n  },\n  \"payload\": \"{\\\"Type\\\":\\\"Acknowledge\\\"}\"\n}\n"},"children":[]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"subscriptionId"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": Identificador de la suscripción que acabas de crear."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"tenantInformation"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": Información del inquilino y usuario asociado a la suscripción."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"eventType"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": Tipo de evento, en este caso "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"handshake"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"payload"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": Contenido del mensaje, en este caso un JSON con el campo "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"Type"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" con valor "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"Acknowledge"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"A partir de este momento, tu sistema estará preparado para recibir las notificaciones de los eventos a los que te has suscrito."},"children":[]}]}]}]}],"sectionId":"/webhooks/openwebhooks/section/tutorial/subscribirse-a-eventos"}],"sectionId":"/webhooks/openwebhooks/section/tutorial/subscribirse-a-eventos"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"section/tutorial/notificaciones-de-eventos"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Notificaciones de eventos"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Cada vez que se produzca un evento al que te has suscrito, el sistema realizará una petición "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"POST"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" a la URL indicada en "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"callbackUrl"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Esta petición incluirá una cabecera "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"x-signature"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", que contendrá una firma HMAC-SHA256 del cuerpo del mensaje,"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"utilizando la "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"secret"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" que proporcionaste al crear la suscripción. Esto te permitirá verificar la autenticidad del mensaje recibido."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"El cuerpo del mensaje tendrá la siguiente estructura:"},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"{\n  \"subscriptionId\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n  \"tenantInformation\": {\n    \"tenantId\": \"999999\",\n    \"userId\": \"aaaaaa999999\"\n  },\n  \"eventType\": {\n    \"appName\": \"PRANA\",\n    \"eventDomain\": \"CONTACT\",\n    \"resource\": \"CUSTOMER\",\n    \"eventName\": \"UPDATED\",\n    \"semanticName\": \"PRANA.CONTACT.CUSTOMER.UPDATED\"\n  },\n  \"payload\": \"{\\\"EntityId\\\":\\\"369986\\\"}\"\n}\n","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"{\n  \"subscriptionId\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n  \"tenantInformation\": {\n    \"tenantId\": \"999999\",\n    \"userId\": \"aaaaaa999999\"\n  },\n  \"eventType\": {\n    \"appName\": \"PRANA\",\n    \"eventDomain\": \"CONTACT\",\n    \"resource\": \"CUSTOMER\",\n    \"eventName\": \"UPDATED\",\n    \"semanticName\": \"PRANA.CONTACT.CUSTOMER.UPDATED\"\n  },\n  \"payload\": \"{\\\"EntityId\\\":\\\"369986\\\"}\"\n}\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"En el elemento "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"payload"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", encontrarás la información específica del evento. En este caso,"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"el campo "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"EntityId"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" indica el identificador del cliente que ha sido actualizado. Con esta información,"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"podrás enviar una petición a la API para obtener los detalles del cliente actualizado."},"children":[]}]}]}]}],"sectionId":"/webhooks/openwebhooks/section/tutorial/notificaciones-de-eventos"}],"sectionId":"/webhooks/openwebhooks/section/tutorial/notificaciones-de-eventos"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":2,"id":"section/tutorial/consulta-tus-suscripciones"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Consulta tus suscripciones"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"En cualquier momento, puedes consultar las suscripciones que has creado realizando una petición "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"GET"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" a la siguiente URL:"},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"GET /subscription\nContent-Type: application/json\nx-api-key: <API_KEY>\n","language":"http"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"GET /subscription\nContent-Type: application/json\nx-api-key: <API_KEY>\n"},"children":[]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"[\n  {\n    \"id\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n    \"secret\": \"<PALABRA_SECRETA>\",\n    \"callbackUrl\": \"https://url-de-tu-sistema.com/webhook\",\n    \"status\": \"ACTIVE\",\n    \"statusMessage\": \"\",\n    \"webhooks\": [\n      {\n        \"id\": \"2a87d134-6458-4379-af71-1cdab4f77d01\",\n        \"eventType\": {\n          \"appName\": \"PRANA\",\n          \"eventDomain\": \"CONTACT\",\n          \"resource\": \"CUSTOMER\",\n          \"eventName\": \"CREATED\",\n          \"semanticName\": \"PRANA.CUSTOMER.CUSTOMER.CREATED\"\n        }\n      },\n      {\n        \"id\": \"9562db1d-b3a5-43f3-b0d7-daebed0b7c06\",\n        \"eventType\": {\n          \"appName\": \"PRANA\",\n          \"eventDomain\": \"CONTACT\",\n          \"resource\": \"CUSTOMER\",\n          \"eventName\": \"UPDATED\",\n          \"semanticName\": \"PRANA.CUSTOMER.CUSTOMER.UPDATED\"\n        }\n      },\n      {\n        \"id\": \"55f62ac0-07e3-4d87-bf4f-5ecc55b47f89\",\n        \"eventType\": {\n          \"appName\": \"PRANA\",\n          \"eventDomain\": \"CONTACT\",\n          \"resource\": \"CUSTOMER\",\n          \"eventName\": \"DELETED\",\n          \"semanticName\": \"PRANA.CUSTOMER.CUSTOMER.DELETED\"\n        }\n      }\n    ]\n  }\n]\n","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"[\n  {\n    \"id\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n    \"secret\": \"<PALABRA_SECRETA>\",\n    \"callbackUrl\": \"https://url-de-tu-sistema.com/webhook\",\n    \"status\": \"ACTIVE\",\n    \"statusMessage\": \"\",\n    \"webhooks\": [\n      {\n        \"id\": \"2a87d134-6458-4379-af71-1cdab4f77d01\",\n        \"eventType\": {\n          \"appName\": \"PRANA\",\n          \"eventDomain\": \"CONTACT\",\n          \"resource\": \"CUSTOMER\",\n          \"eventName\": \"CREATED\",\n          \"semanticName\": \"PRANA.CUSTOMER.CUSTOMER.CREATED\"\n        }\n      },\n      {\n        \"id\": \"9562db1d-b3a5-43f3-b0d7-daebed0b7c06\",\n        \"eventType\": {\n          \"appName\": \"PRANA\",\n          \"eventDomain\": \"CONTACT\",\n          \"resource\": \"CUSTOMER\",\n          \"eventName\": \"UPDATED\",\n          \"semanticName\": \"PRANA.CUSTOMER.CUSTOMER.UPDATED\"\n        }\n      },\n      {\n        \"id\": \"55f62ac0-07e3-4d87-bf4f-5ecc55b47f89\",\n        \"eventType\": {\n          \"appName\": \"PRANA\",\n          \"eventDomain\": \"CONTACT\",\n          \"resource\": \"CUSTOMER\",\n          \"eventName\": \"DELETED\",\n          \"semanticName\": \"PRANA.CUSTOMER.CUSTOMER.DELETED\"\n        }\n      }\n    ]\n  }\n]\n"},"children":[]}]}]}],"sectionId":"/webhooks/openwebhooks/section/tutorial/consulta-tus-suscripciones"}],"sectionId":"/webhooks/openwebhooks/section/tutorial/consulta-tus-suscripciones"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":2,"id":"section/tutorial/elimina-una-suscripcion"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Elimina una suscripción"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Si deseas eliminar una suscripción, puedes hacerlo realizando una petición "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"DELETE"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" de la siguiente forma:"},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"DELETE /subscription/{subscriptionId}\nContent-Type: application/json\nx-api-key: <API_KEY>\n","language":"http"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"DELETE /subscription/{subscriptionId}\nContent-Type: application/json\nx-api-key: <API_KEY>\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Donde "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"subscriptionId"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" es el identificador de la suscripción que deseas eliminar."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"En este caso, la respuesta del sistema será un código 200 OK, indicando que la suscripción ha sido eliminada correctamente."},"children":[]}]}]}]}],"sectionId":"/webhooks/openwebhooks/section/tutorial/elimina-una-suscripcion"}],"sectionId":"/webhooks/openwebhooks/section/tutorial/elimina-una-suscripcion"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":2,"id":"section/tutorial/actualiza-una-suscripcion"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Actualiza una suscripción"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Si necesitas actualizar una suscripción existente, puedes hacerlo mediante una petición "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"PUT"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"La estructura de la petición es similar a la de creación, pero debes incluir el "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"subscriptionId"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" de la suscripción que deseas actualizar."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Los valores que puedes actualizar son:"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"callbackUrl"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": URL de tu sistema donde deseas recibir las notificaciones"},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"secret"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": Palabra clave que usaremos para firmar cada mensaje"},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": Estado de la suscripción. Puede ser "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"ACTIVE"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" o "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"INACTIVE"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"PUT /subscription/{subscriptionId}\nContent-Type: application/json\nx-api-key: <API_KEY>\n{\n    \"callbackUrl\": \"https://url-de-tu-sistema.com/webhook\",\n    \"secret\": \"<PALABRA_SECRETA>\",\n    \"status\": \"ACTIVE\"\n}\n","language":"http"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"PUT /subscription/{subscriptionId}\nContent-Type: application/json\nx-api-key: <API_KEY>\n{\n    \"callbackUrl\": \"https://url-de-tu-sistema.com/webhook\",\n    \"secret\": \"<PALABRA_SECRETA>\",\n    \"status\": \"ACTIVE\"\n}\n"},"children":[]}]}]}],"sectionId":"/webhooks/openwebhooks/section/tutorial/actualiza-una-suscripcion"}],"sectionId":"/webhooks/openwebhooks/section/tutorial/actualiza-una-suscripcion"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"heading","attributes":{"level":2,"id":"section/tutorial/firma-y-verificacion-de-mensajes"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Firma y verificación de mensajes"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Cada notificación enviada a tu sistema incluirá una cabecera "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"x-signature"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", que contiene una firma HMAC-SHA256 del cuerpo del mensaje."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Esta firma se genera utilizando la "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"secret"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" que proporcionaste al crear la suscripción."},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"import javax.crypto.Mac;\nimport javax.crypto.SecretKey;\nimport javax.crypto.spec.SecretKeySpec;\nimport java.nio.charset.StandardCharsets;\nimport java.security.InvalidKeyException;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.Base64;\n\npublic final class SignatureUtils {\n    private static final String ALGORITHM = \"HmacSHA256\";\n\n    private SignatureUtils() {\n        throw new IllegalStateException(\"Utility class\");\n    }\n\n    public static String generateSignature(String secret, String payload) {\n        try {\n            SecretKey secretKey = new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), ALGORITHM);\n\n            Mac mac = Mac.getInstance(ALGORITHM);\n            mac.init(secretKey);\n\n            return Base64.getEncoder().encodeToString(\n                    mac.doFinal(payload.getBytes(StandardCharsets.UTF_8))\n            );\n        } catch (NoSuchAlgorithmException ex) {\n            throw new IllegalStateException(\"Algorithm \" + ALGORITHM + \" not available\", ex);\n        } catch (InvalidKeyException ex) {\n            throw new IllegalStateException(\"Invalid secret key for signature generation\", ex);\n        }\n    }\n}\n","language":"java"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"import javax.crypto.Mac;\nimport javax.crypto.SecretKey;\nimport javax.crypto.spec.SecretKeySpec;\nimport java.nio.charset.StandardCharsets;\nimport java.security.InvalidKeyException;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.Base64;\n\npublic final class SignatureUtils {\n    private static final String ALGORITHM = \"HmacSHA256\";\n\n    private SignatureUtils() {\n        throw new IllegalStateException(\"Utility class\");\n    }\n\n    public static String generateSignature(String secret, String payload) {\n        try {\n            SecretKey secretKey = new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), ALGORITHM);\n\n            Mac mac = Mac.getInstance(ALGORITHM);\n            mac.init(secretKey);\n\n            return Base64.getEncoder().encodeToString(\n                    mac.doFinal(payload.getBytes(StandardCharsets.UTF_8))\n            );\n        } catch (NoSuchAlgorithmException ex) {\n            throw new IllegalStateException(\"Algorithm \" + ALGORITHM + \" not available\", ex);\n        } catch (InvalidKeyException ex) {\n            throw new IllegalStateException(\"Invalid secret key for signature generation\", ex);\n        }\n    }\n}\n"},"children":[]}]}]}],"sectionId":"/webhooks/openwebhooks/section/tutorial/firma-y-verificacion-de-mensajes"}],"sectionId":"/webhooks/openwebhooks/section/tutorial/firma-y-verificacion-de-mensajes"}]}]}},{"type":"group","label":"Tutorial","link":"/webhooks/openwebhooks/section/tutorial","routeSlug":"/webhooks/openwebhooks/section/tutorial","items":[{"type":"link","label":"Recursos con soporte de Webhooks","link":"/webhooks/openwebhooks/section/tutorial/recursos-con-soporte-de-webhooks","routeSlug":"/webhooks/openwebhooks/section/tutorial/recursos-con-soporte-de-webhooks","content":null},{"type":"link","label":"Obtención del Api Key","link":"/webhooks/openwebhooks/section/tutorial/obtencion-del-api-key","routeSlug":"/webhooks/openwebhooks/section/tutorial/obtencion-del-api-key","content":null},{"type":"link","label":"Recursos y eventos a los que puedes suscribirte","link":"/webhooks/openwebhooks/section/tutorial/recursos-y-eventos-a-los-que-puedes-suscribirte","routeSlug":"/webhooks/openwebhooks/section/tutorial/recursos-y-eventos-a-los-que-puedes-suscribirte","content":null},{"type":"link","label":"Subscribirse a eventos","link":"/webhooks/openwebhooks/section/tutorial/subscribirse-a-eventos","routeSlug":"/webhooks/openwebhooks/section/tutorial/subscribirse-a-eventos","content":null},{"type":"link","label":"Notificaciones de eventos","link":"/webhooks/openwebhooks/section/tutorial/notificaciones-de-eventos","routeSlug":"/webhooks/openwebhooks/section/tutorial/notificaciones-de-eventos","content":null},{"type":"link","label":"Consulta tus suscripciones","link":"/webhooks/openwebhooks/section/tutorial/consulta-tus-suscripciones","routeSlug":"/webhooks/openwebhooks/section/tutorial/consulta-tus-suscripciones","content":null},{"type":"link","label":"Elimina una suscripción","link":"/webhooks/openwebhooks/section/tutorial/elimina-una-suscripcion","routeSlug":"/webhooks/openwebhooks/section/tutorial/elimina-una-suscripcion","content":null},{"type":"link","label":"Actualiza una suscripción","link":"/webhooks/openwebhooks/section/tutorial/actualiza-una-suscripcion","routeSlug":"/webhooks/openwebhooks/section/tutorial/actualiza-una-suscripcion","content":null},{"type":"link","label":"Firma y verificación de mensajes","link":"/webhooks/openwebhooks/section/tutorial/firma-y-verificacion-de-mensajes","routeSlug":"/webhooks/openwebhooks/section/tutorial/firma-y-verificacion-de-mensajes","content":null}],"content":null},{"type":"group","label":"Subscriptions","link":"/webhooks/openwebhooks/subscriptions","routeSlug":"/webhooks/openwebhooks/subscriptions","items":[{"label":"Update a subscription","deprecated":false,"httpVerb":"put","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/webhooks/openwebhooks/subscriptions/updatewebhook","routeSlug":"/webhooks/openwebhooks/subscriptions/updatewebhook","metadata":{"seo":{"title":"Update a subscription","description":"Updates the data of an existing subscription"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"updateWebhook","name":"Update a subscription","isWebhook":false,"pointer":"/paths/~1subscription~1{id}/put","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Update a subscription","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":"Updates the data of an existing subscription"},{"nodeType":"security","requirements":[{"schemes":[{"name":"ApiKeyAuth","scopes":[],"type":"apiKey","in":"header","paramName":"X-API-KEY"}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_34","description":"Subscription ID","required":true}],"pointer":"/paths/~1subscription~1{id}/put/parameters"},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/SubscriptionUpdateWriteDto"}},"schemaId":"components/schemas/SubscriptionUpdateWriteDto","pointer":"/paths/~1subscription~1{id}/put/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"PUT","path":"/subscription/{id}","servers":[{"url":"https://developers.prana.software/webhooks/openwebhooks"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_34"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"ApiKeyAuth","type":"apiKey","name":"X-API-KEY","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"components/schemas/SubscriptionUpdateWriteDto"}},"responseCodes":["200","400","401","403","404"],"pointer":"/subscription/{id}","href":"subscriptions/updatewebhook","openApiOperationId":"updateWebhook","summary":"Update a subscription"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://developers.prana.software/webhooks/openwebhooks"}],"schemaId":"components/schemas/SubscriptionUpdateWriteDto","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/SubscriptionUpdateWriteDto"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Subscription updated successfully"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid API Key"},{"code":"403","description":"Forbidden - No permission to update this subscription"},{"code":"404","description":"Subscription not found"}],"pointer":"/paths/~1subscription~1{id}/put/responses"}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/subscriptions/updatewebhook"}],"panels":[]}]},"httpPath":"/subscription/{id}"},{"label":"Delete a subscription","deprecated":false,"httpVerb":"delete","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/webhooks/openwebhooks/subscriptions/deletewebhook","routeSlug":"/webhooks/openwebhooks/subscriptions/deletewebhook","metadata":{"seo":{"title":"Delete a subscription","description":"Deletes an existing subscription by its ID"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"deleteWebhook","name":"Delete a subscription","isWebhook":false,"pointer":"/paths/~1subscription~1{id}/delete","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Delete a subscription","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":"Deletes an existing subscription by its ID"},{"nodeType":"security","requirements":[{"schemes":[{"name":"ApiKeyAuth","scopes":[],"type":"apiKey","in":"header","paramName":"X-API-KEY"}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_34","description":"Subscription ID","required":true}],"pointer":"/paths/~1subscription~1{id}/delete/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"DELETE","path":"/subscription/{id}","servers":[{"url":"https://developers.prana.software/webhooks/openwebhooks"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_34"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"ApiKeyAuth","type":"apiKey","name":"X-API-KEY","in":"header"}],"scopes":[]}],"responseCodes":["200","401","403","404"],"pointer":"/subscription/{id}","href":"subscriptions/deletewebhook","openApiOperationId":"deleteWebhook","summary":"Delete a subscription"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://developers.prana.software/webhooks/openwebhooks"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Subscription deleted successfully"},{"code":"401","description":"Unauthorized - Invalid API Key"},{"code":"403","description":"Forbidden - No permission to delete this subscription"},{"code":"404","description":"Subscription not found"}],"pointer":"/paths/~1subscription~1{id}/delete/responses"}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/subscriptions/deletewebhook"}],"panels":[]}]},"httpPath":"/subscription/{id}"},{"label":"Get all subscriptions","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/webhooks/openwebhooks/subscriptions/getbyapikey","routeSlug":"/webhooks/openwebhooks/subscriptions/getbyapikey","metadata":{"seo":{"title":"Get all subscriptions","description":"Retrieves the list of subscriptions associated with the authenticated API Key"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getByApiKey","name":"Get all subscriptions","isWebhook":false,"pointer":"/paths/~1subscription/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get all subscriptions","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":"Retrieves the list of subscriptions associated with the authenticated API Key"},{"nodeType":"security","requirements":[{"schemes":[{"name":"ApiKeyAuth","scopes":[],"type":"apiKey","in":"header","paramName":"X-API-KEY"}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/subscription","servers":[{"url":"https://developers.prana.software/webhooks/openwebhooks"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"ApiKeyAuth","type":"apiKey","name":"X-API-KEY","in":"header"}],"scopes":[]}],"responseCodes":["200","401"],"pointer":"/subscription","href":"subscriptions/getbyapikey","openApiOperationId":"getByApiKey","summary":"Get all subscriptions"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://developers.prana.software/webhooks/openwebhooks"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Subscription list retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{}}},{"code":"401","description":"Unauthorized - Invalid API Key","mediaType":"*/*","mediaTypes":["*/*"],"mediaTypeContent":{"*/*":{"schemaId":"schema_35"}},"schemaId":"schema_35"}],"pointer":"/paths/~1subscription/get/responses"}],"panels":[{"children":[{"kind":"response","headerTitle":"Response","responseCodes":[{"code":"200","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{}}},{"code":"401","schemaId":"schema_35","mediaTypes":["*/*"],"mediaTypeContent":{"*/*":{"schemaId":"schema_35"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/subscriptions/getbyapikey"}],"panels":[]}]},"httpPath":"/subscription"},{"label":"Create a new subscription","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/webhooks/openwebhooks/subscriptions/subscribe","routeSlug":"/webhooks/openwebhooks/subscriptions/subscribe","metadata":{"seo":{"title":"Create a new subscription","description":"Creates a new subscription to webhook events"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"subscribe","name":"Create a new subscription","isWebhook":false,"pointer":"/paths/~1subscription/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create a new subscription","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":"Creates a new subscription to webhook events"},{"nodeType":"security","requirements":[{"schemes":[{"name":"ApiKeyAuth","scopes":[],"type":"apiKey","in":"header","paramName":"X-API-KEY"}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/SubscriptionWriteDto"}},"schemaId":"components/schemas/SubscriptionWriteDto","pointer":"/paths/~1subscription/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/subscription","servers":[{"url":"https://developers.prana.software/webhooks/openwebhooks"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"ApiKeyAuth","type":"apiKey","name":"X-API-KEY","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"components/schemas/SubscriptionWriteDto"}},"responseCodes":["201","400","401"],"pointer":"/subscription","href":"subscriptions/subscribe","openApiOperationId":"subscribe","summary":"Create a new subscription"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://developers.prana.software/webhooks/openwebhooks"}],"schemaId":"components/schemas/SubscriptionWriteDto","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/SubscriptionWriteDto"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"201","description":"Subscription created successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/SubscriptionResponseReadDto"}},"schemaId":"components/schemas/SubscriptionResponseReadDto"},{"code":"400","description":"Invalid input data","mediaType":"*/*","mediaTypes":["*/*"],"mediaTypeContent":{"*/*":{"schemaId":"components/schemas/SubscriptionResponseReadDto"}},"schemaId":"components/schemas/SubscriptionResponseReadDto"},{"code":"401","description":"Unauthorized - Invalid API Key","mediaType":"*/*","mediaTypes":["*/*"],"mediaTypeContent":{"*/*":{"schemaId":"components/schemas/SubscriptionResponseReadDto"}},"schemaId":"components/schemas/SubscriptionResponseReadDto"}],"pointer":"/paths/~1subscription/post/responses"}],"panels":[{"children":[{"kind":"response","headerTitle":"Response","responseCodes":[{"code":"201","schemaId":"components/schemas/SubscriptionResponseReadDto","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/SubscriptionResponseReadDto"}}},{"code":"400","schemaId":"components/schemas/SubscriptionResponseReadDto","mediaTypes":["*/*"],"mediaTypeContent":{"*/*":{"schemaId":"components/schemas/SubscriptionResponseReadDto"}}},{"code":"401","schemaId":"components/schemas/SubscriptionResponseReadDto","mediaTypes":["*/*"],"mediaTypeContent":{"*/*":{"schemaId":"components/schemas/SubscriptionResponseReadDto"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/subscriptions/subscribe"}],"panels":[]}]},"httpPath":"/subscription"}],"content":{"contentType":"group","meta":{"name":"Subscriptions"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Subscriptions","showPageActions":true},{"nodeType":"markdoc","content":"Endpoints for subscription management"}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/subscription/{id}","summary":"Update a subscription","prefix":{"name":"put","color":"put"},"badges":[],"link":"/subscriptions/updatewebhook","deprecated":false},{"title":"/subscription/{id}","summary":"Delete a subscription","prefix":{"name":"delete","color":"delete"},"badges":[],"link":"/subscriptions/deletewebhook","deprecated":false},{"title":"/subscription","summary":"Get all subscriptions","prefix":{"name":"get","color":"get"},"badges":[],"link":"/subscriptions/getbyapikey","deprecated":false},{"title":"/subscription","summary":"Create a new subscription","prefix":{"name":"post","color":"post"},"badges":[],"link":"/subscriptions/subscribe","deprecated":false}]}]}]}]}}],"store":{"schemaStore":{"components/schemas/SubscriptionUpdateWriteDto":{"id":"components/schemas/SubscriptionUpdateWriteDto","kind":"json-schema","title":"SubscriptionUpdateWriteDto","data":{"type":"object","description":"Updated subscription data","properties":{"callbackUrl":{"type":"string","minLength":0,"maxLength":255},"secret":{"type":"string","minLength":0,"maxLength":255},"status":{"type":"string","enum":["PENDING","ACTIVE","INACTIVE","FAILED"]}}}},"components/schemas/SubscriptionWriteDto":{"id":"components/schemas/SubscriptionWriteDto","kind":"json-schema","title":"SubscriptionWriteDto","data":{"type":"object","description":"Subscription data","required":["callbackUrl","events","secret"],"properties":{"callbackUrl":{"type":"string","minLength":0,"maxLength":255},"secret":{"type":"string","minLength":0,"maxLength":255},"events":{"type":"array","items":{"type":"string"}}}}},"components/schemas/SubscriptionResponseReadDto":{"id":"components/schemas/SubscriptionResponseReadDto","kind":"json-schema","title":"SubscriptionResponseReadDto","data":{"type":"object","properties":{"subscriptionId":{"type":"string"},"responseState":{"type":"string","enum":["SUCCESS","FAILED","LOCKED"]},"errors":{"type":"array","items":{"type":"string"}}}}},"components/schemas/EventTypeListReadDto":{"id":"components/schemas/EventTypeListReadDto","kind":"json-schema","title":"EventTypeListReadDto","data":{"type":"object","properties":{"appName":{"type":"string"},"eventDomain":{"type":"string"},"resource":{"type":"string"},"eventName":{"type":"string"},"semanticName":{"type":"string"}}}},"components/schemas/SubscriptionListReadDto":{"id":"components/schemas/SubscriptionListReadDto","kind":"json-schema","title":"SubscriptionListReadDto","data":{"type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string"},"callbackUrl":{"type":"string"},"status":{"type":"string"},"statusMessage":{"type":"string"},"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSubscriptionListReadDto"}}}}},"components/schemas/WebhookSubscriptionListReadDto":{"id":"components/schemas/WebhookSubscriptionListReadDto","kind":"json-schema","title":"WebhookSubscriptionListReadDto","data":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"$ref":"#/components/schemas/EventTypeListReadDto"}}}},"schema_34":{"kind":"json-schema","data":{"type":"string"},"id":"schema_34"},"schema_35":{"kind":"json-schema","data":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionListReadDto"}},"id":"schema_35"}},"exampleStore":{},"securitySchemeStore":{"ApiKeyAuth":{"id":"ApiKeyAuth","type":"apiKey","in":"header","paramName":"X-API-KEY"}},"servers":[{"url":"https://developers.prana.software/webhooks/openwebhooks"}]},"options":{"hideSidebar":true,"mockServer":{"off":true},"disableRouter":true,"downloadUrls":[{"url":"/_bundle/Webhooks/openwebhooks.json?download"},{"url":"/_bundle/Webhooks/openwebhooks.yaml?download"}],"excludeFromSearch":false,"specType":"openapi","markdocOptions":{"tags":{},"nodes":{},"components":{}},"metadata":{"title":"Webhooks API","description":"# Tutorial\n\nCon el sistema de **webhooks**, puedes suscribirte a los eventos que se producen sobre la mayoría de recursos del sistema, de forma que puedes recibir notificaciones para que tu sistema reaccione como corresponda.\n\nLa mayoría de recursos permiten suscribirse a los eventos de:\n\n- `created`\n- `updated`\n- `deleted`\n\n## Recursos con soporte de Webhooks\n\n| Dominio     | Recurso               | Descripción                        |\n|-------------|------------------------|------------------------------------|\n| Contact     | Customer               | Clientes                           |\n| Contact     | Supplier               | Proveedores                        |\n| Warehouse   | Article                | Artículos                          |\n| Warehouse   | Warehouse              | Almacenes                          |\n| Purchase    | Order                  | Pedidos de proveedor               |\n| Purchase    | Delivery-note          | Albaranes de proveedor             |\n| Purchase    | Invoice                | Facturas de proveedor              |\n| Sale        | Quote                  | Presupuesto de cliente             |\n| Sale        | Order                  | Pedido de cliente                  |\n| Sale        | Delivery-note          | Albarán de cliente                 |\n| Sale        | Invoice                | Factura de cliente                 |\n| Sale        | Template-sale-invoice  | Plantilla de facturación periódica |\n| Accounting  | Account                | Cuentas contables                  |\n| Accounting  | Entry                  | Asientos contables                 |\n\n---\n\n## Obtención del Api Key\nPara utilizar el sistema de webhooks, es necesario disponer de un Api Key desde el área del desarrollador.\nLos pasos para obtenerlo son los siguientes:\n1. Accede a tu cuenta de PRANA.\n2. Dirígete al área de \"Configuración\".\n3. Selecciona la opción \"Desarrolladores\".\n4. Haz clic en \"Añadir API Key\".\n5. Dale un nombre descriptivo a tu API Key y guarda los cambios.\n6. Copia el valor del API Key generado y guárdalo en un lugar seguro. Este valor tendrás que pasarlo como cabecera, en todas las peticiones que hagas contra el sistema.\n\n![Añadir ApiKey](api-key.png)\n\n---\n\n## Recursos y eventos a los que puedes suscribirte\n\nPuedes obtener la lista completa de recursos y eventos a los que es posible suscribirse, de esta forma.\n\n**Request**\n\n```http\nGET /event-type\nContent-Type: application/json\nx-api-key: <API_KEY>\n```\n\n**Responses**\n\n**200 OK**\n\nLista de tipos de evento disponibles en el sistema.\n\n```json\n[\n  {\n    \"appName\": \"PRANA\",\n    \"eventDomain\": \"ACCOUNTING\",\n    \"resource\": \"ACCOUNT\",\n    \"eventName\": \"CREATED\",\n    \"semanticName\": \"PRANA.ACCOUNTING.ACCOUNT.CREATED\",\n    \"id\": \"c6e050ee-b2a8-4df9-bf80-7655be7afbdf\",\n    \"active\": true\n  },\n  {\n    \"appName\": \"PRANA\",\n    \"eventDomain\": \"ACCOUNTING\",\n    \"resource\": \"ACCOUNT\",\n    \"eventName\": \"DELETED\",\n    \"semanticName\": \"PRANA.ACCOUNTING.ACCOUNT.DELETED\",\n    \"id\": \"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d\",\n    \"active\": true\n  }\n]\n```\n\n## Subscribirse a eventos\nPara crear una nueva subscripción, debes hacer una petición POST indicando:\n* `callbackUrl`: URL de tu sistema donde deseas recibir las notificaciones\n* `secret`: Palabra clave que usaremos para firmar cada mensaje\n* `events`: Lista de cadenas con los nombres semánticos de los eventos a los que deseas suscribirte\n\n```http\nPOST /subscription\nContent-Type: application/json\nx-api-key: <API_KEY>\n{\n    \"callbackUrl\": \"https://url-de-tu-sistema.com/webhook\",\n    \"secret\": \"<PALABRA_SECRETA>\",\n    \"events\": [\n        \"PRANA.CONTACT.CUSTOMER.CREATED\",\n        \"PRANA.CONTACT.CUSTOMER.UPDATED\",\n        \"PRANA.CONTACT.CUSTOMER.DELETED\"\n    ]\n}\n```\n\n**200 OK**\n\nObtendrás una respuesta con los datos de la suscripción creada.\n\n```json\n{\n  \"subscriptionId\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n  \"responseState\": \"SUCCESS\",\n  \"errors\": null\n}\n```\n\n**handshake**\n\nAl crear una nueva suscripción, el sistema realizará una petición `POST` a la URL indicada en `callbackUrl`, para verificar que tu sistema está preparado para recibir las notificaciones. \nEl sistema esperará una respuesta con código `200 OK` y cuerpo vacío, para considerar que la verificación ha sido correcta.\n\nEl mensaje de esta petición, contendrá la siguiente información.\n\n```json\n{\n  \"subscriptionId\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n  \"tenantInformation\": {\n    \"tenantId\": \"999999\",\n    \"userId\": \"aaaaaa999999\"\n  },\n  \"eventType\": {\n    \"appName\": \"webhook\",\n    \"eventDomain\": \"\",\n    \"resource\": \"\",\n    \"eventName\": \"handshake\",\n    \"semanticName\": \"webhook...handshake\",\n    \"id\": \"e53ae4e1-d970-43de-8bf5-f7be2954e46d\",\n    \"active\": true\n  },\n  \"payload\": \"{\\\"Type\\\":\\\"Acknowledge\\\"}\"\n}\n```\n* `subscriptionId`: Identificador de la suscripción que acabas de crear.\n* `tenantInformation`: Información del inquilino y usuario asociado a la suscripción.\n* `eventType`: Tipo de evento, en este caso `handshake`.\n* `payload`: Contenido del mensaje, en este caso un JSON con el campo `Type` con valor `Acknowledge`.\n\nA partir de este momento, tu sistema estará preparado para recibir las notificaciones de los eventos a los que te has suscrito.\n\n### Notificaciones de eventos\nCada vez que se produzca un evento al que te has suscrito, el sistema realizará una petición `POST` a la URL indicada en `callbackUrl`. \nEsta petición incluirá una cabecera `x-signature`, que contendrá una firma HMAC-SHA256 del cuerpo del mensaje, \nutilizando la `secret` que proporcionaste al crear la suscripción. Esto te permitirá verificar la autenticidad del mensaje recibido.\n\nEl cuerpo del mensaje tendrá la siguiente estructura:\n```json\n{\n  \"subscriptionId\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n  \"tenantInformation\": {\n    \"tenantId\": \"999999\",\n    \"userId\": \"aaaaaa999999\"\n  },\n  \"eventType\": {\n    \"appName\": \"PRANA\",\n    \"eventDomain\": \"CONTACT\",\n    \"resource\": \"CUSTOMER\",\n    \"eventName\": \"UPDATED\",\n    \"semanticName\": \"PRANA.CONTACT.CUSTOMER.UPDATED\"\n  },\n  \"payload\": \"{\\\"EntityId\\\":\\\"369986\\\"}\"\n}\n```\n\nEn el elemento `payload`, encontrarás la información específica del evento. En este caso, \nel campo `EntityId` indica el identificador del cliente que ha sido actualizado. Con esta información, \npodrás enviar una petición a la API para obtener los detalles del cliente actualizado.\n\n## Consulta tus suscripciones\nEn cualquier momento, puedes consultar las suscripciones que has creado realizando una petición `GET` a la siguiente URL:\n\n```http\nGET /subscription\nContent-Type: application/json\nx-api-key: <API_KEY>\n```\n\n```json\n[\n  {\n    \"id\": \"f575bd47-826b-4ff8-9934-60656ee7d89f\",\n    \"secret\": \"<PALABRA_SECRETA>\",\n    \"callbackUrl\": \"https://url-de-tu-sistema.com/webhook\",\n    \"status\": \"ACTIVE\",\n    \"statusMessage\": \"\",\n    \"webhooks\": [\n      {\n        \"id\": \"2a87d134-6458-4379-af71-1cdab4f77d01\",\n        \"eventType\": {\n          \"appName\": \"PRANA\",\n          \"eventDomain\": \"CONTACT\",\n          \"resource\": \"CUSTOMER\",\n          \"eventName\": \"CREATED\",\n          \"semanticName\": \"PRANA.CUSTOMER.CUSTOMER.CREATED\"\n        }\n      },\n      {\n        \"id\": \"9562db1d-b3a5-43f3-b0d7-daebed0b7c06\",\n        \"eventType\": {\n          \"appName\": \"PRANA\",\n          \"eventDomain\": \"CONTACT\",\n          \"resource\": \"CUSTOMER\",\n          \"eventName\": \"UPDATED\",\n          \"semanticName\": \"PRANA.CUSTOMER.CUSTOMER.UPDATED\"\n        }\n      },\n      {\n        \"id\": \"55f62ac0-07e3-4d87-bf4f-5ecc55b47f89\",\n        \"eventType\": {\n          \"appName\": \"PRANA\",\n          \"eventDomain\": \"CONTACT\",\n          \"resource\": \"CUSTOMER\",\n          \"eventName\": \"DELETED\",\n          \"semanticName\": \"PRANA.CUSTOMER.CUSTOMER.DELETED\"\n        }\n      }\n    ]\n  }\n]\n```\n\n## Elimina una suscripción\nSi deseas eliminar una suscripción, puedes hacerlo realizando una petición `DELETE` de la siguiente forma:\n\n```http\nDELETE /subscription/{subscriptionId}\nContent-Type: application/json\nx-api-key: <API_KEY>\n```\n\nDonde `subscriptionId` es el identificador de la suscripción que deseas eliminar.\n\nEn este caso, la respuesta del sistema será un código 200 OK, indicando que la suscripción ha sido eliminada correctamente.\n\n## Actualiza una suscripción\nSi necesitas actualizar una suscripción existente, puedes hacerlo mediante una petición `PUT`. \nLa estructura de la petición es similar a la de creación, pero debes incluir el `subscriptionId` de la suscripción que deseas actualizar.\n\nLos valores que puedes actualizar son:\n* `callbackUrl`: URL de tu sistema donde deseas recibir las notificaciones\n* `secret`: Palabra clave que usaremos para firmar cada mensaje\n* `status`: Estado de la suscripción. Puede ser `ACTIVE` o `INACTIVE`\n\n```http\nPUT /subscription/{subscriptionId}\nContent-Type: application/json\nx-api-key: <API_KEY>\n{\n    \"callbackUrl\": \"https://url-de-tu-sistema.com/webhook\",\n    \"secret\": \"<PALABRA_SECRETA>\",\n    \"status\": \"ACTIVE\"\n}\n```\n\n## Firma y verificación de mensajes\nCada notificación enviada a tu sistema incluirá una cabecera `x-signature`, que contiene una firma HMAC-SHA256 del cuerpo del mensaje. \nEsta firma se genera utilizando la `secret` que proporcionaste al crear la suscripción.\n\n```java\nimport javax.crypto.Mac;\nimport javax.crypto.SecretKey;\nimport javax.crypto.spec.SecretKeySpec;\nimport java.nio.charset.StandardCharsets;\nimport java.security.InvalidKeyException;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.Base64;\n\npublic final class SignatureUtils {\n    private static final String ALGORITHM = \"HmacSHA256\";\n\n    private SignatureUtils() {\n        throw new IllegalStateException(\"Utility class\");\n    }\n\n    public static String generateSignature(String secret, String payload) {\n        try {\n            SecretKey secretKey = new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), ALGORITHM);\n\n            Mac mac = Mac.getInstance(ALGORITHM);\n            mac.init(secretKey);\n\n            return Base64.getEncoder().encodeToString(\n                    mac.doFinal(payload.getBytes(StandardCharsets.UTF_8))\n            );\n        } catch (NoSuchAlgorithmException ex) {\n            throw new IllegalStateException(\"Algorithm \" + ALGORITHM + \" not available\", ex);\n        } catch (InvalidKeyException ex) {\n            throw new IllegalStateException(\"Invalid secret key for signature generation\", ex);\n        }\n    }\n}\n```"}},"baseSlug":"/webhooks/openwebhooks","routesMapping":{}}