> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developer.ordergroove.com/lifecycle/enrollment/affiliate-codes/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.ordergroove.com/_mcp/server. # Tracking Affiliate Codes on Recurring Orders Brands and retailers can track affiliate codes (and other similar data) on recurring orders by referencing the initial order that created the subscription. --- ## 1. Subscribe to Ordergroove Webhooks 1. Navigate to the Webhooks section of Ordergroove. 2. Enable the toggle by clicking it to **ON**. 3. In the URL field, enter the endpoint where you want all events to be sent. 4. Click **Save**. 5. Once saved, a verification key will populate in the **Verification Key** field. 6. Click **Copy** to copy the key to your clipboard. --- ## 2. Listen for the `item.successfully_placed` Event * This event fires for each item successfully placed with a recurring order. * Retrieve the subscription ID from the JSON payload that created the item. --- ## 3. Call the Subscriptions Retrieve REST API * Use the subscription ID from the previous step as the URL parameter in the request. * Retrieve the `merchant_order_id` that created the subscription. --- ## 4. Retrieve Relevant Affiliate Data Use the order ID from the previous step to retrieve the relevant affiliate data from your eCommerce platform. > APIs, SDKs, and guides for building subscription commerce with Ordergroove.