{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"Webhooks for affiliates","type":"basic","slug":"affiliates-for-affiliates-webhooks","excerpt":"How to use webhooks","body":"Webhooks can be configured to send data and notifications from your Attribution affiliates portal to other tools. \n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Webhook usage\",\n  \"body\": \"POST requests can be made for the following events:\\n1. A conversion event has been completed \\n2. A conversion has been approved and paid out\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Create your webhook\"\n}\n[/block]\nYou can create your webhook by navigating to the 'Profile' page within your affiliates portal. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/1d65514-unnamed_1.png\",\n        \"unnamed (1).png\",\n        2214,\n        1920,\n        \"#333\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Use a tool like https://webhook.site to see your payload\",\n  \"title\": \"Test your webhook\"\n}\n[/block]\n1. Add your webhook URL in the **'Webhook section'** \n2. Press **'save'** to send a test event \n\nTIP: Use a tool like https://webhook.site to see your payload\n\nPlease see the example request below: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\\"conversion_id\\\": \\\"c12345\\\",\\n\\\"landing_page_url\\\": \\\"https://example.com/landing-page\\\",\\n\\\"landing_page_visited_at\\\": \\\"2021-06-04T11:15:14.452Z\\\",\\n\\\"offer_name\\\": \\\"Test offer\\\",\\n\\\"offer_id\\\": \\\"o12345\\\",\\n\\\"project_name\\\": \\\"Test project\\\",\\n\\\"project_id\\\": \\\"p12345\\\",\\n\\\"atb_revenue\\\": 12.34,\\n\\\"payout\\\": 1.23,\\n\\\"status\\\": \\\"captured\\\",\\n\\\"affiliate_id\\\": \\\"a12345\\\",\\n\\\"click_id\\\": \\\"c12345\\\",\\n\\\"params\\\": {\\n\\\"custom_param\\\": \\\"param-value\\\"\\n}\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nPlease see payload definitions below: \n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"conversion_id: Unique ID of conversion\\n\\nlanding_page_url: Landing page\\n\\nlanding_page_visited_at: Timestamp of user's visit \\n\\noffer_name: Advertiser's offer name\\n\\noffer_id: Advertiser's offer unique ID\\n\\nproject_name: Advertiser's name\\n\\nproject_id: Advertisers unique ID\\n\\natb_revenue: Revenue of conversion event\\n\\nstatus: Status of conversion:\\n  captured:  Conversion event detected\\n  approved:  Conversion accepted for payout to affiliate\\n  rejected:  Not accepted for payout to affiliate\\n  payout_prepared:  Conversion added to pending payout\\n  completed:  Payout is issued\\n\\naffiliate_id: Your unique ID\\n\\npayout - this amount will be paid out to affiliate (if any)\\n\\nparams - additional params you added to your affiliate URL. These can be `subid` or any param you like to track in webhook and reports\",\n      \"language\": \"text\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"GET request\"\n}\n[/block]\nIf your endpoint expects not POST but GET webhooks, please select this option on the webhook settings form.\n\nAfter that you will be receiving GET requests with all the params now included in request URL itself, e.g:\n\nhttps://YOUR-ENDPOINT.COM?affiliate_id=a12345&atb_revenue=12.34&click_id=c12345&conversion_id=c12345&landing_page_url=https%3A%2F%2Fexample.com%2Flanding-page&landing_page_visited_at=2021-06-07T09%3A04%3A16.995Z&offer_id=o12345&offer_name=Test%20offer&params_custom_param=param-value&payout=1.23&project_id=p12345&project_name=Test%20project&status=captured\n\nIf you have any questions please contact help:::at:::attributionapp.com","updates":[],"order":999,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"60abc7cc235af200238f0eef","createdAt":"2021-05-24T15:35:40.540Z","user":"560c92f2ac2859170013faa3","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Affiliates","slug":"affiliates","order":10,"from_sync":false,"reference":false,"_id":"609bf103a1334800624b7541","createdAt":"2021-05-12T15:15:15.738Z","version":"560c93ae7e9b9d0d00ca81a5","project":"560c93ad7e9b9d0d00ca81a2","__v":0},"version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["560c93af7e9b9d0d00ca81a6","560c9d9399bb5a0d0044f220","560d76d899bb5a0d0044f307","560d76ee1ec45619006069ed","560d86e099bb5a0d0044f32e","560dba80373c0e0d0024ff3b","57c722ecdf19130e001fba5d","57c743d1b6f94a2200659903","58995ec083f743190077bbe2","5fabfb070e9b0600424707dd","60004359deee820012dc1efc","600060c72dcd9d002fa13656","6001ac08c104fe002b933b7c","6009604d81b288001417df30","60097b7be8ec1e00334419f6","600aa98de28fae003a33108a","600aa9ee7d3e350018e7d6e4","601176819ca8c90011cfe6ac","606eef795bb7ed00790e9e68","609bf103a1334800624b7541"],"_id":"560c93ae7e9b9d0d00ca81a5","project":"560c93ad7e9b9d0d00ca81a2","createdAt":"2015-10-01T02:00:14.709Z","releaseDate":"2015-10-01T02:00:14.709Z","__v":20},"project":"560c93ad7e9b9d0d00ca81a2","__v":0}

