Redirect

πŸ“€ Success & Failure Redirect URLs

These are redirect URLs (not webhooks) that return the user to your website after an invoice-related action is completed.

  • βœ… Success redirect: Triggered when an invoice is successfully paid. The user is redirected to the configured successUrl.

  • ❌ Failure Redirect: Triggered when the invoice is canceled, rejected, expired, or if an error occurs. The user is redirected to the configured failureUrl.

πŸ”§ Configuration

To enable redirect functionality, the URLs must be defined in one of the following ways:

  • Merchant-level configuration: Set the successUrl and failureUrl fields in your merchant profile in the Thedex merchant settings.

    1. Sign in at app.thedex.cloud.

    2. After logging in, navigate to the "Merchants" section.

    3. Click the "Edit" button on your merchant.

    4. Fill in Success redirect Url or Failure redirect Url.

    5. Complete form.

  • Per-request configuration: If not set at the merchant level, you can specify successUrl and failureUrl directly in your API request when creating an invoice.

If both options are used, the values passed in the API request will override the merchant defaults

πŸ”„ Behavior

  • If the invoice was created via API: The user is redirected automatically to either the success or failure URL as soon as the invoice status is updated.

  • If the invoice was created via Thedex UI:

    The user must click a button (e.g., "Return to website") to initiate the redirect.

⚠️ Important: These URLs are intended for user redirection only. They are not intended for server-to-server communication or for receiving payment status updates. Use webhooks for backend notification and processing.

Last updated