{"componentChunkName":"component---src-templates-simple-markdown-js","path":"/api-docs/best-practices/notification-webhooks/","matchPath":"","result":{"data":{"markdownRemark":{"html":"<h1 style=\"position:relative;\"><a href=\"#notification-webhooks\" aria-label=\"notification webhooks permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"notification-webhooks\"></div>Notification webhooks</h1>\n<p>Webhooks are a recommended best practice to receive notifications from Ripple Payments Direct 2.0 about changes to the status of your payments instead of repeatedly polling for updates.</p>\n<p>This topic provides an overview of webhooks along with guidance on how to use webhooks with Ripple Payments Direct.</p>\n<h2 style=\"position:relative;\"><a href=\"#why-use-notification-webhooks\" aria-label=\"why use notification webhooks permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"why-use-notification-webhooks\"></div>Why use notification webhooks</h2>\n<p>A webhook is a method by which a service can notify a client application of relevant events, by sending notification messages to a callback URL that the client has registered with the service. When an event occurs, the service sends a notification to the specified callback URL, using the HTTP POST method, to let the client know that information is available about the event. This saves the client from having to continuously poll the service for new information.</p>\n<div class=\"admonition admonition-attention\"><div class=\"admonition-heading\"><h5><span class=\"admonition-icon\"><i></i></span>Note:</h5></div><div class=\"admonition-content\"><p>Ripple Payments Direct 2.0 doesn’t support authenticated callback URLs.</p></div></div>\n<h2 style=\"position:relative;\"><a href=\"#event-types\" aria-label=\"event types permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"event-types\"></div>Event types</h2>\n<p>Ripple Payments Direct 2.0 currently supports webhook notifications for the <code class=\"language-text\">PAYMENT_STATE_TRANSITION</code> event type. When a payment transitions from one state to another, the service sends a notification to the registered callback URL containing information about the event. For more information, see <a href=\"#1-register-callback-url\">Register callback URL</a>.</p>\n<ul>\n<li>\nThis is currently the \n<strong>only event type</strong>\n emitted in Payments Direct 2.0.\n</li>\n<li>\nThe payload is a \n<strong>“thin-plus” design</strong>\n: it is not a full payment object, but it includes more than just an ID. \n</li>\n<li>\nEach webhook contains the \n<code class=\"language-text\">paymentId</code>\n and the \n<strong>new payment state</strong>\n, along with some additional fields for context.\n</li>\n</ul>\n<p>The following tabs show sample payloads for the payment state transition event with different payment states:</p>\n\n      <div class=\"code-snippets-tabs\" >\n    <div class=\"snippets-tabs-headers\">\n      <span class=\"tab-header active\" data-lang=\"json\" data-snippet-id=\"INITIATED\">INITIATED</span><span class=\"tab-header \" data-lang=\"json\" data-snippet-id=\"VALIDATING\">VALIDATING</span><span class=\"tab-header \" data-lang=\"json\" data-snippet-id=\"TRANSFERRING\">TRANSFERRING</span><span class=\"tab-header \" data-lang=\"json\" data-snippet-id=\"COMPLETED\">COMPLETED</span><span class=\"tab-header \" data-lang=\"json\" data-snippet-id=\"FAILED\">FAILED</span>\n    </div>\n    <div class=\"snippets-tabs-contents\">\n      <div class=\"tab-content active\" data-lang=\"json\" data-snippet-id=\"INITIATED\"><div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"29372931486544253000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n    &quot;id&quot;:&quot;4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9&quot;, // The ID of the webhook notification\n    &quot;eventType&quot;:&quot;PAYMENT_STATE_TRANSITION&quot;, // The type of event\n    &quot;eventVersion&quot;:1, // The version of the event. The version number may change if the event data changes\n    &quot;eventData&quot;: { // The data of the event\n        &quot;paymentId&quot;:&quot;5ce2c433-a96d-48d0-8857-02637a60abf4&quot;, // The ID of the payment to which the event corresponds\n        &quot;expiresAt&quot;:&quot;2025-07-28T17:18:35.663Z&quot;, // The time when the payment expires\n        &quot;createdAt&quot;:&quot;2025-05-29T17:18:35.663Z&quot;, // The time when the payment was created\n        &quot;sourceCurrency&quot;:&quot;USD&quot;, // The source currency of the payment\n        &quot;sourceAmount&quot;:8, // The source amount corresponding to the source currency of the payment\n        &quot;destinationCurrency&quot;:&quot;COP&quot;, // The destination currency of the payment\n        &quot;payoutAmount&quot;:32538.81, // The payout amount corresponding to the destination currency of the payment\n        &quot;paymentState&quot;:&quot;INITIATED&quot;, // The state that the payment is currently in\n        &quot;beneficiaryToken&quot;:&quot;cb207125-73a7-4a94-8502-a7780f1cae78&quot; // The ID of the payment beneficiary\n    },\n    &quot;createDate&quot;:&quot;2025-05-30T10:21:18.065Z&quot; // The time when the webhook notification was created\n}`, `29372931486544253000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-29372931486544253000\">Copied!</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The ID of the webhook notification</span>\n    <span class=\"token property\">\"eventType\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"PAYMENT_STATE_TRANSITION\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The type of event</span>\n    <span class=\"token property\">\"eventVersion\"</span><span class=\"token operator\">:</span><span class=\"token number\">1</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The version of the event. The version number may change if the event data changes</span>\n    <span class=\"token property\">\"eventData\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> <span class=\"token comment\">// The data of the event</span>\n        <span class=\"token property\">\"paymentId\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"5ce2c433-a96d-48d0-8857-02637a60abf4\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The ID of the payment to which the event corresponds</span>\n        <span class=\"token property\">\"expiresAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-07-28T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The time when the payment expires</span>\n        <span class=\"token property\">\"createdAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-29T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The time when the payment was created</span>\n        <span class=\"token property\">\"sourceCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"USD\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The source currency of the payment</span>\n        <span class=\"token property\">\"sourceAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">8</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The source amount corresponding to the source currency of the payment</span>\n        <span class=\"token property\">\"destinationCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"COP\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The destination currency of the payment</span>\n        <span class=\"token property\">\"payoutAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">32538.81</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The payout amount corresponding to the destination currency of the payment</span>\n        <span class=\"token property\">\"paymentState\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"INITIATED\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The state that the payment is currently in</span>\n        <span class=\"token property\">\"beneficiaryToken\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"cb207125-73a7-4a94-8502-a7780f1cae78\"</span> <span class=\"token comment\">// The ID of the payment beneficiary</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"createDate\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-30T10:21:18.065Z\"</span> <span class=\"token comment\">// The time when the webhook notification was created</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div></div><div class=\"tab-content \" data-lang=\"json\" data-snippet-id=\"VALIDATING\"><div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"81486966731348050000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n    &quot;id&quot;:&quot;4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9&quot;, // The ID of the webhook notification\n    &quot;eventType&quot;:&quot;PAYMENT_STATE_TRANSITION&quot;, // The type of event\n    &quot;eventVersion&quot;:1, // The version of the event. The version number may change if the event data changes\n    &quot;eventData&quot;: { // The data of the event\n        &quot;paymentId&quot;:&quot;5ce2c433-a96d-48d0-8857-02637a60abf4&quot;, // The ID of the payment to which the event corresponds\n        &quot;expiresAt&quot;:&quot;2025-07-28T17:18:35.663Z&quot;, // The time when the payment expires\n        &quot;createdAt&quot;:&quot;2025-05-29T17:18:35.663Z&quot;, // The time when the payment was created\n        &quot;sourceCurrency&quot;:&quot;USD&quot;, // The source currency of the payment\n        &quot;sourceAmount&quot;:8, // The source amount corresponding to the source currency of the payment\n        &quot;destinationCurrency&quot;:&quot;COP&quot;, // The destination currency of the payment\n        &quot;payoutAmount&quot;:32538.81, // The payout amount corresponding to the destination currency of the payment\n        &quot;paymentState&quot;:&quot;VALIDATING&quot;, // The state that the payment is currently in\n        &quot;beneficiaryToken&quot;:&quot;cb207125-73a7-4a94-8502-a7780f1cae78&quot; // The ID of the payment beneficiary\n    },\n    &quot;createDate&quot;:&quot;2025-05-30T10:21:20.468Z&quot; // The time when the webhook notification was created\n}`, `81486966731348050000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-81486966731348050000\">Copied!</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The ID of the webhook notification</span>\n    <span class=\"token property\">\"eventType\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"PAYMENT_STATE_TRANSITION\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The type of event</span>\n    <span class=\"token property\">\"eventVersion\"</span><span class=\"token operator\">:</span><span class=\"token number\">1</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The version of the event. The version number may change if the event data changes</span>\n    <span class=\"token property\">\"eventData\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> <span class=\"token comment\">// The data of the event</span>\n        <span class=\"token property\">\"paymentId\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"5ce2c433-a96d-48d0-8857-02637a60abf4\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The ID of the payment to which the event corresponds</span>\n        <span class=\"token property\">\"expiresAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-07-28T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The time when the payment expires</span>\n        <span class=\"token property\">\"createdAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-29T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The time when the payment was created</span>\n        <span class=\"token property\">\"sourceCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"USD\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The source currency of the payment</span>\n        <span class=\"token property\">\"sourceAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">8</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The source amount corresponding to the source currency of the payment</span>\n        <span class=\"token property\">\"destinationCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"COP\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The destination currency of the payment</span>\n        <span class=\"token property\">\"payoutAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">32538.81</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The payout amount corresponding to the destination currency of the payment</span>\n        <span class=\"token property\">\"paymentState\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"VALIDATING\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The state that the payment is currently in</span>\n        <span class=\"token property\">\"beneficiaryToken\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"cb207125-73a7-4a94-8502-a7780f1cae78\"</span> <span class=\"token comment\">// The ID of the payment beneficiary</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"createDate\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-30T10:21:20.468Z\"</span> <span class=\"token comment\">// The time when the webhook notification was created</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div></div><div class=\"tab-content \" data-lang=\"json\" data-snippet-id=\"TRANSFERRING\"><div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"33686957396239036000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n    &quot;id&quot;:&quot;4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9&quot;, // The ID of the webhook notification\n    &quot;eventType&quot;:&quot;PAYMENT_STATE_TRANSITION&quot;, // The type of event\n    &quot;eventVersion&quot;:1, // The version of the event. The version number may change if the event data changes\n    &quot;eventData&quot;: { // The data of the event\n        &quot;paymentId&quot;:&quot;5ce2c433-a96d-48d0-8857-02637a60abf4&quot;, // The ID of the payment to which the event corresponds\n        &quot;expiresAt&quot;:&quot;2025-07-28T17:18:35.663Z&quot;, // The time when the payment expires\n        &quot;createdAt&quot;:&quot;2025-05-29T17:18:35.663Z&quot;, // The time when the payment was created\n        &quot;sourceCurrency&quot;:&quot;USD&quot;, // The source currency of the payment\n        &quot;sourceAmount&quot;:8, // The source amount corresponding to the source currency of the payment\n        &quot;destinationCurrency&quot;:&quot;COP&quot;, // The destination currency of the payment\n        &quot;payoutAmount&quot;:32538.81, // The payout amount corresponding to the destination currency of the payment\n        &quot;paymentState&quot;:&quot;TRANSFERRING&quot;, // The state that the payment is currently in\n        &quot;beneficiaryToken&quot;:&quot;cb207125-73a7-4a94-8502-a7780f1cae78&quot; // The ID of the payment beneficiary\n    },\n    &quot;createDate&quot;:&quot;2025-05-30T10:21:32.455Z&quot; // The time when the webhook notification was created\n}`, `33686957396239036000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-33686957396239036000\">Copied!</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The ID of the webhook notification</span>\n    <span class=\"token property\">\"eventType\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"PAYMENT_STATE_TRANSITION\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The type of event</span>\n    <span class=\"token property\">\"eventVersion\"</span><span class=\"token operator\">:</span><span class=\"token number\">1</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The version of the event. The version number may change if the event data changes</span>\n    <span class=\"token property\">\"eventData\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> <span class=\"token comment\">// The data of the event</span>\n        <span class=\"token property\">\"paymentId\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"5ce2c433-a96d-48d0-8857-02637a60abf4\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The ID of the payment to which the event corresponds</span>\n        <span class=\"token property\">\"expiresAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-07-28T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The time when the payment expires</span>\n        <span class=\"token property\">\"createdAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-29T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The time when the payment was created</span>\n        <span class=\"token property\">\"sourceCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"USD\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The source currency of the payment</span>\n        <span class=\"token property\">\"sourceAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">8</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The source amount corresponding to the source currency of the payment</span>\n        <span class=\"token property\">\"destinationCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"COP\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The destination currency of the payment</span>\n        <span class=\"token property\">\"payoutAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">32538.81</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The payout amount corresponding to the destination currency of the payment</span>\n        <span class=\"token property\">\"paymentState\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"TRANSFERRING\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The state that the payment is currently in</span>\n        <span class=\"token property\">\"beneficiaryToken\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"cb207125-73a7-4a94-8502-a7780f1cae78\"</span> <span class=\"token comment\">// The ID of the payment beneficiary</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"createDate\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-30T10:21:32.455Z\"</span> <span class=\"token comment\">// The time when the webhook notification was created</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div></div><div class=\"tab-content \" data-lang=\"json\" data-snippet-id=\"COMPLETED\"><div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"12595041403315554000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n    &quot;id&quot;:&quot;4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9&quot;, // The ID of the webhook notification\n    &quot;eventType&quot;:&quot;PAYMENT_STATE_TRANSITION&quot;, // The type of event\n    &quot;eventVersion&quot;:1, // The version of the event. The version number may change if the event data changes\n    &quot;eventData&quot;: { // The data of the event\n        &quot;paymentId&quot;:&quot;5ce2c433-a96d-48d0-8857-02637a60abf4&quot;, // The ID of the payment to which the event corresponds\n        &quot;expiresAt&quot;:&quot;2025-07-28T17:18:35.663Z&quot;, // The time when the payment expires\n        &quot;createdAt&quot;:&quot;2025-05-29T17:18:35.663Z&quot;, // The time when the payment was created\n        &quot;sourceCurrency&quot;:&quot;USD&quot;, // The source currency of the payment\n        &quot;sourceAmount&quot;:8, // The source amount corresponding to the source currency of the payment\n        &quot;destinationCurrency&quot;:&quot;COP&quot;, // The destination currency of the payment\n        &quot;payoutAmount&quot;:32538.81, // The payout amount corresponding to the destination currency of the payment\n        &quot;paymentState&quot;:&quot;COMPLETED&quot;, // The state that the payment is currently in\n        &quot;beneficiaryToken&quot;:&quot;cb207125-73a7-4a94-8502-a7780f1cae78&quot; // The ID of the payment beneficiary\n    },\n    &quot;createDate&quot;:&quot;2025-05-30T10:21:43.254Z&quot; // The time when the webhook notification was created\n}`, `12595041403315554000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-12595041403315554000\">Copied!</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The ID of the webhook notification</span>\n    <span class=\"token property\">\"eventType\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"PAYMENT_STATE_TRANSITION\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The type of event</span>\n    <span class=\"token property\">\"eventVersion\"</span><span class=\"token operator\">:</span><span class=\"token number\">1</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The version of the event. The version number may change if the event data changes</span>\n    <span class=\"token property\">\"eventData\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> <span class=\"token comment\">// The data of the event</span>\n        <span class=\"token property\">\"paymentId\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"5ce2c433-a96d-48d0-8857-02637a60abf4\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The ID of the payment to which the event corresponds</span>\n        <span class=\"token property\">\"expiresAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-07-28T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The time when the payment expires</span>\n        <span class=\"token property\">\"createdAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-29T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The time when the payment was created</span>\n        <span class=\"token property\">\"sourceCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"USD\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The source currency of the payment</span>\n        <span class=\"token property\">\"sourceAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">8</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The source amount corresponding to the source currency of the payment</span>\n        <span class=\"token property\">\"destinationCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"COP\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The destination currency of the payment</span>\n        <span class=\"token property\">\"payoutAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">32538.81</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The payout amount corresponding to the destination currency of the payment</span>\n        <span class=\"token property\">\"paymentState\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"COMPLETED\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The state that the payment is currently in</span>\n        <span class=\"token property\">\"beneficiaryToken\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"cb207125-73a7-4a94-8502-a7780f1cae78\"</span> <span class=\"token comment\">// The ID of the payment beneficiary</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"createDate\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-30T10:21:43.254Z\"</span> <span class=\"token comment\">// The time when the webhook notification was created</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div></div><div class=\"tab-content \" data-lang=\"json\" data-snippet-id=\"FAILED\"><div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"9584467790069340000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n    &quot;id&quot;:&quot;4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9&quot;, // The ID of the webhook notification\n    &quot;eventType&quot;:&quot;PAYMENT_STATE_TRANSITION&quot;, // The type of event\n    &quot;eventVersion&quot;:1, // The version of the event. The version number may change if the event data changes\n    &quot;eventData&quot;: { // The data of the event\n        &quot;paymentId&quot;:&quot;5ce2c433-a96d-48d0-8857-02637a60abf4&quot;, // The ID of the payment to which the event corresponds\n        &quot;expiresAt&quot;:&quot;2025-07-28T17:18:35.663Z&quot;, // The time when the payment expires\n        &quot;createdAt&quot;:&quot;2025-05-29T17:18:35.663Z&quot;, // The time when the payment was created\n        &quot;sourceCurrency&quot;:&quot;USD&quot;, // The source currency of the payment\n        &quot;sourceAmount&quot;:8, // The source amount corresponding to the source currency of the payment\n        &quot;destinationCurrency&quot;:&quot;COP&quot;, // The destination currency of the payment\n        &quot;payoutAmount&quot;:32538.81, // The payout amount corresponding to the destination currency of the payment\n        &quot;paymentState&quot;:&quot;FAILED&quot;, // The state that the payment is currently in\n        &quot;beneficiaryToken&quot;:&quot;cb207125-73a7-4a94-8502-a7780f1cae78&quot; // The ID of the payment beneficiary\n    },\n    &quot;createDate&quot;:&quot;2025-05-30T10:21:43.254Z&quot; // The time when the webhook notification was created\n}`, `9584467790069340000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-9584467790069340000\">Copied!</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The ID of the webhook notification</span>\n    <span class=\"token property\">\"eventType\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"PAYMENT_STATE_TRANSITION\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The type of event</span>\n    <span class=\"token property\">\"eventVersion\"</span><span class=\"token operator\">:</span><span class=\"token number\">1</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The version of the event. The version number may change if the event data changes</span>\n    <span class=\"token property\">\"eventData\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> <span class=\"token comment\">// The data of the event</span>\n        <span class=\"token property\">\"paymentId\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"5ce2c433-a96d-48d0-8857-02637a60abf4\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The ID of the payment to which the event corresponds</span>\n        <span class=\"token property\">\"expiresAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-07-28T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The time when the payment expires</span>\n        <span class=\"token property\">\"createdAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-29T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The time when the payment was created</span>\n        <span class=\"token property\">\"sourceCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"USD\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The source currency of the payment</span>\n        <span class=\"token property\">\"sourceAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">8</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The source amount corresponding to the source currency of the payment</span>\n        <span class=\"token property\">\"destinationCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"COP\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The destination currency of the payment</span>\n        <span class=\"token property\">\"payoutAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">32538.81</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The payout amount corresponding to the destination currency of the payment</span>\n        <span class=\"token property\">\"paymentState\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"FAILED\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// The state that the payment is currently in</span>\n        <span class=\"token property\">\"beneficiaryToken\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"cb207125-73a7-4a94-8502-a7780f1cae78\"</span> <span class=\"token comment\">// The ID of the payment beneficiary</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"createDate\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-30T10:21:43.254Z\"</span> <span class=\"token comment\">// The time when the webhook notification was created</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div></div>\n    </div></div>\n    \n<div class=\"admonition admonition-attention\"><div class=\"admonition-heading\"><h5><span class=\"admonition-icon\"><i></i></span>Note</h5></div><div class=\"admonition-content\"><p>Event data of the <code class=\"language-text\">PAYMENT_STATE_TRANSITION</code> event do not include details such as error codes in case of a <code class=\"language-text\">FAILED</code> payment. This event type purely informs about payment state transitions.</p></div></div>\n<!--**PAYMENT INITIATED**\n\nA payment `INITIATED` event indicates that the payment originator has initiated a payment and a unique `paymentId` has been created.\n\n<details>\n<summary style=\"color:black\">Click to expand</summary>\n\n```json\n{\n    \"data\": [\n        {\n            \"paymentId\": \"a99b1607-b708-401b-94b4-7ad8e9c24e06\",\n            \"initiatedAt\": \"2025-05-28T20:26:44.969Z\",\n            \"expiresAt\": \"2025-07-27T20:26:44.969Z\",\n            \"lastStateUpdatedAt\": \"2025-05-28T20:29:34.461Z\",\n            \"paymentState\": \"INITIATED\",\n            \"originator\": {\n                \"sourceCurrency\": \"USD\",\n                \"sourceAmount\": 15.26,\n                \"payin\": \"FUNDED\"\n            },\n            \"destination\": {\n                \"destinationAmount\": 237.62,\n                \"destinationCountry\": \"MX\",\n                \"destinationCurrency\": \"MXN\",\n                \"beneficiaryIdentityId\": \"bb5ac375-f43f-4499-af05-819e86e5598e\",\n                \"beneficiaryIdentityVersion\": 1,\n                \"beneficiaryIdentityNickName\": \"Tina's Coffee Shop MX\",\n                \"payout\": \"BANK\"\n            },\n            \"adjustedExchangeRate\": {\n                \"adjustedRate\": 19.40278236\n            },\n            \"fees\": [\n                {\n                    \"totalFee\": 3.013486,\n                    \"feeCurrency\": \"USD\"\n                }\n            ],\n            \"purposeCode\": \"COMP\",\n            \"transactionDetails\": {\n                \"paymentProduct\": \"PAYMENTS_DIRECT\",\n                \"flowType\": \"B2B\",\n                \"thirdPartyPayment\": false,\n                \"businessUseCase\": \"FIAT_TRANSFER\"\n            }\n        }\n    ],\n    \"filter\": {\n        \"paymentIds\": [\n            \"a99b1607-b708-401b-94b4-7ad8e9c24e06\"\n        ]\n    },\n    \"page\": {\n        \"size\": 20,\n        \"lastPageToken\": \"1748464184969\"\n    }\n}\n```\n\n</details><br>\n\n**PAYMENT VALIDATING**\n\nA payment `VALIDATING` event indicates that Ripple is validating the payment details and reserves funds from your available balance to complete the payment.\n\n<details>\n<summary style=\"color:black\">Click to expand</summary>\n\n```json\n{\n    \"data\": [\n        {\n            \"paymentId\": \"a99b1607-b708-401b-94b4-7ad8e9c24e06\",\n            \"initiatedAt\": \"2025-05-28T20:27:44.969Z\",\n            \"expiresAt\": \"2025-07-27T20:27:44.969Z\",\n            \"lastStateUpdatedAt\": \"2025-05-28T20:30:34.461Z\",\n            \"paymentState\": \"VALIDATING\",\n            \"originator\": {\n                \"sourceCurrency\": \"USD\",\n                \"sourceAmount\": 15.26,\n                \"payin\": \"FUNDED\"\n            },\n            \"destination\": {\n                \"destinationAmount\": 237.62,\n                \"destinationCountry\": \"MX\",\n                \"destinationCurrency\": \"MXN\",\n                \"beneficiaryIdentityId\": \"bb5ac375-f43f-4499-af05-819e86e5598e\",\n                \"beneficiaryIdentityVersion\": 1,\n                \"beneficiaryIdentityNickName\": \"Tina's Coffee Shop MX\",\n                \"payout\": \"BANK\"\n            },\n            \"adjustedExchangeRate\": {\n                \"adjustedRate\": 19.40278236\n            },\n            \"fees\": [\n                {\n                    \"totalFee\": 3.013486,\n                    \"feeCurrency\": \"USD\"\n                }\n            ],\n            \"purposeCode\": \"COMP\",\n            \"transactionDetails\": {\n                \"paymentProduct\": \"PAYMENTS_DIRECT\",\n                \"flowType\": \"B2B\",\n                \"thirdPartyPayment\": false,\n                \"businessUseCase\": \"FIAT_TRANSFER\"\n            }\n        }\n    ],\n    \"filter\": {\n        \"paymentIds\": [\n            \"a99b1607-b708-401b-94b4-7ad8e9c24e06\"\n        ]\n    },\n    \"page\": {\n        \"size\": 20,\n        \"lastPageToken\": \"1748464184969\"\n    }\n}\n```\n\n</details><br>\n\n**PAYMENT TRANSFERRING**\n\nA payment `TRANSFERRING` event indicates that the payment is moving through the network to the ultimate beneficiary and the amount is debited from your available balance.\n\n<details>\n<summary style=\"color:black\">Click to expand</summary>\n\n```json\n{\n    \"data\": [\n        {\n            \"paymentId\": \"a99b1607-b708-401b-94b4-7ad8e9c24e06\",\n            \"initiatedAt\": \"2025-05-28T20:28:44.969Z\",\n            \"expiresAt\": \"2025-07-27T20:28:44.969Z\",\n            \"lastStateUpdatedAt\": \"2025-05-28T20:31:34.461Z\",\n            \"paymentState\": \"TRANSFERRING\",\n            \"originator\": {\n                \"sourceCurrency\": \"USD\",\n                \"sourceAmount\": 15.26,\n                \"payin\": \"FUNDED\"\n            },\n            \"destination\": {\n                \"destinationAmount\": 237.62,\n                \"destinationCountry\": \"MX\",\n                \"destinationCurrency\": \"MXN\",\n                \"beneficiaryIdentityId\": \"bb5ac375-f43f-4499-af05-819e86e5598e\",\n                \"beneficiaryIdentityVersion\": 1,\n                \"beneficiaryIdentityNickName\": \"Tina's Coffee Shop MX\",\n                \"payout\": \"BANK\"\n            },\n            \"adjustedExchangeRate\": {\n                \"adjustedRate\": 19.40278236\n            },\n            \"fees\": [\n                {\n                    \"totalFee\": 3.013486,\n                    \"feeCurrency\": \"USD\"\n                }\n            ],\n            \"purposeCode\": \"COMP\",\n            \"transactionDetails\": {\n                \"paymentProduct\": \"PAYMENTS_DIRECT\",\n                \"flowType\": \"B2B\",\n                \"thirdPartyPayment\": false,\n                \"businessUseCase\": \"FIAT_TRANSFER\"\n            }\n        }\n    ],\n    \"filter\": {\n        \"paymentIds\": [\n            \"a99b1607-b708-401b-94b4-7ad8e9c24e06\"\n        ]\n    },\n    \"page\": {\n        \"size\": 20,\n        \"lastPageToken\": \"1748464184969\"\n    }\n}\n```\n\n</details><br>\n\n**PAYMENT COMPLETED**\n\nA payment `COMPLETED` event indicates that the funds have reached the ultimate beneficiary.\n\n<details>\n<summary style=\"color:black\">Click to expand</summary>\n\n```json\n{\n    \"data\": [\n        {\n            \"paymentId\": \"a99b1607-b708-401b-94b4-7ad8e9c24e06\",\n            \"initiatedAt\": \"2025-05-28T20:29:44.969Z\",\n            \"expiresAt\": \"2025-07-27T20:29:44.969Z\",\n            \"lastStateUpdatedAt\": \"2025-05-28T20:32:34.461Z\",\n            \"paymentState\": \"COMPLETED\",\n            \"originator\": {\n                \"sourceCurrency\": \"USD\",\n                \"sourceAmount\": 15.26,\n                \"payin\": \"FUNDED\"\n            },\n            \"destination\": {\n                \"destinationAmount\": 237.62,\n                \"destinationCountry\": \"MX\",\n                \"destinationCurrency\": \"MXN\",\n                \"beneficiaryIdentityId\": \"bb5ac375-f43f-4499-af05-819e86e5598e\",\n                \"beneficiaryIdentityVersion\": 1,\n                \"beneficiaryIdentityNickName\": \"Tina's Coffee Shop MX\",\n                \"payout\": \"BANK\"\n            },\n            \"adjustedExchangeRate\": {\n                \"adjustedRate\": 19.40278236\n            },\n            \"fees\": [\n                {\n                    \"totalFee\": 3.013486,\n                    \"feeCurrency\": \"USD\"\n                }\n            ],\n            \"purposeCode\": \"COMP\",\n            \"transactionDetails\": {\n                \"paymentProduct\": \"PAYMENTS_DIRECT\",\n                \"flowType\": \"B2B\",\n                \"thirdPartyPayment\": false,\n                \"businessUseCase\": \"FIAT_TRANSFER\"\n            }\n        }\n    ],\n    \"filter\": {\n        \"paymentIds\": [\n            \"a99b1607-b708-401b-94b4-7ad8e9c24e06\"\n        ]\n    },\n    \"page\": {\n        \"size\": 20,\n        \"lastPageToken\": \"1748464184969\"\n    }\n}\n```\n\n</details><br>\n\n**PAYMENT FAILED**\n\nA payment `FAILED` event indicates that the payment has failed. Funds that were previously reserved to complete the payment are released and added back to the available balance.\n\n<details>\n<summary style=\"color:black\">Click to expand</summary>\n\n```json\n{\n    \"data\": [\n        {\n            \"paymentId\": \"a99b1607-b708-401b-94b4-7ad8e9c24e06\",\n            \"initiatedAt\": \"2025-05-28T20:29:44.969Z\",\n            \"expiresAt\": \"2025-07-27T20:29:44.969Z\",\n            \"lastStateUpdatedAt\": \"2025-05-28T20:32:34.461Z\",\n            \"paymentState\": \"FAILED\",\n            \"originator\": {\n                \"sourceCurrency\": \"USD\",\n                \"sourceAmount\": 15.26,\n                \"payin\": \"FUNDED\"\n            },\n            \"destination\": {\n                \"destinationAmount\": 237.62,\n                \"destinationCountry\": \"MX\",\n                \"destinationCurrency\": \"MXN\",\n                \"beneficiaryIdentityId\": \"bb5ac375-f43f-4499-af05-819e86e5598e\",\n                \"beneficiaryIdentityVersion\": 1,\n                \"beneficiaryIdentityNickName\": \"Tina's Coffee Shop MX\",\n                \"payout\": \"BANK\"\n            },\n            \"adjustedExchangeRate\": {\n                \"adjustedRate\": 19.40278236\n            },\n            \"fees\": [\n                {\n                    \"totalFee\": 3.013486,\n                    \"feeCurrency\": \"USD\"\n                }\n            ],\n            \"purposeCode\": \"COMP\",\n            \"transactionDetails\": {\n                \"paymentProduct\": \"PAYMENTS_DIRECT\",\n                \"flowType\": \"B2B\",\n                \"thirdPartyPayment\": false,\n                \"businessUseCase\": \"FIAT_TRANSFER\"\n            }\n        }\n    ],\n    \"filter\": {\n        \"paymentIds\": [\n            \"a99b1607-b708-401b-94b4-7ad8e9c24e06\"\n        ]\n    },\n    \"page\": {\n        \"size\": 20,\n        \"lastPageToken\": \"1748464184969\"\n    }\n}\n```\n\n</details><br>\n-->\n<h2 style=\"position:relative;\"><a href=\"#configuration-and-security\" aria-label=\"configuration and security permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"configuration-and-security\"></div>Configuration and security</h2>\n<p>To start receiving webhook notifications, follow these steps to register a callback URL and add a Ripple IP address to your allowlist:</p>\n<h3 style=\"position:relative;\"><a href=\"#1-register-callback-url\" aria-label=\"1 register callback url permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"1-register-callback-url\"></div>1. Register callback URL</h3>\n<p>At the time you onboard with Ripple Payments Direct 2.0, you need to provide a callback URL to which Ripple Payments Direct 2.0 can send notifications when events occur. We recommend a public URL that's accessible over the internet, but restricted for access. The callback URL needs to be an HTTPS URL (not HTTP) with a public key certificate. Contact your Ripple liaison to register your webhook callback URL. This URL is configured in the Ripple Payments instance for your client application.</p>\n<h3 style=\"position:relative;\"><a href=\"#2-optional-add-ripple-ip-addresses-to-your-allowlist\" aria-label=\"2 optional add ripple ip addresses to your allowlist permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"2-optional-add-ripple-ip-addresses-to-your-allowlist\"></div>2. Optional: Add Ripple IP addresses to your allowlist</h3>\n<!-- The same IP addresses as ROS -->\n<p>To ensure that webhook callbacks originate from Ripple Payments, you may need to add the Ripple Payments IP addresses to your server’s allowlist.</p>\n<p>For a list of IP addresses to add to your allowlist, contact your Ripple liaison.</p>\n<h3 style=\"position:relative;\"><a href=\"#3-optional-verify-webhook-signatures\" aria-label=\"3 optional verify webhook signatures permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"3-optional-verify-webhook-signatures\"></div>3. Optional: Verify webhook signatures</h3>\n<p>To make sure that all webhook notifications are generated by Ripple, you can verify the webhook signatures using a public key that you can obtain from your Ripple liaison.</p>\n<p>To verify the webhook signatures:</p>\n<ol>\n<li>\nRetrieve the webhook payload and the signature (from the header).\n<p><strong>Example</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"49438825536192080000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`Body: {&quot;id&quot;:&quot;4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9&quot;,&quot;eventType&quot;:&quot;PAYMENT_STATE_TRANSITION&quot;,&quot;eventVersion&quot;:1,&quot;eventData&quot;:{&quot;paymentId&quot;:&quot;5ce2c433-a96d-48d0-8857-02637a60abf4&quot;,&quot;expiresAt&quot;:&quot;2025-07-28T17:18:35.663Z&quot;,&quot;createdAt&quot;:&quot;2025-05-29T17:18:35.663Z&quot;,&quot;sourceCurrency&quot;:&quot;USD&quot;,&quot;sourceAmount&quot;:8,&quot;destinationCurrency&quot;:&quot;COP&quot;,&quot;payoutAmount&quot;:32538.81,&quot;paymentState&quot;:&quot;VALIDATING&quot;,&quot;beneficiaryToken&quot;:&quot;cb207125-73a7-4a94-8502-a7780f1cae78&quot;},&quot;createDate&quot;:&quot;2025-05-30T10:21:20.468Z&quot;}\n\nHeaders:\nripple-signature: fcSWDhoHpNd+ZAQ2REndD7jacC1askGqltuXvFxp4MPWQ64w4cVz6yuvq3dAG/3pvCoJA10qXi/SCnvSXJajVKuOknU0WATEifQ+Zs4J06pCt2M0V8Ogcq2WIZ0+NUb2zvDfRr2o5UuzXVbEgDzZL0lC9s3PATQfcm3sJyYBSrCC35qf2NbkFye8i57jUPK8slEYwCwq6W+O+V1nFkNN6YMLi8MAHDSBsdGK+o/L1oCCckDaCFtMUaewVe15GKaQs6pHsVeLK0d7xgJmGciAnaifr7Ta2pv6dX4kTpIBzxy08VKiXHCRoRxZIyDF33jfHp5zVr/2H9xssGytZpDTkkSYYlgGNRS/mZxErE6Mddk2AN9ChMiWBq3TlMNLRCy3fCsICfLp/LqMqmU6/gr9uY41geLyzgozq2IanG4dHBuzHvyW8YykyeuifzFRKu4ykyKZpHTlYGe+ibDAh8Oo3XoO4iPe1NBqCFK+4EyjVgOa4LKT5XOBUxoXVUS4AxMun4MyPGNrOYVvLR2dzUc/5KeXVpWE4est6+XWLpSQduxRTwoeRHK7NdDyestKecWr0RS4le9FmvogBkuoCiMbMBrv+e0J9/A1X3txVXI+s6Zi72TwO6GqBAJx0bYRvAdKp3L9N2hcnd+P7NCnDKpb+hxc8+WeFkJcwtnqIupUVhw=\nripple-signature-timestamp: 2025-05-30T10:21:21.808586489Z`, `49438825536192080000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-49438825536192080000\">Copied!</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\">Body<span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span><span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"eventType\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"PAYMENT_STATE_TRANSITION\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"eventVersion\"</span><span class=\"token operator\">:</span><span class=\"token number\">1</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"eventData\"</span><span class=\"token operator\">:</span><span class=\"token punctuation\">{</span><span class=\"token property\">\"paymentId\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"5ce2c433-a96d-48d0-8857-02637a60abf4\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"expiresAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-07-28T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"createdAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-29T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"sourceCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"USD\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"sourceAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">8</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"destinationCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"COP\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"payoutAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">32538.81</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"paymentState\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"VALIDATING\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"beneficiaryToken\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"cb207125-73a7-4a94-8502-a7780f1cae78\"</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"createDate\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-30T10:21:20.468Z\"</span><span class=\"token punctuation\">}</span>\n\nHeaders<span class=\"token operator\">:</span>\nripple-signature<span class=\"token operator\">:</span> fcSWDhoHpNd+ZAQ2REndD7jacC1askGqltuXvFxp4MPWQ64w4cVz6yuvq3dAG/3pvCoJA10qXi/SCnvSXJajVKuOknU0WATEifQ+Zs4J06pCt2M0V8Ogcq2WIZ0+NUb2zvDfRr2o5UuzXVbEgDzZL0lC9s3PATQfcm3sJyYBSrCC35qf2NbkFye8i57jUPK8slEYwCwq6W+O+V1nFkNN6YMLi8MAHDSBsdGK+o/L1oCCckDaCFtMUaewVe15GKaQs6pHsVeLK0d7xgJmGciAnaifr7Ta2pv6dX4kTpIBzxy08VKiXHCRoRxZIyDF33jfHp5zVr/2H9xssGytZpDTkkSYYlgGNRS/mZxErE6Mddk2AN9ChMiWBq3TlMNLRCy3fCsICfLp/LqMqmU6/gr9uY41geLyzgozq2IanG4dHBuzHvyW8YykyeuifzFRKu4ykyKZpHTlYGe+ibDAh8Oo3XoO4iPe1NBqCFK+4EyjVgOa4LKT5XOBUxoXVUS4AxMun4MyPGNrOYVvLR2dzUc/5KeXVpWE4est6+XWLpSQduxRTwoeRHK7NdDyestKecWr0RS4le9FmvogBkuoCiMbMBrv+e0J9/A1X3txVXI+s6Zi72TwO6GqBAJx0bYRvAdKp3L9N2hcnd+P7NCnDKpb+hxc8+WeFkJcwtnqIupUVhw=\nripple-signature-timestamp<span class=\"token operator\">:</span> <span class=\"token number\">2025</span><span class=\"token number\">-05</span>-30T10<span class=\"token operator\">:</span><span class=\"token number\">21</span><span class=\"token operator\">:</span><span class=\"token number\">21</span>.808586489Z</code></pre></div>\n      </div>\n</li>\n<li>\nCreate the hash of the request by concatenating the \n<code class=\"language-text\">ripple-signature-timestamp</code>\n value and the request \n<code class=\"language-text\">body</code>\n as a string separated by a period delimiter, for example:\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"2144722798561460200\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`2025-05-30T10:21:21.808586489Z.{&quot;id&quot;:&quot;4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9&quot;,&quot;eventType&quot;:&quot;PAYMENT_STATE_TRANSITION&quot;,&quot;eventVersion&quot;:1,&quot;eventData&quot;:{&quot;paymentId&quot;:&quot;5ce2c433-a96d-48d0-8857-02637a60abf4&quot;,&quot;expiresAt&quot;:&quot;2025-07-28T17:18:35.663Z&quot;,&quot;createdAt&quot;:&quot;2025-05-29T17:18:35.663Z&quot;,&quot;sourceCurrency&quot;:&quot;USD&quot;,&quot;sourceAmount&quot;:8,&quot;destinationCurrency&quot;:&quot;COP&quot;,&quot;payoutAmount&quot;:32538.81,&quot;paymentState&quot;:&quot;VALIDATING&quot;,&quot;beneficiaryToken&quot;:&quot;cb207125-73a7-4a94-8502-a7780f1cae78&quot;},&quot;createDate&quot;:&quot;2025-05-30T10:21:20.468Z&quot;}`, `2144722798561460200`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-2144722798561460200\">Copied!</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token number\">2025</span><span class=\"token number\">-05</span>-30T10<span class=\"token operator\">:</span><span class=\"token number\">21</span><span class=\"token operator\">:</span><span class=\"token number\">21</span>.808586489Z.<span class=\"token punctuation\">{</span><span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"4d3f90cf-b70f-5ff1-827a-f8aa9cf84ab9\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"eventType\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"PAYMENT_STATE_TRANSITION\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"eventVersion\"</span><span class=\"token operator\">:</span><span class=\"token number\">1</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"eventData\"</span><span class=\"token operator\">:</span><span class=\"token punctuation\">{</span><span class=\"token property\">\"paymentId\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"5ce2c433-a96d-48d0-8857-02637a60abf4\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"expiresAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-07-28T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"createdAt\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-29T17:18:35.663Z\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"sourceCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"USD\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"sourceAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">8</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"destinationCurrency\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"COP\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"payoutAmount\"</span><span class=\"token operator\">:</span><span class=\"token number\">32538.81</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"paymentState\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"VALIDATING\"</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"beneficiaryToken\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"cb207125-73a7-4a94-8502-a7780f1cae78\"</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span><span class=\"token property\">\"createDate\"</span><span class=\"token operator\">:</span><span class=\"token string\">\"2025-05-30T10:21:20.468Z\"</span><span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n</li>\n<li>\nDecrypt the signature value using Ripple's public key that you obtained from your Ripple liaison.\n</li>\n<li>\nCompare the hash values, that is, the decrypted signature and the hashed value you created.\n<p>If the values match, the webhook is authentic and hasn't been tampered with. Otherwise, if they don't match, you should reject the webhook.</p>\n</li>\n</ol>\n<div class=\"admonition admonition-success\"><div class=\"admonition-heading\"><h5><span class=\"admonition-icon\"><i></i></span>Tip</h5></div><div class=\"admonition-content\"><p>Additionally, you can calculate the difference between the current timestamp and the received timestamp to decide whether the difference is acceptable.</p></div></div>\n<h3 style=\"position:relative;\"><a href=\"#response-times-and-retry-behavior\" aria-label=\"response times and retry behavior permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"response-times-and-retry-behavior\"></div>Response times and retry behavior</h3>\n<p>If a webhook notification delivery fails, that is, when the client responds with any status code other than <code class=\"language-text\">2xx</code>, Ripple Payments Direct 2.0 will retry the notification up to 75 times (or 72 hours). The delay between retries is 30 seconds after the first failure and up to one hour after each subsequent failure.</p>\n<p>Retries and other network issues may cause duplicate notifications to be sent. For that case, Ripple recommends that you maintain a list for the duplicate notifications.</p>\n<div class=\"admonition admonition-warning\"><div class=\"admonition-heading\"><h5><span class=\"admonition-icon\"><i></i></span>Clarification</h5></div><div class=\"admonition-content\"><p>Delivery order is not guaranteed. Notifications may arrive out of sequence, especially if retries occur after downtime. Clients must design webhook handlers to handle out-of-order messages safely.</p></div></div>\n<div class=\"admonition admonition-success\"><div class=\"admonition-heading\"><h5><span class=\"admonition-icon\"><i></i></span>Alternative to webhooks</h5></div><div class=\"admonition-content\"><p>As an alternative to using webhooks to receive notifications from Ripple Payments about changes to the status of your Ripple payments, you can use the <code class=\"language-text\">POST /v2/payments/filter</code> operation to poll payments by <code class=\"language-text\">paymentStates</code> and other properties. For more information about this operation, see <a href=\"/payments-direct-2/api-docs/payments-direct-api/reference/#operation/searchPayments\">POST Search payments</a>.</p></div></div>","headings":[{"value":"Notification webhooks","depth":1},{"value":"Why use notification webhooks","depth":2},{"value":"Event types","depth":2},{"value":"Configuration and security","depth":2},{"value":"1. Register callback URL","depth":3},{"value":"2. Optional: Add Ripple IP addresses to your allowlist","depth":3},{"value":"3. Optional: Verify webhook signatures","depth":3},{"value":"Response times and retry behavior","depth":3}]},"contentItem":{"data":{"lastModified":"2025-11-13T00:24:58.000Z","enableToc":null,"disableLastModified":null,"tocMaxDepth":null,"requestLogin":false}},"siteConfig":{"enableToc":false,"disableLastModified":true,"tocMaxDepth":4}},"pageContext":{"matchPath":"","id":"12498b05-1619-544a-8f3d-7f4cd6141114__redocly content/api-docs/best-practices/notification-webhooks/","seo":{"title":"Notification webhooks","description":null,"image":"","keywords":null,"jsonLd":null,"lang":null,"siteUrl":null},"pageId":"api-docs/best-practices/notification-webhooks.md","pageBaseUrl":"/api-docs/best-practices/notification-webhooks","type":"markdown","toc":{"enable":true,"maxDepth":4,"headings":[{"depth":1,"value":"Notification webhooks","id":"notification-webhooks"},{"depth":2,"value":"Why use notification webhooks","id":"why-use-notification-webhooks"},{"depth":2,"value":"Event types","id":"event-types"},{"depth":2,"value":"Configuration and security","id":"configuration-and-security"},{"depth":3,"value":"1. Register callback URL","id":"1-register-callback-url"},{"depth":3,"value":"2. Optional: Add Ripple IP addresses to your allowlist","id":"2-optional-add-ripple-ip-addresses-to-your-allowlist"},{"depth":3,"value":"3. Optional: Verify webhook signatures","id":"3-optional-verify-webhook-signatures"},{"depth":3,"value":"Response times and retry behavior","id":"response-times-and-retry-behavior"}]},"data":{"title":""},"catalogInfo":null,"link":"/api-docs/best-practices/notification-webhooks/","sidebarName":"__root-sidebar__-data-69308394-sidebars.yaml","isLanding":false,"showPrevButton":null,"showNextButton":null,"apiVersions":null,"apiVersionId":null,"isDefaultApiVersion":null}},"staticQueryHashes":["1123603147","1302185487","1344209882","1398840060","1520077861","1975142765","2667623876","2950305614","3240152602","3743992808","561138138"]}