{"_id":"5a944190bec35c00121d3157","project":"568af724176a6c0d00a29ec4","version":{"_id":"568af725176a6c0d00a29ec7","project":"568af724176a6c0d00a29ec4","__v":11,"createdAt":"2016-01-04T22:50:13.289Z","releaseDate":"2016-01-04T22:50:13.289Z","categories":["568af725176a6c0d00a29ec8","56d9d397337fd11300d6a3e3","56d9d4287222d50b0070160b","56f424307ea0091700f63ac5","56f45babcb0dce29005a8e85","5739e5836c5ba134007a197d","57717aee3dd24019004c9122","5771b5d8c755ca0e00617d7d","579639964913990e001a5911","57e57e7df3d7fc0e009c5119","587569b6f4483a0f00d2e6b8"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"57717aee3dd24019004c9122","project":"568af724176a6c0d00a29ec4","version":"568af725176a6c0d00a29ec7","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-06-27T19:13:50.805Z","from_sync":false,"order":5,"slug":"reporting","title":"Reporting"},"user":"568af6d197d8960d0012ab7d","githubsync":"","__v":91,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-02-26T17:19:12.781Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"method":"get","examples":{"codes":[{"language":"php","code":"<?php\n$ch = curl_init(\"https://viglink.io/transactions?clickDateStart=2018/01/01\");\n\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: secret YOUR SECRET KEY'));\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n$response = curl_exec($ch);\n\ncurl_close($ch);"},{"code":"require 'httparty'\n\nurl = \"https://viglink.io/transactions?clickDateStart=2018/01/01\"\n\nheaders = {Authorization: \"secret {SECRET KEY}\"}\n\nresponse = HTTParty.get(url, headers: headers)\n","language":"ruby"},{"code":"curl -i -X GET -H \"Authorization: secret {SECRET KEY}\" 'https://viglink.io/transactions?clickDateStart=2018/01/01'\n","language":"curl"}]},"settings":"587568fccf38030f005e3f39","results":{"codes":[{"name":"","code":"{\nresults: [\n{\nproducts: [ ],\naccountId: 12345,\nanchorText: \"apple\",\ncampaignId: 1789403,\ncampaignName: \"3208744\",\nclickDate: \"2018-02-07\",\nclickUrl: \"https://itunes.apple.com\",\ncommissionDate: \"2018-02-07\",\ncommissionId: \"1010l1656544614\",\ndeviceType: \"Mobile\",\nmerchantGroupId: 3,\nmerchantId: 62099,\nmerchantName: \"iTunes\",\nmerchantNameOriginal: \"iTunes\",\norderValue: 0,\npageTitle: \"my page title\",\npageUrl: \"https://mypage.com\",\npublisherRevenue: 0,\nsubId: 121\n},\n{\nproducts: [ ],\naccountId: 12345,\nanchorText: \"iphone\",\ncampaignId: 1789423,\ncampaignName: \"3706431\",\nclickDate: \"2018-01-01\",\nclickUrl: \"https://itunes.apple.com\",\ncommissionDate: \"2018-01-01\",\ncommissionId: \"1000l1587941715\",\ndeviceType: \"Mobile\",\nmerchantGroupId: 3,\nmerchantId: 62099,\nmerchantName: \"iTunes\",\nmerchantNameOriginal: \"iTunes\",\norderValue: 0,\npageTitle: \"my page title\",\npageUrl: \"https://mypage.com\",\npublisherRevenue: 0,\nsubId: 101\n},\n{\nproducts: [ ],\naccountId: 12345,\nanchorText: \"sur iOs\",\ncampaignId: 3508540,\ncampaignName: \"5074835\",\nclickDate: \"2018-01-28\",\nclickUrl: \"https://itunes.apple.com\",\ncommissionDate: \"2018-01-28\",\ncommissionId: \"1001l1640211381\",\ndeviceType: \"Mobile\",\nmerchantGroupId: 3,\nmerchantId: 62099,\nmerchantName: \"iTunes\",\nmerchantNameOriginal: \"iTunes\",\norderValue: 0,\npageTitle: \"my page title\",\npageUrl: \"https://mypage.com\",\npublisherRevenue: 0,\nsubId: 789\n},\n{\nproducts: [ ],\naccountId: 12345,\nanchorText: \"Big Sky\",\ncampaignId: 1792668,\ncampaignName: \"3629869\",\nclickDate: \"2018-02-19\",\nclickUrl: \"http://www.cabelas.com/product/\",\ncommissionDate: \"2018-02-19\",\ncommissionId: \"CPC-31882513\",\ndeviceType: \"Desktop\",\nmerchantGroupId: 163,\nmerchantId: 53222,\nmerchantName: \"Cabela's\",\nmerchantNameOriginal: \"Cabela's\",\norderValue: 0.04,\npageTitle: \"my page title\",\npageUrl: \"https://mypage.com\",\npublisherRevenue: 0.04,\nsubId: 456\n},\n{\nproducts: [\n{\nitemPrice: 0,\nitemQuantity: 1,\nproductId: \"9WZDNCRDLG12_0010\",\nproductName: \"Free The Animation\"\n}\n],\naccountId: 12345,\nanchorText: \"here\",\ncampaignId: 1880430,\ncampaignName: \"4014618\",\nclickDate: \"2018-01-15\",\nclickUrl: \"https://www.microsoft.com/en-us/store/\",\ncommissionDate: \"2018-01-15\",\ncommissionId: \"c57fdb3a-8ab1-46ef-9949-df1e375f82c6\",\ndeviceType: \"Desktop\",\nmerchantGroupId: 212,\nmerchantId: 507,\nmerchantName: \"Microsoft Store\",\nmerchantNameOriginal: \"Microsoft Store\",\norderValue: 0,\npageTitle: \"my page title\",\npageUrl: \"https://mypage.com\",\npublisherRevenue: 0,\nsubId: 123\n}\n],\npagination: {\npage: -1,\nperPage: 5,\ntotalItems: 5\n},\nreportId: \"abcd\",\nbuckets: [\n{\nsumField: \"publisherRevenue\",\nsumValue: 2103.23,\nfields: {\nmerchantName: \"iTunes\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 647.54,\nfields: {\nmerchantName: \"Amazon Marketplace\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 145.26,\nfields: {\nmerchantName: \"Nordstrom\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 2647.05,\nfields: {\nmerchantName: \"Microsoft Store\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 112.53,\nfields: {\nmerchantName: \"microsoft br\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 1160.97,\nfields: {\nmerchantName: \"Aliexpress.com International\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 297.27,\nfields: {\nmerchantName: \"udemy UK\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 7280.86,\nfields: {\nmerchantName: \"Udemy\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 134.3,\nfields: {\nmerchantName: \"verizon wireless\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 27.5,\nfields: {\nmerchantName: \"Amazon US\"\n}\n}\n]\n}\n","language":"json","status":200},{"code":"{\n    error: {\n        errors: {\n            reason: \"invalidParameter\",\n            message: \"Your request must contain a query or a filter\",\n            locationType: \"parameter\",\n            location: \"query\"\n        }\n    },\n    code: 400,\n    message: \"Your request must contain a query or a filter\"\n}","language":"json","status":400,"name":""},{"code":"{\n    error: {\n        errors: [\n            {\n                reason: \"invalidCredentials\",\n                message: \"Authorization secret is missing or invalid. This can be found at https://publishers.viglink.com/account and can be sent as a parameter or Authorization header\",\n                locationType: \"parameter\",\n                location: \"secret\"\n            }\n        ]\n    },\n    code: 401,\n    message: \"Authorization secret is missing or invalid. This can be found at https://publishers.viglink.com/account and can be sent as a parameter or Authorization header\"\n}","status":401,"language":"json"},{"code":"{\n    error: {\n        errors: {\n            reason: \"rateLimitExceeded\",\n            message: \"You need to slow down the rate at which you are sending the requests. You are only allowed 1 query per second for this endpoint\"\n        }\n    },\n    code: 403,\n    message: \"You need to slow down the rate at which you are sending the requests. You are only allowed 1 query per second for this endpoint\"\n}","language":"json","status":403},{"status":500,"language":"json","code":"{\n    error: {\n        errors: [\n            {\n                reason: \"internalServerError\",\n                message: \"An unexpected error occurred, but we are looking into it\"\n            }\n        ]\n    },\n    code: 500,\n    message: \"An unexpected error occurred, but we are looking into it\"\n}","name":null}]},"auth":"required","params":[{"_id":"5a9979ab91a1190033a20224","ref":"","in":"query","required":false,"desc":"How many results do you want in each page.","default":"20","type":"long","name":"perPage"},{"_id":"5a9979ab91a1190033a20223","ref":"","in":"query","required":false,"desc":"The first time you call this, you should not specify a value here. The second and subsequent calls should used the value given in the output. This allows you to scroll through your results, one page at a time.","default":"NULL","type":"string","name":"reportId"},{"_id":"5a9f14497d764d005682e2f1","ref":"","in":"query","required":false,"desc":"cuid of your transactions","default":"NULL","type":"string","name":"cuid"},{"_id":"5a9f14497d764d005682e2f0","ref":"","in":"query","required":false,"desc":"campaign name of your transactions","default":"NULL","type":"string","name":"campaignName"},{"_id":"5a9f14497d764d005682e2ef","ref":"","in":"query","required":false,"desc":"anchor text of your transactions","default":"NULL","type":"string","name":"anchorText"},{"_id":"5a9f14497d764d005682e2ee","ref":"","in":"query","required":false,"desc":"product name of your transactions","default":"NULL","type":"string","name":"productName"},{"_id":"5a9f1896bff4bf001292806b","ref":"","in":"query","required":false,"desc":"merchant name of your transactions","default":"NULL","type":"string","name":"merchantName"},{"_id":"5a9f19a77d764d005682e347","ref":"","in":"query","required":true,"desc":"<a href=\"#section-how-date-ranges-work\">How Date Ranges Work</a>","default":"NULL","type":"string","name":"clickDateStart"},{"_id":"5a9f2614ef97780044db269f","ref":"","in":"query","required":true,"desc":"<a href=\"#section-how-date-ranges-work\">How Date Ranges Work</a>","default":"NULL","type":"string","name":"clickDateEnd"},{"_id":"5a9f2614ef97780044db269e","ref":"","in":"query","required":false,"desc":"This is the date the merchant reported the commission/transaction to VigLink. <a href=\"#section-how-date-ranges-work\">How Date Ranges Work</a>","default":"NULL","type":"string","name":"commissionDateStart"},{"_id":"5a9f2614ef97780044db269d","ref":"","in":"query","required":false,"desc":"This is the date the merchant reported the commission/transaction to VigLink.  <a href=\"#section-how-date-ranges-work\">How Date Ranges Work</a>","default":"NULL","type":"string","name":"commissionDateEnd"},{"_id":"5a9f26f97faab00041011524","ref":"","in":"query","required":false,"desc":"<a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_long","name":"campaignIds"},{"_id":"5aa00103e938ce001c259fed","ref":"","in":"query","required":false,"desc":"<a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_string","name":"cuids"},{"_id":"5aa00103e938ce001c259fec","ref":"","in":"query","required":false,"desc":"<a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_string","name":"subIds"},{"_id":"5aa00103e938ce001c259feb","ref":"","in":"query","required":false,"desc":"<a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_string","name":"campaignNames"},{"_id":"5aa00103e938ce001c259fea","ref":"","in":"query","required":false,"desc":"The page where the click originated when available. <a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_string","name":"pageUrls"},{"_id":"5aa00103e938ce001c259fe9","ref":"","in":"query","required":false,"desc":"<a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_string","name":"anchorTexts"},{"_id":"5aa00103e938ce001c259fe8","ref":"","in":"query","required":false,"desc":"The outbound URL clicked when available. <a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_string","name":"clickUrls"},{"_id":"5aa00103e938ce001c259fe7","ref":"","in":"query","required":false,"desc":"<a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_string","name":"productIds"},{"_id":"5aa00103e938ce001c259fe6","ref":"","in":"query","required":false,"desc":"<a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_string","name":"productNames"},{"_id":"5aa00103e938ce001c259fe5","ref":"","in":"query","required":false,"desc":"<a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_string","name":"merchantGroupNames"},{"_id":"5aa00103e938ce001c259fe4","ref":"","in":"query","required":false,"desc":"<a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_long","name":"merchantIds"},{"_id":"5aa00103e938ce001c259fe3","ref":"","in":"query","required":false,"desc":"<a href=\"#section-how-filters-work\">How Filters Work</a>","default":"NULL","type":"array_long","name":"merchantGroupIds"},{"_id":"5aa00103e938ce001c259fe2","ref":"","in":"query","required":false,"desc":"<a href=\"#section-which-fields-to-use-in-groupbyfields\">Which fields to use</a>","default":"","type":"array_string","name":"groupByFields"},{"_id":"5aa00103e938ce001c259fe1","ref":"","in":"query","required":false,"desc":"<a href=\"#section-which-fields-to-use-in-sumbyfield\">Which fields to use</a>","default":"NULL","type":"string","name":"sumByField"}],"url":"/transactions"},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Rate Limiting\",\n  \"body\": \"This API endpoint is rate limited to 1 request per second\"\n}\n[/block]\n\n# How Date Ranges Work\n\nYou can specify commissionDateStart, commissionDateEnd, clickDateStart, and clickDateEnd in the standard format \"yyyy/mm/dd\" where yyyy is the four digit year, mm is the two digit month and dd is the two digit day. If you do not specify a start date, you will get all transactions up to the specified end date. If you do not specify an end date, you will get all transactions past the start date to present.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"A clickDateStart OR a ClickDateEnd is required for each API call.\",\n  \"title\": \"Required Fields\"\n}\n[/block]\nValid dates:\n\nclickDateStart=2017/01/01\n\n# How Pagination Works\n\nYour first request will return a 4 character reportId. Supply this reportId in the query and each subsequent request will return the next set of results. \n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"After your initial request, the only parameter that should be present in the api call is the reportId in order to iterate through the results. Adding other parameters will result in an error being generated. \\n\\nInitial request: https://viglink.io/transactions?clickDateStart=2018/01/01\\n\\nSecond request: https://viglink.io/transactions?reportId=abcd\",\n  \"title\": \"Pagination tip\"\n}\n[/block]\n# Which Fields To Use In sumByField\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Adding a sumByField to your query will return all of your transactions, and add an additional node to the end of the results under \\\"buckets\\\" that contains the data and sum. Think of this as a way to return more information for a given query.\",\n  \"title\": \"Note on Sums\"\n}\n[/block]\n- publisherRevenue\n- orderValue\n- itemQuantity\n- itemPrice\n\nHow do I return all commissions earned after July 27, 2017 and return the SUM of the revenue? \n\nFor this, we use the clickDateStart parameter to specify 2017/07/27 as the start date and specify publisherRevenue as the value for the sumByField. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n$ch = curl_init(\\\"https://viglink.io/transactions?clickDateStart=2017/07/27&sumByField=publisherRevenue\\\");\\n\\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: secret YOUR SECRET KEY'));\\n\\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\\n\\n$response = curl_exec($ch);\\n\\ncurl_close($ch);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"buckets: [\\n{\\nsumField: \\\"publisherRevenue\\\",\\nsumValue: 34274.68,\\nfields: { }\\n}\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n# Which fields to use in groupByFields\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Adding groupByFields parameter to your query will return all of your transactions, and add an additional node to the end of the results under \\\"buckets\\\" that contains the data grouped as specified. Think of this as a way to return more information for a given query.\",\n  \"title\": \"Note on Group By's\"\n}\n[/block]\nThe following fields can be used in the groupByFields array: \n\n- cuid\n- subId\n- campaignName\n- pageUrl\n- anchorText\n- clickUrl\n- clickDate\n- productId\n- productName\n- productSku\n- merchantName\n- merchantId\n- merchantGroupId\n\nA group by might be used to return your top performing merchants, view revenue by page URL, or show you revenue by clickDate. \n\nSpecify an array of values that you want to group by, for example for pageUrl and clickDate:\n\ngroupByFields=pageUrl,clickDate\n\nHow would I view my top performing merchants with a sum of their revenue for a given date range?\n\nWe start by specifying our clickDateStart, we follow this with merchantName as the value for our groupByFields, and finally, we specify publisherRevenue in our sumByField.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n$ch = curl_init(\\\"https://viglink.io/transactions?clickDateStart=2018/01/01&groupByFields=merchantName&sumByField=publisherRevenue\\\");\\n\\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: secret YOUR SECRET KEY'));\\n\\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\\n\\n$response = curl_exec($ch);\\n\\ncurl_close($ch);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"buckets: [\\n{\\nsumField: \\\"publisherRevenue\\\",\\nsumValue: 712.21,\\nfields: {\\nmerchantName: \\\"iTunes PHG\\\"\\n}\\n},\\n{\\nsumField: \\\"publisherRevenue\\\",\\nsumValue: 306.45,\\nfields: {\\nmerchantName: \\\"Amazon Marketplace\\\"\\n}\\n},\\n{\\nsumField: \\\"publisherRevenue\\\",\\nsumValue: 76.67,\\nfields: {\\nmerchantName: \\\"Amazon PGR on SHZ\\\"\\n}\\n},\\n{\\nsumField: \\\"publisherRevenue\\\",\\nsumValue: 1.43,\\nfields: {\\nmerchantName: \\\"microsoft br\\\"\\n}\\n},\\n{\\nsumField: \\\"publisherRevenue\\\",\\nsumValue: 1216.06,\\nfields: {\\nmerchantName: \\\"Microsoft Store\\\"\\n}\\n},\\n{\\nsumField: \\\"publisherRevenue\\\",\\nsumValue: 13.1,\\nfields: {\\nmerchantName: \\\"udemy UK\\\"\\n}\\n},\\n{\\nsumField: \\\"publisherRevenue\\\",\\nsumValue: 82.98,\\nfields: {\\nmerchantName: \\\"homedepot.com\\\"\\n}\\n},\\n{\\nsumField: \\\"publisherRevenue\\\",\\nsumValue: 449.05,\\nfields: {\\nmerchantName: \\\"Aliexpress.com International\\\"\\n}\\n},\\n{\\nsumField: \\\"publisherRevenue\\\",\\nsumValue: 122.71,\\nfields: {\\nmerchantName: \\\"musikhaus thomann cyberstore\\\"\\n}\\n},\\n{\\nsumField: \\\"publisherRevenue\\\",\\nsumValue: 925.4,\\nfields: {\\nmerchantName: \\\"Lenovo Italy\\\"\\n}\\n}\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n# How Filters Work\n\nThe following fields can be used to filter results: \n\n- campaignIds\n- cuids\n- subIds\n- campaignNames\n- pageUrls\n- anchorTexts\n- clickUrls\n- productIds\n- productNames\n- merchantGroupNames\n- merchantName\n- merchantIds\n- merchantGroupIds\n\nSpecify an array of values that you want to search for, for example for productIds, specify:\n\nproductIds=product1,product3\n\nFilters are used to narrow down your result set. You might want to filter the results by a specific cuid, subId, or campaign. For example, let's pull back all transactions for a specific campaign:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n$ch = curl_init(\\\"https://viglink.io/transactions?clickDateStart=2018/01/01&campaignIds=123456\\\");\\n\\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: secret YOUR SECRET KEY'));\\n\\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\\n\\n$response = curl_exec($ch);\\n\\ncurl_close($ch);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"results: [\\n{\\nproducts: [\\n],\\naccountId: 123456,\\nanchorText: \\\"iOS\\\",\\ncampaignId: 123456,\\ncampaignName: \\\"123456\\\",\\nclickDate: \\\"2018-01-15\\\",\\nclickUrl: \\\"https://itunes.apple.com/br/app/perfil/id688901726?mt=8\\\",\\ncommissionDate: \\\"2018-01-15\\\"\\ncommissionId: \\\"1001l1615599542\\\",\\ndeviceType: \\\"Mobile\\\",\\nmerchantGroupId: 3,\\nmerchantId: 62099,\\nmerchantName: \\\"iTunes PHG\\\",\\nmerchantNameOriginal: \\\"iTunes PHG\\\",\\norderValue: 0,\\npageTitle: \\\"3 aplicativos de jogo para se divertir com os amigos\\\",\\npageUrl: \\\"http://blog.saldaodainformatica.com.br/dicas-e-aplicativos/3-aplicativos-de-jogo-para-se-divertir-com-os-amigos/\\\",\\npublisherRevenue: 0,\\nsubId: 5096774,\\n\\n},\\n],\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Authorization Header\",\n  \"body\": \"You must add authorization headers to this request.\\n```Authorization: secret {SECRET KEY}```\\n\\n<b>Replace {SECRET KEY} above with any secret key from any campaign in your account.</b> You can find a secret key in your [VigLink account](https://publishers.viglink.com/account). When logged into your dashboard, go to Manage > Account. Under the My Campaign sub-heading, copy a Secret Key. If you don’t have one, click “Get a Secret Key\\\" on any of your campaigns.\"\n}\n[/block]\n# FAQ\nQ: In what case would products array be empty, and have data\nA: The product array will return information about the products purchased as part of the transaction. Not all merchants and networks provide this information, so you may see an empty array when not available. \n\nQ: deviceType is sometimes not showing, why?\nA: We don't always have access to detailed information about the click, or there may be instances where we are unable to accurately determine the device type.\n\nQ: what are all the possible values for deviceType?\nA: Mobile, Desktop, and Tablet\n\nQ: clickUrl, pageUrl, and pageTitle are sometimes not showing, is this expected?\nA: We don't always have detailed information about the click that leads to a conversion. In these instances, some of the fields related to the click will not contain data.\n\nQ: How can I test this in my web browser?\nA: You can download a browser extension called mod header here: \n\nhttps://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=de\n\nThe extension allows you to add a secret key to your request. Under the \"Value\" section in the plugin, paste \"secret 1234abcd\" without quotes, and replace the 1234abcd with one of the secret keys from your VigLink account. You can find your secret key in your site settings page: \n\nhttps://publishers.viglink.com/publisher/sites\n\nNow you can test the API by making a request with your web browser. \n\nexample: https://viglink.io/transactions?clickDateStart=2018/01/01\n\nWhen you are done testing be sure to disable the mod header extension as it can interfere with browsing websites.","excerpt":"For each revenue event, get back relevant data about the entire click to purchase funnel.","slug":"transaction-reporting","type":"endpoint","title":"Transaction Reporting"}

getTransaction Reporting

For each revenue event, get back relevant data about the entire click to purchase funnel.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

perPage:
long20
How many results do you want in each page.
reportId:
stringNULL
The first time you call this, you should not specify a value here. The second and subsequent calls should used the value given in the output. This allows you to scroll through your results, one page at a time.
cuid:
stringNULL
cuid of your transactions
campaignName:
stringNULL
campaign name of your transactions
anchorText:
stringNULL
anchor text of your transactions
productName:
stringNULL
product name of your transactions
merchantName:
stringNULL
merchant name of your transactions
clickDateStart:
required
stringNULL
<a href="#section-how-date-ranges-work">How Date Ranges Work</a>
clickDateEnd:
required
stringNULL
<a href="#section-how-date-ranges-work">How Date Ranges Work</a>
commissionDateStart:
stringNULL
This is the date the merchant reported the commission/transaction to VigLink. <a href="#section-how-date-ranges-work">How Date Ranges Work</a>
commissionDateEnd:
stringNULL
This is the date the merchant reported the commission/transaction to VigLink. <a href="#section-how-date-ranges-work">How Date Ranges Work</a>
campaignIds:
array_longNULL
<a href="#section-how-filters-work">How Filters Work</a>
cuids:
array of stringsNULL
<a href="#section-how-filters-work">How Filters Work</a>
subIds:
array of stringsNULL
<a href="#section-how-filters-work">How Filters Work</a>
campaignNames:
array of stringsNULL
<a href="#section-how-filters-work">How Filters Work</a>
pageUrls:
array of stringsNULL
The page where the click originated when available. <a href="#section-how-filters-work">How Filters Work</a>
anchorTexts:
array of stringsNULL
<a href="#section-how-filters-work">How Filters Work</a>
clickUrls:
array of stringsNULL
The outbound URL clicked when available. <a href="#section-how-filters-work">How Filters Work</a>
productIds:
array of stringsNULL
<a href="#section-how-filters-work">How Filters Work</a>
productNames:
array of stringsNULL
<a href="#section-how-filters-work">How Filters Work</a>
merchantGroupNames:
array of stringsNULL
<a href="#section-how-filters-work">How Filters Work</a>
merchantIds:
array_longNULL
<a href="#section-how-filters-work">How Filters Work</a>
merchantGroupIds:
array_longNULL
<a href="#section-how-filters-work">How Filters Work</a>
groupByFields:
array of strings
<a href="#section-which-fields-to-use-in-groupbyfields">Which fields to use</a>
sumByField:
stringNULL
<a href="#section-which-fields-to-use-in-sumbyfield">Which fields to use</a>

Examples


Result Format


Documentation

[block:callout] { "type": "warning", "title": "Rate Limiting", "body": "This API endpoint is rate limited to 1 request per second" } [/block] # How Date Ranges Work You can specify commissionDateStart, commissionDateEnd, clickDateStart, and clickDateEnd in the standard format "yyyy/mm/dd" where yyyy is the four digit year, mm is the two digit month and dd is the two digit day. If you do not specify a start date, you will get all transactions up to the specified end date. If you do not specify an end date, you will get all transactions past the start date to present. [block:callout] { "type": "info", "body": "A clickDateStart OR a ClickDateEnd is required for each API call.", "title": "Required Fields" } [/block] Valid dates: clickDateStart=2017/01/01 # How Pagination Works Your first request will return a 4 character reportId. Supply this reportId in the query and each subsequent request will return the next set of results. [block:callout] { "type": "info", "body": "After your initial request, the only parameter that should be present in the api call is the reportId in order to iterate through the results. Adding other parameters will result in an error being generated. \n\nInitial request: https://viglink.io/transactions?clickDateStart=2018/01/01\n\nSecond request: https://viglink.io/transactions?reportId=abcd", "title": "Pagination tip" } [/block] # Which Fields To Use In sumByField [block:callout] { "type": "info", "body": "Adding a sumByField to your query will return all of your transactions, and add an additional node to the end of the results under \"buckets\" that contains the data and sum. Think of this as a way to return more information for a given query.", "title": "Note on Sums" } [/block] - publisherRevenue - orderValue - itemQuantity - itemPrice How do I return all commissions earned after July 27, 2017 and return the SUM of the revenue? For this, we use the clickDateStart parameter to specify 2017/07/27 as the start date and specify publisherRevenue as the value for the sumByField. [block:code] { "codes": [ { "code": "<?php\n$ch = curl_init(\"https://viglink.io/transactions?clickDateStart=2017/07/27&sumByField=publisherRevenue\");\n\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: secret YOUR SECRET KEY'));\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n$response = curl_exec($ch);\n\ncurl_close($ch);", "language": "php" } ] } [/block] [block:code] { "codes": [ { "code": "buckets: [\n{\nsumField: \"publisherRevenue\",\nsumValue: 34274.68,\nfields: { }\n}\n]", "language": "json" } ] } [/block] # Which fields to use in groupByFields [block:callout] { "type": "info", "body": "Adding groupByFields parameter to your query will return all of your transactions, and add an additional node to the end of the results under \"buckets\" that contains the data grouped as specified. Think of this as a way to return more information for a given query.", "title": "Note on Group By's" } [/block] The following fields can be used in the groupByFields array: - cuid - subId - campaignName - pageUrl - anchorText - clickUrl - clickDate - productId - productName - productSku - merchantName - merchantId - merchantGroupId A group by might be used to return your top performing merchants, view revenue by page URL, or show you revenue by clickDate. Specify an array of values that you want to group by, for example for pageUrl and clickDate: groupByFields=pageUrl,clickDate How would I view my top performing merchants with a sum of their revenue for a given date range? We start by specifying our clickDateStart, we follow this with merchantName as the value for our groupByFields, and finally, we specify publisherRevenue in our sumByField. [block:code] { "codes": [ { "code": "<?php\n$ch = curl_init(\"https://viglink.io/transactions?clickDateStart=2018/01/01&groupByFields=merchantName&sumByField=publisherRevenue\");\n\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: secret YOUR SECRET KEY'));\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n$response = curl_exec($ch);\n\ncurl_close($ch);", "language": "php" } ] } [/block] [block:code] { "codes": [ { "code": "buckets: [\n{\nsumField: \"publisherRevenue\",\nsumValue: 712.21,\nfields: {\nmerchantName: \"iTunes PHG\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 306.45,\nfields: {\nmerchantName: \"Amazon Marketplace\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 76.67,\nfields: {\nmerchantName: \"Amazon PGR on SHZ\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 1.43,\nfields: {\nmerchantName: \"microsoft br\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 1216.06,\nfields: {\nmerchantName: \"Microsoft Store\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 13.1,\nfields: {\nmerchantName: \"udemy UK\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 82.98,\nfields: {\nmerchantName: \"homedepot.com\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 449.05,\nfields: {\nmerchantName: \"Aliexpress.com International\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 122.71,\nfields: {\nmerchantName: \"musikhaus thomann cyberstore\"\n}\n},\n{\nsumField: \"publisherRevenue\",\nsumValue: 925.4,\nfields: {\nmerchantName: \"Lenovo Italy\"\n}\n}\n]", "language": "json" } ] } [/block] # How Filters Work The following fields can be used to filter results: - campaignIds - cuids - subIds - campaignNames - pageUrls - anchorTexts - clickUrls - productIds - productNames - merchantGroupNames - merchantName - merchantIds - merchantGroupIds Specify an array of values that you want to search for, for example for productIds, specify: productIds=product1,product3 Filters are used to narrow down your result set. You might want to filter the results by a specific cuid, subId, or campaign. For example, let's pull back all transactions for a specific campaign: [block:code] { "codes": [ { "code": "<?php\n$ch = curl_init(\"https://viglink.io/transactions?clickDateStart=2018/01/01&campaignIds=123456\");\n\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: secret YOUR SECRET KEY'));\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n$response = curl_exec($ch);\n\ncurl_close($ch);", "language": "php" } ] } [/block] [block:code] { "codes": [ { "code": "results: [\n{\nproducts: [\n],\naccountId: 123456,\nanchorText: \"iOS\",\ncampaignId: 123456,\ncampaignName: \"123456\",\nclickDate: \"2018-01-15\",\nclickUrl: \"https://itunes.apple.com/br/app/perfil/id688901726?mt=8\",\ncommissionDate: \"2018-01-15\"\ncommissionId: \"1001l1615599542\",\ndeviceType: \"Mobile\",\nmerchantGroupId: 3,\nmerchantId: 62099,\nmerchantName: \"iTunes PHG\",\nmerchantNameOriginal: \"iTunes PHG\",\norderValue: 0,\npageTitle: \"3 aplicativos de jogo para se divertir com os amigos\",\npageUrl: \"http://blog.saldaodainformatica.com.br/dicas-e-aplicativos/3-aplicativos-de-jogo-para-se-divertir-com-os-amigos/\",\npublisherRevenue: 0,\nsubId: 5096774,\n\n},\n],", "language": "json" } ] } [/block] [block:callout] { "type": "warning", "title": "Authorization Header", "body": "You must add authorization headers to this request.\n```Authorization: secret {SECRET KEY}```\n\n<b>Replace {SECRET KEY} above with any secret key from any campaign in your account.</b> You can find a secret key in your [VigLink account](https://publishers.viglink.com/account). When logged into your dashboard, go to Manage > Account. Under the My Campaign sub-heading, copy a Secret Key. If you don’t have one, click “Get a Secret Key\" on any of your campaigns." } [/block] # FAQ Q: In what case would products array be empty, and have data A: The product array will return information about the products purchased as part of the transaction. Not all merchants and networks provide this information, so you may see an empty array when not available. Q: deviceType is sometimes not showing, why? A: We don't always have access to detailed information about the click, or there may be instances where we are unable to accurately determine the device type. Q: what are all the possible values for deviceType? A: Mobile, Desktop, and Tablet Q: clickUrl, pageUrl, and pageTitle are sometimes not showing, is this expected? A: We don't always have detailed information about the click that leads to a conversion. In these instances, some of the fields related to the click will not contain data. Q: How can I test this in my web browser? A: You can download a browser extension called mod header here: https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=de The extension allows you to add a secret key to your request. Under the "Value" section in the plugin, paste "secret 1234abcd" without quotes, and replace the 1234abcd with one of the secret keys from your VigLink account. You can find your secret key in your site settings page: https://publishers.viglink.com/publisher/sites Now you can test the API by making a request with your web browser. example: https://viglink.io/transactions?clickDateStart=2018/01/01 When you are done testing be sure to disable the mod header extension as it can interfere with browsing websites.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}