### Install Postback - iOS and Android (Awin Live Example) Source: https://developer.awin.com/docs/singular A live example of an install postback URL for Awin, demonstrating actual values for merchant ID, reference, parts, and checksums for tracking installs. ```plaintext /sread.php?tt=ns&tv=2&type=ai&merchant=17634&amount=1&ref=fdb7f765dde1ac0ae23023f9389053e45cc178d0&parts=iOS_INSTALL:1&cks=17634_1712341671_caa46a9dd8fcc9c30e25b82809a3689d&p30=singular&ch=aw&re-engagement=0 ``` -------------------------------- ### Install Postback - iOS and Android (Template) Source: https://developer.awin.com/docs/singular A template for an install postback URL used for both iOS and Android. It includes placeholders for merchant ID, device installation status, and other tracking parameters. ```plaintext /sread.php?tt=ns&tv=2&type=ai&merchant={Merchant_ID}&amount=1&ref={TIMESTAMP}3&parts={DEVICE_INSTALL}:1&cks={coalesce,(awc),(cks)}&ch=aw&p=singular&re-engagement=1 ``` -------------------------------- ### In-app Postback (Awin Live Example) Source: https://developer.awin.com/docs/singular A live example of an in-app postback URL for Awin, showing concrete values for transaction amount, reference, currency, and checksums for tracking in-app sales. ```plaintext /sread.php?tt=ns&tv=2&type=ap&merchant=17634&amount=89.89&ref=54489364&parts=INAPP-SALE:89.89&cks=17634_1715712831_47e7a6cb689241c2660d93199bf22d3a&p1=3040f5a806d7948e657c8d8561c90a22&ch=aw&cr=BRL&p30=singular ``` -------------------------------- ### Example Tracking Link for Attribution Source: https://developer.awin.com/docs/singular This is an example of a tracking link generated for attribution settings. It includes placeholders for various parameters like advertiser ID, company name, and affiliate ID. ```plaintext https://posthaus.sng.link/Adch7/t46t?_dl=posthaus%3A%2F%2Fposthaus.com.br%2F&_smtype=3&pcid=!!!id!!!&cl=!!!awc!!!&psn=!!!companyname!!!&psid=!!!affid!!!&pcrid=!!!linkid!!! ``` -------------------------------- ### Get Link Builder Quota API Request Example Source: https://developer.awin.com/apidocs/quota This example demonstrates how to make a GET request to the Link Builder Quota API. It includes the necessary endpoint, header, and query parameters to authenticate and specify the publisher. ```HTTP GET /publishers/{publisherId}/linkbuilder/quota Host: api.awin.com Authorization: Bearer YOUR_ACCESS_TOKEN accessToken: YOUR_ACCESS_TOKEN ``` -------------------------------- ### Example HTML Product Level Tracking Declaration Source: https://developer.awin.com/docs/product-level-tracking-2 This example demonstrates a fully populated HTML form for Product Level Tracking, including two product rows. It shows how to format the data within the textarea according to the specified requirements, with each product row correctly delimited. ```html
``` -------------------------------- ### HTML Image Pixel with Multiple Products Example Source: https://developer.awin.com/docs/product-level-tracking-2 This is an example of an HTML `` tag used for an Awin conversion pixel, demonstrating how to include multiple products using the 'bd' parameter. It includes sample data for advertiser ID, order reference, and product details. ```html ``` -------------------------------- ### Get Transactions List (JavaScript Example) Source: https://developer.awin.com/apidocs/returns-a-list-of-transactions-for-a-given-advertiser Example demonstrating how to fetch transaction data using JavaScript's `fetch` API. It includes setting the Authorization header and constructing the query parameters for filtering transactions. ```javascript async function getTransactions(advertiserId, accessToken, startDate, endDate) { const url = `https://api.example.com/advertisers/${advertiserId}/transactions`; const params = new URLSearchParams({ accessToken: accessToken, startDate: startDate, endDate: endDate, dateType: 'transaction', publisherId: '12345', status: 'approved', showBasketProducts: 'true' }); try { const response = await fetch(`${url}?${params}`, { method: 'GET', headers: { 'Authorization': `Bearer ${accessToken}` } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); console.log(data); return data; } catch (error) { console.error('Error fetching transactions:', error); } } // Example usage: // getTransactions('123456', 'YOUR_ACCESS_TOKEN', '2021-01-01T12:00:00Z', '2021-03-15T01:59:59Z'); ``` -------------------------------- ### Multiple Product Tracking Example (Fallback & S2S) Source: https://developer.awin.com/docs/product-level-tracking-2 This example demonstrates how to track multiple products within a single pixel request by sequentially numbering the 'bd' parameters (e.g., bd[0], bd[1], bd[2]). It also includes custom parameters. ```text &bd[0]=AW:P|{{advertiserId}}|{{orderReference}}|{{productId}}|{{productName}}|{{productItemPrice}}|{{productQuantity}}|{{productSku}}|{{commissionGroupCode}}|{{productCategory}}&bd[1]=AW:P|{{advertiserId}}|{{orderReference}}|{{productId}}|{{productName}}|{{productItemPrice}}|{{productQuantity}}|{{productSku}}|{{commissionGroupCode}}|{{productCategory}}&bd[2]=AW:P|{{advertiserId}}|{{orderReference}}|{{productId}}|{{productName}}|{{productItemPrice}}|{{productQuantity}}|{{productSku}}|{{commissionGroupCode}}|{{productCategory}}&p1={{customParameter1}}&p2={{customParameter2}} ``` -------------------------------- ### Install Awin Magento Extension via Command Line Source: https://developer.awin.com/docs/magento This snippet details the command-line steps required to install the Awin Magento extension. It includes enabling maintenance mode, downloading the extension using Composer, enabling the module, upgrading setup, compiling code, flushing cache, and disabling maintenance mode. Ensure you replace the version number with your downloaded version. ```bash cd stack/magento sudo bin/magento-cli maintenance:enable sudo composer require awin/module-advertisertracking:1.3.3 sudo bin/magento-cli module:enable Awin_AdvertiserTracking_ sudo bin/magento-cli setup:upgrade sudo bin/magento-cli setup:di:compile sudo bin/magento-cli cache:flush sudo bin/magento-cli maintenance:disable ``` -------------------------------- ### Install-Based Tracking Setup Source: https://developer.awin.com/docs/button Instructions for setting up install-based tracking using Awin and Button, including commission group setup and tracking URL parameters. ```APIDOC ## Install-Based Tracking ### Description This section details how to set up install-based tracking between Awin and Button. It includes the necessary commission group setup on Awin and the structure of the tracking URL. ### Method N/A (Configuration and URL construction) ### Endpoint N/A ### Parameters #### Request Body - **& type=ai** (string) - Required - Appended to tracking calls to identify install-based activity. - **& ref={GPS_ADID}** (string) - Required - Placeholder for the GPS Advertiser ID. ### Request Example ``` https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=6091&ch=aw&testmode=0&amount=19.99&parts=APP_INSTALL:1.00&ref={GPS_ADID}&cr=GBP&cks=3797_1535473580_501804673273d9b1926be9dcd560e9f1&type=ai ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Install Postback URL for Awin Source: https://developer.awin.com/branch This is a sample URL for an install postback that should be configured in the Branch dashboard. It includes parameters for merchant ID, timestamp, installation details, click ID, and operating system. ```url https://www.awin1.com/sread.php?tt=ss&tv=2&type=ai&merchant=${(ad_network.credentials.awin_advertiser_id)!}& amount=1&ref=${(timestamp)!}&parts=INSTALL:1&testmode=0&cks=${(last_attributed_touch_data.~click_id)!}& p1=${(user_data.os)!} ``` -------------------------------- ### Example Product Level Tracking Request URLs Source: https://developer.awin.com/docs/product-level-tracking-2 These are example tracking request URLs generated when Product Level Tracking is correctly implemented along with the MasterTag and Conversion Tag. The `product_line` parameter contains the URL-encoded PLT data, showing how the product information is transmitted. ```url https://www.awin1.com/basket.php?product_line=AW%3AP%7C1001%7CAA000006%7CB000EMSUQA%7CThe%20Knife%20-%20Silent%20Shout%7C5.55%7C2%7CB000EMSUQA%7CCD%7CElectronic%20Music ``` ```url https://www.awin1.com/basket.php?product_line=AW%3AP%7C1001%7CAA000006%7CB001N2Z41Y%7CSigur%20Ros%20-%20Heima%7C14.99%7C1%7CB001N2Z41Y%7CDVD%7CMusic%20DVD ``` -------------------------------- ### Install Postback Template Source: https://developer.awin.com/docs/kochava Template for the install postback URL used in Kochava. ```APIDOC ## Postback details and commission groups ### Install ``` https://www.awin1.com/sread.php?tt=ss&tv=2&merchant={awin.merchant_id}&amount=1&ch=aw&ref={kochava_device_id}&parts=INSTALL_{platform}:1&cks={click_id}&testmode=0&type=ai&p1={platform}&p2={os_version}&p3={device_type}&p4={country}&p30=kochava ``` ``` -------------------------------- ### Example Tracking Requests - HTTP Source: https://developer.awin.com/conversion-tag These are example tracking requests that are generated and sent to Awin when the Conversion Tag and MasterTag are implemented correctly. The structure and domain of these requests may vary based on the advertiser program's setup. ```http https://www.awin1.com/sread.php?a=1001&b=8.33&cr=GBP&c=AA000001&d=DEFAULT:8.33&vc=&t=0&ch=aw&cks=1001_1403695822_a430d81e22c9e8687f423efcf024fbaa&l=https%3A//advertiser-domain.com/confirmation.php&tv=2&tt=ia https://www.awin1.com/sread.js?a=1001&b=8.33&cr=GBP&c=AA000001&d=DEFAULT:8.33&vc=&t=0&ch=aw&cks=1001_1403695822_a430d81e22c9e8687f423efcf024fbaa&l=https%3A//advertiser-domain.com/confirmation.php&tv=2&tt=js https://www.awin1.com/sread.php?a=1001&b=8.33&cr=GBP&c=AA000001&d=DEFAULT%3A8.33&vc=&t=0&cks=1001_1403695822_a430d81e22c9e8687f423efcf024fbaa&atp=&tv=2&tt=et&l=https%3A%2F%2Fwww.advertiser-domain.com%2Fconfirmation.php&ch=aw https://www.awin1.com/alt.php?mid=1001&gv=1&a=1001&b=8.33&cr=EUR&c=AA000001&d=DEFAULT:8.33&vc=&t=0&ch=aw&l=https%3A//www.advertiser-domain.com%2Fconfirmation.php https://www.awin1.com/m/1001.gif ``` -------------------------------- ### Sale-Based Tracking Setup Source: https://developer.awin.com/docs/button Instructions for setting up sale-based tracking using Awin and Button, including commission group setup and tracking URL parameters. ```APIDOC ## Sale-Based Tracking ### Description This section details how to set up sale-based tracking between Awin and Button. It includes the necessary commission group setup on Awin and the structure of the tracking URL. ### Method N/A (Configuration and URL construction) ### Endpoint N/A ### Parameters #### Request Body - **& type=ap** (string) - Required - Appended to tracking calls to identify 'In App' activity. ### Request Example ``` https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=6091&ch=aw&testmode=0&amount=19.99&parts=APP_DEFAULT:19.99&ref=383028169256&cr=GBP&cks=3797_1535473580_501804673273d9b1926be9dcd560e9f1&type=ap ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Install Postback Source: https://developer.awin.com/adjust This postback URL is used to track app installs. It includes parameters for merchant code, reference ID, and Awin click ID. ```APIDOC ## Install Postback ### Description This endpoint tracks app installs via a postback URL. ### Method GET ### Endpoint `https://www.awin1.com/sread.php` ### Query Parameters - **tt** (string) - Required - Tracking tag parameter. - **tv** (string) - Required - Tracking version parameter. - **type** (string) - Required - 'ai' for app install. - **merchant** (string) - Required - Your Awin program code. - **amount** (string) - Required - Set to '1' for installs. - **ref** (string) - Required - Reference ID (e.g.,adid). - **parts** (string) - Required - Install CID and value (e.g., `{installCID}:1`). - **testmode** (string) - Required - '0' for live, '1' for test. - **cks** (string) - Required - Awin click ID (e.g., `{{awin_click_id}}`). - **p1** (string) - Optional - Additional parameter (e.g., `{adid}`). - **p2** (string) - Optional - Additional parameter (e.g., `{os_name}`). - **p30** (string) - Optional - Additional parameter (e.g., `adjust`). ### Request Example ``` https://www.awin1.com/sread.php?tt=ss&tv=2&type=ai&merchant={{awin_program_code}}&amount=1&ref={adid}&parts={installCID}:1&testmode=0&cks={{awin_click_id}}&p1={adid}&p2={os_name}&p30=adjust ``` ### Response #### Success Response (200) - **Status** (string) - Indicates successful tracking. ``` -------------------------------- ### Mobile Prefix Configuration Example Source: https://developer.awin.com/docs/kochava Example of configuring a Kochava tracking URL as a mobile prefix for app tracking. ```APIDOC ## Mobile prefix configuration Kochava tracking URLs can be enabled as a mobile prefix (at the merchant or publisher level) for mobile traffic App tracking settings. **Mobile prefix example:** ``` https://smart.link/5d797f59f80d8?site_id=!!!id!!!&creative_id=!!!linkid!!!&click_id=!!!awc!!!&destination=!!!redirectURL!!!&deeplink=!!!redirectURL ``` ``` -------------------------------- ### Enable and Configure Awin Extension (Magento) Source: https://developer.awin.com/magento These commands enable the Awin extension, upgrade the Magento setup, compile dependency injection, and flush the cache. After these steps, the extension needs to be enabled and configured in the Magento admin panel with your Advertiser ID. ```bash sudo bin/magento-cli module:enable Awin_AdvertiserTracking_ ``` ```bash sudo bin/magento-cli setup:upgrade ``` ```bash sudo bin/magento-cli setup:di:compile ``` ```bash sudo bin/magento-cli cache:flush ``` -------------------------------- ### Awin Install Postback URL Source: https://developer.awin.com/adjust This URL is used to track app installations via Awin. It includes parameters such as merchant program code, amount, unique click ID, and device information. ```url https://www.awin1.com/sread.php?tt=ss&tv=2&type=ai&merchant={{awin_program_code}}&amount=1&ref={adid}&parts={installCID}:1&testmode=0&cks={{awin_click_id}}&p1={adid}&p2={os_name}&p30=adjust ``` -------------------------------- ### Install Awin Extension using Composer (Magento) Source: https://developer.awin.com/magento This command downloads and installs the Awin advertiser tracking module using Composer. Ensure you replace the version number with the one you downloaded. This is a required step for integrating Awin tracking into your Magento store. ```bash sudo composer require awin/module-advertisertracking:1.3.3 ``` -------------------------------- ### Obtaining Your API Token Source: https://developer.awin.com/apidocs/api-authentication Provides a step-by-step guide on how to obtain your personal API token from the Awin interface, including prerequisites and the process of generating the token. ```APIDOC ## Obtaining Your API Token Tokens are set at a user level, granting access to API data from all associated Publisher or Advertiser accounts. Obtaining an API token does not require a username or password, so keep your token confidential. If you need to revoke your token, follow the instructions provided elsewhere. ### Step 1 - Check Permissions Before creating a token, ensure you have Admin access to the relevant account. * **For Advertisers**: Navigate to _Account > Account Permissions_. * **For Publishers**: Navigate to _Account > User Permissions_. If you lack the necessary permissions, request your administrator to invite you or update your access level. Changes in account access may take up to 10 minutes to take effect. ### Step 2 - Create Token 1. Visit [https://ui.awin.com/awin-api](https://ui.awin.com/awin-api) or click the "API Credentials" link in your user menu (top right). 2. On the "API Credentials" page, enter your website login password and click "Show my API token". 3. Your personal API token will be generated and displayed, ready to be copied. ``` -------------------------------- ### AWIN Conversion and MasterTag Tracking Request Examples - HTTP Source: https://developer.awin.com/docs/conversion-tag These examples showcase the structure of tracking requests generated by the AWIN Conversion Tag and MasterTag. They illustrate various endpoints and parameters used for sending conversion data, including examples with different tracking domains and parameters. ```http https://www.awin1.com/sread.php?a=1001&b=8.33&cr=GBP&c=AA000001&d=DEFAULT:8.33&vc=&t=0&ch=aw&cks=1001_1403695822_a430d81e22c9e8687f423efcf024fbaa&l=https%3A//advertiser-domain.com/confirmation.php&tv=2&tt=ia https://www.awin1.com/sread.js?a=1001&b=8.33&cr=GBP&c=AA000001&d=DEFAULT:8.33&vc=&t=0&cks=1001_1403695822_a430d81e22c9e8687f423efcf024fbaa&l=https%3A//advertiser-domain.com/confirmation.php&tv=2&tt=js https://www.awin1.com/sread.php?a=1001&b=8.33&cr=GBP&c=AA000001&d=DEFAULT%3A8.33&vc=&t=0&cks=1001_1403695822_a430d81e22c9e8687f423efcf024fbaa&atp=&tv=2&tt=et&l=https%3A%2F%2Fwww.advertiser-domain.com%2Fconfirmation.php&ch=aw https://www.awin1.com/alt.php?mid=1001&gv=1&a=1001&b=8.33&cr=EUR&c=AA000001&d=DEFAULT:8.33&vc=&t=0&ch=aw&l=https%3A//www.advertiser-domain.com%2Fconfirmation.php https://www.awin1.com/m/1001.gif ``` -------------------------------- ### S2S API Example Response Source: https://developer.awin.com/apidocs/conversion-api This is an example response from the S2S API, detailing successful and failed orders. ```APIDOC ## GET /websites/developer_awin ### Description This endpoint provides an example response from the S2S API, illustrating the structure of successful and failed order data. ### Method GET ### Endpoint /websites/developer_awin ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **batchId** (string) - Unique identifier for each transaction. - **correlationId** (string) - Unique identifier for each order inside the transaction. - **successfulOrders** (array) - An array of successfully processed orders. - **failedOrders** (array) - An array of failed orders with error details. #### Response Example ```json { "message": "", "batchId": "1111-1692271186-8274157a-bd07-4b7a-a8d4-ddb21e741d11", "successfulOrders": [ { "orderReference": "#1100011", "amount": 10, "channel": "aw", "currency": "GBP", "voucher": "10_OFF", "isTest": false, "awc": "1111_xxx_xxx", "customerAcquisition": "NEW", "commissionGroups": [ { "code": "DEFAULT", "amount": 1.2 } ], "custom": { "1": "s2sAPI" }, "basket": [ { "id": "125", "name": "Fish", "price": 10, "quantity": 1, "commissionGroupCode": "DEFAULT", "category": "Food", "sku": "11111" } ], "advertiserId": 1111, "correlationId": "e653481f-94d6-497d-8279-8c925b3a1cc8" } ], "failedOrders": [ { "order": { "orderReference": "#1100012", "amount": "123", "channel": "aw", "currency": "GBP", "voucher": "10_OFF", "isTest": false, "awc": "1111_xxx_xxx", "customerAcquisition": "NEW", "commissionGroups": [ { "code": "DEFAULT", "amount": 1 } ], "custom": { "1": "s2sAPI" }, "basket": [ { "id": "", "name": "", "price": 20, "quantity": 1, "commissionGroupCode": "DEFAULT", "category": "", "sku": "" } ], "advertiserId": 1111, "correlationId": "55d2ee39-eae1-440c-a3ff-bc2fba496c8f" }, "errors": [ { "field":"amount", "message":"Property 'amount' must be of type 'number'" } ] } ] } ``` ``` -------------------------------- ### Get Transactions List (cURL Example) Source: https://developer.awin.com/apidocs/returns-a-list-of-transactions-for-a-given-advertiser Example of how to make a GET request to retrieve a list of transactions using cURL. This demonstrates the required parameters like accessToken, advertiserId, startDate, and endDate, along with optional parameters like dateType and status. ```bash curl -X GET "https://api.example.com/advertisers/{advertiserId}/transactions?accessToken=YOUR_ACCESS_TOKEN&startDate=2021-01-01T12:00:00Z&endDate=2021-03-15T01:59:59Z&dateType=transaction&publisherId=12345&status=approved&showBasketProducts=true" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Shopware 5 Awin Tracking Extension Installation Steps Source: https://developer.awin.com/shopware Outlines the steps to install the Awin tracking extension within the Shopware 5 administration panel. This includes uploading and activating the plugin, followed by configuration. ```text Step One : Open Plugin Manager Step Two : Go to Installed Plugins Step Three : Click Upload Plugin Step Four : Select and upload the Awin plugin Step Five : Click on Install in the lower pane Step Six : Activate the plugin Reset cache for immediate effect Step Seven : Configure the plugin with your Awin Advertiser/Merchant ID Step Eight : Close Awin Plugin configuration Step Nine : Plugin is now shown as installed in the upper pane ``` -------------------------------- ### Installment Payment Plan JSON Example Source: https://developer.awin.com/docs/enhanced-feeds-prod-spec This JSON snippet demonstrates the optional 'installment' field, providing details for an installment payment plan, including the number of months and the amount per installment. ```json { "installment":{ "months":6, "amount":"50 BRL" } } ``` -------------------------------- ### Product Availability and Pricing Examples Source: https://developer.awin.com/apidocs/retail-advertiser-productapidocumentation Examples demonstrating how to set product availability status, including 'in_stock', 'out_of_stock', 'preorder', and 'backorder'. It also shows how to specify prices, sale prices, and their effective dates. ```JSON { "availability": "in_stock", "availability_date": "2023-12-25T13:00-0800", "expiration_date": "2023-12-26T13:00-0800", "price": "15.00 GBP", "sale_price": "5.00 GBP", "sale_price_effective_date": "2022-02-24T13:00-0800/2022-03-29T15:30-0800" } ``` -------------------------------- ### Awin Image URL Structure Examples Source: https://developer.awin.com/awin-resize-and-caching-service Demonstrates the structure of Awin image URLs, including resizing and caching parameters. These examples show how to specify dimensions, background color, and image fitting options. ```url https://via.awin.com/images/merchant/12345/image.jpg?w=200&h=200 ``` ```url https://via.awin.com/images/merchant/12345/thumb.jpg?w=70&h=70&bg=000000 ``` ```url https://via.awin.com/images/merchant/12345/main.png?w=300&h=300&t=square&trim=50 ``` -------------------------------- ### Retrieve Enhanced Feed (Google Format) - Curl Example Source: https://developer.awin.com/apidocs/retail-publisher-productapidocumentation-1 Example of how to make a GET request to the Awin API to download an enhanced feed in Google Format using curl. This requires specifying the publisher ID, advertiser ID, vertical, and locale in the URL. ```bash curl -X 'GET' \ 'https://api.awin.com/publishers/12345/awinfeeds/download/6789-retail-en_GB.jsonl' \ ``` -------------------------------- ### Get Transactions by IDs (HTTP Request) Source: https://developer.awin.com/apidocs/returns-a-list-of-transactions-for-a-given-publisher-by-ids This snippet demonstrates how to make an HTTP GET request to the Awin API to retrieve transactions by their IDs. It includes example parameters for authentication, publisher ID, and transaction IDs. ```http GET https://api.awin.com/publishers/{publisherId}/transactions?ids=12345,67890&showBasketProducts=true&timezone=Europe/Berlin Header: Authorization: Bearer YOUR_ACCESS_TOKEN ``` -------------------------------- ### Kochava Integration Setup Source: https://developer.awin.com/docs/kochava Steps to enable Awin integration with Kochava, including essential parameters. ```APIDOC ## Integrating Kochava 1. **Enable Awin Integration**: Enter the **Awin Advertiser ID**. 2. **Order Reference**: Specify the parameter name from event metadata containing the Awin order reference. 3. **Commission Group Code**: Enter the parameter name from event metadata for the Awin commission group code. Alternatively, input a static commission group code. 4. **Voucher Code**: Specify the parameter name from event metadata containing the Awin voucher code. ``` -------------------------------- ### Magento Maintenance Mode Commands Source: https://developer.awin.com/magento These commands are used to enable and disable maintenance mode for your Magento store during extension installation and configuration. It's crucial to enable maintenance mode before starting the installation process and disable it once completed. ```bash sudo bin/magento-cli maintenance:enable ``` ```bash sudo bin/magento-cli maintenance:disable ``` -------------------------------- ### API Request: Get Accounts (Conceptual) Source: https://developer.awin.com/apidocs/returns-information-about-accounts-for-a-given-user This is a conceptual example of how to call the 'GET accounts' API endpoint. It demonstrates the basic structure of the request, including the endpoint URL and the necessary 'accessToken' query parameter. The 'type' parameter can be used to filter results by advertiser or publisher. ```http GET /accounts?accessToken={YOUR_ACCESS_TOKEN}&type=advertiser HTTP/1.1 Host: api.awin.com Accept: application/json ``` -------------------------------- ### Installment Payment Plan Source: https://developer.awin.com/apidocs/retail-publisher-productapidocumentation-1 Defines an installment payment plan for a product, specifying the number of months ('months') and the amount per month ('amount') in ISO 4217 currency. ```json { "installment": { "months": 6, "amount": "50 BRL" } } ``` -------------------------------- ### Single Offer Upload Example (JSON) Source: https://developer.awin.com/apidocs/offers-api This example demonstrates the JSON structure for uploading a single offer, which can be either a promotion or a voucher. It includes required fields like title, description, type, URL, dates, regions, and categories. Ensure numeric values for regions and categories are used as per the provided mapping. ```json { "title": "Example Promotion", "description": "Save 20% on selected items.", "terms": "Offer valid until stock lasts.", "type": "promotion", "url": "https://www.example.com/offer", "startDate": "2025-07-01", "endDate": "2025-07-31", "appliestoAllRegions": true, "regions": [], "promotionCategories": [1, 2] } ``` -------------------------------- ### Image Fit Parameter Examples (Awin Service) Source: https://developer.awin.com/awin-resize-and-caching-service Illustrates the use of the 't' parameter for image fitting in the Awin Image Resize and Caching Service. Each example shows a different fitting method and its effect on the image. ```url https://via.awin.com/images/merchant/12345/image.jpg?w=200&h=200&t=fit ``` ```url https://via.awin.com/images/merchant/12345/image.jpg?w=200&h=200&t=fitup ``` ```url https://via.awin.com/images/merchant/12345/image.jpg?w=200&h=200&t=square ``` ```url https://via.awin.com/images/merchant/12345/image.jpg?w=200&h=200&t=squaredown ``` ```url https://via.awin.com/images/merchant/12345/image.jpg?w=200&h=200&t=absolute ``` ```url https://via.awin.com/images/merchant/12345/image.jpg?w=200&h=200&t=letterbox&bg=FFFFFF ``` -------------------------------- ### Awin GET Request URL with Placeholders Source: https://developer.awin.com/docs/transaction-notifications An example of a GET request URL structure used by Awin for transaction tracking. It demonstrates the use of placeholders (macros) like !!!merchantId!!! and !!!transactionId!!! which are dynamically replaced by Awin with actual transaction data. These parameters are appended to the URL. ```URL http://www.publisher-domain.com/!!!merchantId!!!/pixel.php?clk=!!!clickRef!!!&cnv=!!!transactionId!!!&com=!!!commission!!! ``` -------------------------------- ### JSON Example: Apparel Size and System Source: https://developer.awin.com/apidocs/retail-advertiser-productapidocumentation Demonstrates how to specify apparel size and sizing system using JSON. Supports multiple size types and country-specific sizing systems. ```json { "size": "L", "size_type": [ "regular", "plus" ], "size_system": "UK" } ``` -------------------------------- ### Awin Install Postback URL Source: https://developer.awin.com/docs/kochava This URL is used for attributing install events within the Awin tracking system when integrated with Kochava. It includes parameters for merchant ID, click ID, platform, and other relevant data. Ensure Awin Advertiser ID, Order Reference, Commission Group Code, and Voucher Code are correctly configured. ```url https://www.awin1.com/sread.php?tt=ss&tv=2&merchant={awin.merchant_id}&amount=1&ch=aw&ref={kochava_device_id}&parts=INSTALL_{platform}:1&cks={click_id}&testmode=0&type=ai&p1={platform}&p2={os_version}&p3={device_type}&p4={country}&p30=kochava ``` -------------------------------- ### Multiple Commission Groups Transaction Example - JavaScript Source: https://developer.awin.com/docs/commission-groups This comprehensive JavaScript example shows a full transaction setup with multiple commission groups. It defines parameters like amount, currency, order reference, and specifies the 'parts' with different commission group codes and their respective amounts. ```JavaScript // ``` -------------------------------- ### Single Offer Upload Request (JSON) Source: https://developer.awin.com/v1-api/apidocs/offers-api Example of a JSON request body for uploading a single promotion offer via the Create Offers API. This demonstrates the structure and required fields for offer details. ```json { "title": "Black Friday 2025", "description": "Save 30% on all products this Black Friday.", "terms": "Offer valid until the end of the month.", "type": "promotion", "url": "https://www.exampleadvertiser.com/blackfriday", "startDate": "2025-11-28", "endDate": "2025-11-30", "appliestoAllRegions": true, "promotionCategories": [1, 5] } ``` -------------------------------- ### Advertiser Product Type Example Source: https://developer.awin.com/apidocs/retail-publisher-productapidocumentation-1 Defines an optional, advertiser-specific product category. It allows for a hierarchical categorization of products up to 750 characters. ```text "product_type":"Home > Women > Dresses > Maxi Dresses" ``` -------------------------------- ### Brand Name Example Source: https://developer.awin.com/apidocs/retail-publisher-productapidocumentation-1 Specifies the brand name of a product. This is required for new products and optional otherwise. It supports Unicode characters up to 70 characters. ```text "brand":"Google" ``` -------------------------------- ### POST /promotion/advertiser/{advertiser_id} Source: https://developer.awin.com/v1-api/apidocs/offers-api Allows advertisers to upload offers, including promotions and vouchers, directly to the MyOffers system. This endpoint supports uploading offers in batches, with a limit of 50 offers per minute. ```APIDOC ## POST /promotion/advertiser/{advertiser_id} ### Description This endpoint allows advertisers to upload offers, such as promotions and vouchers, to the MyOffers system. It supports batch uploads, but only one offer can be uploaded per request, with a rate limit of 50 offers per minute. ### Method POST ### Endpoint `https://api.awin.com/promotion/advertiser/{advertiser_id}` ### Parameters #### Path Parameters - **advertiser_id** (string) - Required - The ID of the advertiser account. #### Request Body - **title** (string) - Required - The title of the offer. Max 300 characters. - **description** (string) - Required - A description of the offer. Max 500 characters. - **terms** (string) - Required - Any terms and conditions applicable to the offer. Max 10000 characters. Required for 'voucher' type offers. - **type** (string) - Required - The type of offer, either 'promotion' or 'voucher'. - **voucherCode** (string) - Optional - The actual voucher code. Required if type is 'voucher'. - **url** (string) - Required - A specific landing page URL for publishers. Must start with http:// or https://. - **startDate** (string) - Required - The start date of the offer in YYYY-MM-DD format. - **endDate** (string) - Required - The end date of the offer in YYYY-MM-DD format. - **startTime** (string) - Optional - The start time of the offer in HH:MM:SS format. Defaults to 00:00:00 UTC. - **endTime** (string) - Optional - The end time of the offer in HH:MM:SS format. Defaults to 23:59:59 UTC. - **timeZone** (string) - Optional - The timezone for the offer. Defaults to UTC. - **campaign** (string) - Optional - The campaign the offer belongs to. - **appliestoAllRegions** (boolean) - Required - Set to true if the offer is applicable to all regions. - **regions** (array of numbers) - Required if `appliestoAllRegions` is false. A numeric array mapping to Awin regions. - **promotionCategories** (array of numbers) - Required. A numeric array mapping to promotion categories. ### Request Example ```json { "title": "Summer Sale 2025", "description": "Get up to 50% off on selected items.", "terms": "Offer valid until August 31st, 2025.", "type": "promotion", "url": "https://www.example.com/summer-sale", "startDate": "2025-06-01", "endDate": "2025-08-31", "appliestoAllRegions": true, "promotionCategories": [1, 5] } ``` ### Response #### Success Response (200) - **offerId** (string) - The ID of the created offer. #### Response Example ```json { "offerId": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ``` ``` -------------------------------- ### Google Product Category Example Source: https://developer.awin.com/apidocs/retail-publisher-productapidocumentation-1 Specifies the Google-defined product category for a product. This can be submitted as a numerical ID or a full category path. Currently, only English is supported. ```text "google_product_category":"Apparel & Accessories > Clothing > Dresses" or “2271” ``` -------------------------------- ### Authenticate with API Key (cURL, JavaScript) Source: https://developer.awin.com/apidocs/api-authentication This snippet shows how to authenticate API requests using an API Key. It includes examples for both cURL and JavaScript (Fetch API) to add the 'x-api-key' header. ```bash curl -X GET https://api.awin.com/public/data \ -H "x-api-key: 9e1f55b9-aaaa-47d3-98e8-f9dcba5f4b2b" ``` ```javascript fetch('https://api.awin.com/public/data', { headers: { 'x-api-key': '9e1f55b9-aaaa-47d3-98e8-f9dcba5f4b2b' } }) ``` -------------------------------- ### Create Offers API Source: https://developer.awin.com/apidocs/introduction-1 Create promotions and vouchers in bulk using the Create Offers API. ```APIDOC ## Create Offers API ### Description This API enables advertisers to create multiple promotions and vouchers in bulk. ### Use Case Bulk creation of promotions and vouchers. ### Note This API is available for Awin Accelerate and Advanced plans. ``` -------------------------------- ### Authenticate with Bearer Token (cURL, JavaScript) Source: https://developer.awin.com/apidocs/api-authentication This snippet demonstrates how to authenticate API requests using a Bearer Token. It shows the cURL command and a JavaScript fetch example for adding the 'Authorization' header. ```bash curl -X GET https://api.awin.com/publishers \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` ```javascript fetch('https://api.awin.com/publishers', { headers: { 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' } }) ``` -------------------------------- ### Create Offers API Source: https://developer.awin.com/apidocs Create promotions and vouchers in bulk using the Create Offers API. ```APIDOC ## POST /offers ### Description Create promotions and vouchers in bulk. ### Method POST ### Endpoint `/offers` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **offers** (array) - Required - An array of offers to create. - **type** (string) - Required - The type of offer ('promotion' or 'voucher'). - **title** (string) - Required - The title of the offer. - **description** (string) - Optional - A description of the offer. - **code** (string) - Required for vouchers - The voucher code. - **startDate** (string) - Optional - The start date of the offer (YYYY-MM-DD). - **endDate** (string) - Optional - The end date of the offer (YYYY-MM-DD). - **url** (string) - Required - The URL associated with the offer. ### Request Example ```json { "offers": [ { "type": "promotion", "title": "Summer Sale 20% Off", "description": "Get 20% off all summer items.", "startDate": "2025-06-01", "endDate": "2025-08-31", "url": "https://example.com/summer-sale" }, { "type": "voucher", "title": "10% Off First Order", "code": "WELCOME10", "endDate": "2025-12-31", "url": "https://example.com/new-customers" } ] } ``` ### Response #### Success Response (200) - **createdOffers** (array) - An array of created offer objects. - **id** (string) - The unique identifier of the created offer. - **title** (string) - The title of the created offer. #### Response Example ```json { "createdOffers": [ { "id": "offer_abc123", "title": "Summer Sale 20% Off" }, { "id": "voucher_xyz789", "title": "10% Off First Order" } ] } ``` ```