# Redirect Flow

Our platform provides URL redirection for both success and failure scenarios when sending the payload to our Apply endpoint. If the specific success and failure URLs are unknown at the time of payload creation, the `customer_redirect_url` can be used to dynamically apply a redirect URL.

To implement this, append the `customer_redirect_url` to the Bumper URL. This parameter must be encrypted for security, ensuring that only authorised parties can use it.

1. **Generate Signature for Redirect URL**:
   * Create a signature to verify the integrity and authenticity of the `redirect_url`.
   * **Hashing Algorithm**: Use SHA-256 to generate a hash of the `redirect_url`.
   * **Example Query String**:

     ```plaintext
     REDIRECT_URL=https://www.bumper.co/&
     ```
   * **Signature JSON Format**:

     <pre class="language-json" data-overflow="wrap"><code class="lang-json">{
         "signature": "&#x3C;SHA256-hash>",
         "redirect_url": "https://www.bumper.co/"
     }
     </code></pre>
   * **Example Signature JSON**:

     <pre class="language-json" data-overflow="wrap"><code class="lang-json">{
         "signature": "f13edc50d2df8729d84d5acd97b12298157014efca10139e494c5dd9be460910",
         "redirect_url": "https://www.bumper.co/"
     }
     </code></pre>
2. **Encrypt JSON Using AES-256 ECB Mode**:
   * **Encryption Method**: Encrypt the JSON data using AES-256 in ECB (Electronic Codebook) mode.
   * **Private Key**: The private key provided should be used as the AES encryption key.
   * **Encoding**: After encryption, encode the encrypted result in Base64 to create a URL-safe string.
   * **Example Encrypted Payload**:

     <pre class="language-plaintext" data-overflow="wrap"><code class="lang-plaintext">46/7doY5tAcsu1e4WD4sKDS9jimGATILIHaM0xFGnL3cREonrHuDqj4keuMCMVt7ApP2iz+3407nRoYF4jVJp3gSn9N+QcU/B7UBRmBVRzEwLOTEkRLn5Eq6LSARhVvd2L3rtL1SbnKXgXPdVeXmf6JuenZDFsQb3JZwlaSHOetfl95dZSOyhzjoU5jV1FcA
     </code></pre>
3. **Construct Final Bumper Redirect URL**:
   * Append the encrypted JSON payload to the `customer_redirect_url` parameter in the Bumper redirect URL.
   * **Example Bumper Redirect URL**:

     <pre class="language-plaintext" data-overflow="wrap"><code class="lang-plaintext">https://www.bumper.co/integration/01jc0nhp66yg85qphv371g5e30?customer_redirect_url=46/7doY5tAcsu1e4WD4sKDS9jimGATILIHaM0xFGnL3cREonrHuDqj4keuMCMVt7ApP2iz+3407nRoYF4jVJp3gSn9N+QcU/B7UBRmBVRzEwLOTEkRLn5Eq6LSARhVvd2L3rtL1SbnKXgXPdVeXmf6JuenZDFsQb3JZwlaSHOetfl95dZSOyhzjoU5jV1FcA
     </code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.bumper.co/bumper-api-documentation/redirect-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