Webhooks for affiliates

How to use webhooks

Webhooks can be configured to send data and notifications from your Attribution affiliates portal to other tools. [block:callout] { "type": "warning", "title": "Webhook usage", "body": "POST requests can be made for the following events:\n1. A conversion event has been completed \n2. A conversion has been approved and paid out" } [/block] [block:api-header] { "title": "Create your webhook" } [/block] You can create your webhook by navigating to the 'Profile' page within your affiliates portal. [block:image] { "images": [ { "image": [ "https://files.readme.io/1d65514-unnamed_1.png", "unnamed (1).png", 2214, 1920, "#333" ] } ] } [/block] [block:callout] { "type": "info", "body": "Use a tool like https://webhook.site to see your payload", "title": "Test your webhook" } [/block] 1. Add your webhook URL in the **'Webhook section'** 2. Press **'save'** to send a test event TIP: Use a tool like https://webhook.site to see your payload Please see the example request below: [block:code] { "codes": [ { "code": "{\n\"conversion_id\": \"c12345\",\n\"landing_page_url\": \"https://example.com/landing-page\",\n\"landing_page_visited_at\": \"2021-06-04T11:15:14.452Z\",\n\"offer_name\": \"Test offer\",\n\"offer_id\": \"o12345\",\n\"project_name\": \"Test project\",\n\"project_id\": \"p12345\",\n\"atb_revenue\": 12.34,\n\"payout\": 1.23,\n\"status\": \"captured\",\n\"affiliate_id\": \"a12345\",\n\"click_id\": \"c12345\",\n\"params\": {\n\"custom_param\": \"param-value\"\n}\n}", "language": "json" } ] } [/block] Please see payload definitions below: [block:code] { "codes": [ { "code": "conversion_id: Unique ID of conversion\n\nlanding_page_url: Landing page\n\nlanding_page_visited_at: Timestamp of user's visit \n\noffer_name: Advertiser's offer name\n\noffer_id: Advertiser's offer unique ID\n\nproject_name: Advertiser's name\n\nproject_id: Advertisers unique ID\n\natb_revenue: Revenue of conversion event\n\nstatus: Status of conversion:\n captured: Conversion event detected\n approved: Conversion accepted for payout to affiliate\n rejected: Not accepted for payout to affiliate\n payout_prepared: Conversion added to pending payout\n completed: Payout is issued\n\naffiliate_id: Your unique ID\n\npayout - this amount will be paid out to affiliate (if any)\n\nparams - additional params you added to your affiliate URL. These can be `subid` or any param you like to track in webhook and reports", "language": "text", "name": null } ] } [/block] [block:api-header] { "title": "GET request" } [/block] If your endpoint expects not POST but GET webhooks, please select this option on the webhook settings form. After that you will be receiving GET requests with all the params now included in request URL itself, e.g: https://YOUR-ENDPOINT.COM?affiliate_id=a12345&atb_revenue=12.34&click_id=c12345&conversion_id=c12345&landing_page_url=https%3A%2F%2Fexample.com%2Flanding-page&landing_page_visited_at=2021-06-07T09%3A04%3A16.995Z&offer_id=o12345&offer_name=Test%20offer&params_custom_param=param-value&payout=1.23&project_id=p12345&project_name=Test%20project&status=captured If you have any questions please contact [email protected]