> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onsleek.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Deals API Migration Guide

This guide outlines the necessary changes to migrate from the deprecated `*.onsleek.io` API endpoints to the new `*.onsleek.ai` endpoints for cashback offers, coupons, promotions, and transactions.

The migration primarily involves:

* **Changing the base API URL**\
  All requests should now use `https://api.onsleek.ai/` instead of `https://api.onsleek.io/`.

* **Adding a `/deals/` prefix to all endpoints**\
  Endpoints for cashback offers, coupons, promotions, and transactions are now grouped under the `/v1/deals/` namespace.\
  For example, `/v1/cashback-offers/` becomes `/v1/deals/cashback-offers/`.

* **Switching activation ID from query parameter to path parameter**\
  Activation endpoints no longer use query parameters like `?couponId=abc123`.\
  Instead, IDs are passed directly in the path: `/v1/deals/coupons/{id}/activate`.

* **Preserving GET activation behavior**\
  `GET` activation endpoints still perform a `302` redirect to the affiliate URL.\
  There is no change in behavior, only the URL format has changed.

* **Updating POST activation response structure**\
  `POST` activation endpoints still return the affiliate URL, but instead of a plain string,\
  the response is now a JSON object:\
  `{ "url": "https://affiliate.example.com" }`

<Warning>
  **`*.onsleek.io` endpoints will be deprecated**

  All `https://api.onsleek.io/` endpoints will no longer be supported starting **June 1, 2025**.

  Please migrate to `https://api.onsleek.ai/` and update your integrations accordingly before this date.
</Warning>

***

## TL;DR

* ✅ Update your base URL to `https://api.onsleek.ai/`
* ✅ Use `{id}` in the path for activation endpoints instead of query parameters
* ✅ All deal endpoints now live under `/v1/deals/...`
* ✅ Activation behavior (`POST` + `302` redirect) remains the same

***

## Cashback Offers

| Method | Old Endpoint                                                  | New Endpoint                                        |
| ------ | ------------------------------------------------------------- | --------------------------------------------------- |
| `GET`  | `/v1/cashback-offers/activate?cashbackOfferId={id}&orgId=...` | `/v1/deals/cashback-offers/{id}/activate?orgId=...` |
| `POST` | `/v1/cashback-offers/activate?cashbackOfferId={id}&orgId=...` | `/v1/deals/cashback-offers/{id}/activate?orgId=...` |
| `GET`  | `/v1/cashback-offers/`                                        | `/v1/deals/cashback-offers/`                        |
| `GET`  | `/v1/cashback-offers/{id}`                                    | `/v1/deals/cashback-offers/{id}`                    |

<Check>
  **Change 1**: Activation endpoints now use a path param `{id}` instead of the `cashbackOfferId` query param.
</Check>

<Check>
  **Change 2**: The new activation endpoints are under `/deals/`.
</Check>

<Check>
  **Change 3**: `GET` activation endpoint triggers a 302 redirect (same behavior), but `POST` now returns a structured JSON response: `{ url: string }` (previously a raw string).
</Check>

**Activation Modes:**

* `GET`: 302 redirect to affiliate URL
* `POST`: Returns `{ url: "https://..." }`

**API Reference:**

* [Get Cashback Offers](/api-reference/cashback-offers/get-cashback-offers)
* [Get Cashback Offer by ID](/api-reference/cashback-offers/get-cashback-offer-by-id)
* [Activate Cashback Offer (Redirect)](/api-reference/cashback-offers/activate-cashback-offer-&-redirect)
* [Activate Cashback Offer (JSON)](/api-reference/cashback-offers/activate-cashback-offer)

***

## Coupons

| Method | Old Endpoint                                   | New Endpoint                                |
| ------ | ---------------------------------------------- | ------------------------------------------- |
| `GET`  | `/v1/coupons/activate?couponId={id}&orgId=...` | `/v1/deals/coupons/{id}/activate?orgId=...` |
| `POST` | `/v1/coupons/activate?couponId={id}&orgId=...` | `/v1/deals/coupons/{id}/activate?orgId=...` |
| `GET`  | `/v1/coupons/`                                 | `/v1/deals/coupons/`                        |
| `GET`  | `/v1/coupons/{id}`                             | `/v1/deals/coupons/{id}`                    |

<Check>
  **Change 4**: Activation endpoints now use a path param `{id}` instead of the `couponId` query param.
</Check>

<Check>
  **Change 5**: The new activation endpoints are under `/deals/`.
</Check>

<Check>
  **Change 6**: `GET` activation endpoint triggers a 302 redirect (same behavior), but `POST` now returns a structured JSON response: `{ url: string }` (previously a raw string).
</Check>

**Activation Modes:**

* `GET`: 302 redirect to affiliate URL
* `POST`: Returns `{ url: "https://..." }`

**API Reference:**

* [Get Coupons](/api-reference/coupons/get-coupon-offers)
* [Get Coupon by ID](/api-reference/coupons/get-coupon-by-id)
* [Activate Coupon (Redirect)](/api-reference/coupons/activate-coupon-offer-&-redirect)
* [Activate Coupon (JSON)](/api-reference/coupons/activate-coupon-offer)

***

## Promotions

| Method | Old Endpoint                                         | New Endpoint                                   |
| ------ | ---------------------------------------------------- | ---------------------------------------------- |
| `GET`  | `/v1/promotions/activate?promotionId={id}&orgId=...` | `/v1/deals/promotions/{id}/activate?orgId=...` |
| `POST` | `/v1/promotions/activate?promotionId={id}&orgId=...` | `/v1/deals/promotions/{id}/activate?orgId=...` |
| `GET`  | `/v1/promotions/`                                    | `/v1/deals/promotions/`                        |
| `GET`  | `/v1/promotions/{id}`                                | `/v1/deals/promotions/{id}`                    |

<Check>
  **Change 7**: Activation endpoints now use a path param `{id}` instead of the `promotionId` query param.
</Check>

<Check>
  **Change 8**: The new activation endpoints are under `/deals/`.
</Check>

<Check>
  **Change 9**: `GET` activation endpoint triggers a 302 redirect (same behavior), but `POST` now returns a structured JSON response: `{ url: string }` (previously a raw string).
</Check>

**Activation Modes:**

* `GET`: 302 redirect to affiliate URL
* `POST`: Returns `{ url: "https://..." }`

**API Reference:**

* [Get Promotions](/api-reference/promotions/get-promotion-offers)
* [Get Promotion by ID](/api-reference/promotions/get-promotion-by-id)
* [Activate Promotion (Redirect)](/api-reference/promotions/activate-promotion-offer-&-redirect)
* [Activate Promotion (JSON)](/api-reference/promotions/activate-promotion-offer)

***

## Transactions

| Method | Old Endpoint        | New Endpoint              |
| ------ | ------------------- | ------------------------- |
| `GET`  | `/v1/transactions/` | `/v1/deals/transactions/` |

<Check>
  **Change 10**: Transactions endpoint is now namespaced under `/deals/`.
</Check>

**API Reference:**

* [Get Transactions](/api-reference/transactions/get-transactions)
