Operation

POST /deeplinks/generate

Two-step flow: omit `network` to discover the affiliate networks available for the URL's merchant; supply `network` to generate a tracked affiliate link. `network` also acts as a safety check — if the network detected from the URL differs from the supplied value, the API returns `NETWORK_MISMATCH`. Available to admins or to paid publishers that have enabled the link generator.

Operation ID: generateDeeplink · Tags: Deeplinks

Parameters

This operation does not define any parameters.

Request Body

Required: Yes
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Destination URL (must use http or https)"
          },
          "network": {
            "type": "string",
            "enum": [
              "awin",
              "avantlink",
              "cj",
              "connexity",
              "flexoffers",
              "impact",
              "partnerize",
              "pepperjam",
              "skimlinks"
            ],
            "description": "Optional. When omitted, the response lists available networks for the URL. When supplied, the API generates a deeplink and verifies the URL belongs to that network."
          },
          "custom_code": {
            "type": "string",
            "maxLength": 50,
            "description": "Optional short code for the generated link"
          },
          "program_id": {
            "type": "integer",
            "description": "Optional advertiser/program id to scope generation"
          }
        },
        "required": [
          "url"
        ]
      },
      "examples": {
        "list_networks": {
          "summary": "List available networks for a URL",
          "value": {
            "url": "https://www.aloyoga.com/products/warrior-leggings"
          }
        },
        "generate": {
          "summary": "Generate a deeplink for a specific network",
          "value": {
            "url": "https://www.aloyoga.com/products/warrior-leggings",
            "network": "awin"
          }
        },
        "with_program": {
          "summary": "Scoped to a specific advertiser program",
          "value": {
            "url": "https://www.aloyoga.com/products/warrior-leggings",
            "program_id": 1234,
            "network": "awin"
          }
        }
      }
    }
  }
}

Responses

Content Types

  • application/json
{
  "description": "Deeplink generated, or — when `network` is omitted — list of available networks for the URL.",
  "content": {
    "application/json": {
      "schema": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/DeeplinkGenerated"
          },
          {
            "$ref": "#/components/schemas/DeeplinkNetworks"
          }
        ]
      }
    }
  }
}

{
  "$ref": "#/components/responses/BadRequest"
}

{
  "$ref": "#/components/responses/Unauthorized"
}

{
  "$ref": "#/components/responses/Forbidden"
}

Content Types

  • application/json
{
  "description": "Program not found (when `program_id` is supplied)",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/Error"
      }
    }
  }
}

Content Types

  • application/json
{
  "description": "Validation or generation error. Possible `error.code` values include `VALIDATION_ERROR`, `GENERATION_FAILED`, `UNSUPPORTED_NETWORK`, and `NETWORK_MISMATCH`.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/Error"
      }
    }
  }
}

API Playground

The in-page tester only supports GET. For POST, use the sample curl below or the dedicated resource docs (e.g. Contacts, Link Builder). Sign in to enable live testing with your API key.

Action Method Endpoint Description
Generate an affiliate deeplink or list networks for a URL POST /api/v1/deeplinks/generate OpenAPI operationId: generateDeeplink.

Example request (replace YOUR_API_KEY or sign in above):

curl -X POST "https://app.hienergy.ai/api/v1/deeplinks/generate" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Accept: application/json"
  -H "Content-Type: application/json" \
  -d '{}'
Ask Dex AIIntegration help

If this page feels TLDR, ask Dex AI.

Dex AI speaks your language, and all the other languages you may not. It will write the integration for you with the right endpoint and headers in one plain-English answer.