{"title":"*NEW* Campaigns API endpoint","slug":"new-campaigns-api-endpoint","body":"We added new API endpoint **\"Campaigns\"**.\n\nStarting from Q2 2019, we rolled out \"Campaigns\". Sellers who are selling in Tophatter might know about this term already. Campaigns is set up so sellers can collate and bulk edit products' Scheduling Fee and their lifetime or daily schedules. Recently, we feel that we need to roll such a feature into our Merchant API. \n\nFirst addition is a completely new API endpoint [Campaigns](http://merchant-api.tophatter.com/docs/campaign-definition). This supports creating new campaigns, editing, and even pausing a campaign. For more details on how to create a campaign, please take a look at [Campaigns API endpoint](http://merchant-api.tophatter.com/docs/create-a-campaign). \n\nAfter creating a new campaign, seller will want to add selected products into the campaign. If you want to first create a product, please take a look on our API article on [how to upload a product to Tophatter](http://merchant-api.tophatter.com/docs/product-create). Once uploaded successfully, linking a product into a campaign is a breeze as you can use Edit a product API endpoint, select the product you want to add to the campaign, and add `campaign_name` as one of the parameters!\n\nExample shown below:\n  * Create a campaign with name \"test1.0\"\n  * Check if campaign is created successfully. If it returns `200 OK`, that means campaign is created successfully.\n  * Either create a product (upload a product into Tophatter) or edit a product, for this example we will try to edit a product to add into a Campaign \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --location --request POST 'https://tophatter.com/merchant_api/v1/campaigns.json?access_token=YOUR_ACCESS_TOKEN_HERE&name=test&type=AuctionCampaign&daily_budget=10&bid_amount=0.01&daily_budget_per_product=1&lifetime_budget=10&lifetime_budget_per_product=10'\",\n      \"language\": \"curl\",\n      \"name\": \"Create a test campaign\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --location --request POST 'https://tophatter.com/merchant_api/v1/products/update.json?access_token=YOUR_ACCESS_TOKEN_HERE&identifier=TEST_PRODUCT_001&campaign_name=test'\",\n      \"language\": \"curl\",\n      \"name\": \"Update a product\"\n    }\n  ]\n}\n[/block]\nOnce you add a product into a campaign, you can take a look in seller dashboard if your product is binded into [Campaigns](https://tophatter.com/seller/campaigns?status=active).\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/abfd678-2020-04-144.00.14.png\",\n        \"截屏2020-04-14下午4.00.14.png\",\n        1560,\n        702,\n        \"#3c267f\"\n      ]\n    }\n  ]\n}\n[/block]","_id":"5e956e24721ef000507849ad","changelog":[{"type":"added","update":"`campaign_name`","_id":"5e956e24721ef000507849b0"},{"type":"added","update":"http://merchant-api.tophatter.com/docs/campaign-definition","_id":"5e956e24721ef000507849af"},{"type":"added","update":"","_id":"5e956e24721ef000507849ae"}],"createdAt":"2020-04-14T08:02:44.584Z","user":{"name":"Chris Estreich","username":"","_id":"567f0baca74a1c0d003e1fba"},"initVersion":{"version":"1","_id":"567f0c06143cc60d00c1fdc1"},"project":"567f0c06143cc60d00c1fdbe","__v":0}

*NEW* Campaigns API endpoint


We added new API endpoint **"Campaigns"**. Starting from Q2 2019, we rolled out "Campaigns". Sellers who are selling in Tophatter might know about this term already. Campaigns is set up so sellers can collate and bulk edit products' Scheduling Fee and their lifetime or daily schedules. Recently, we feel that we need to roll such a feature into our Merchant API. First addition is a completely new API endpoint [Campaigns](http://merchant-api.tophatter.com/docs/campaign-definition). This supports creating new campaigns, editing, and even pausing a campaign. For more details on how to create a campaign, please take a look at [Campaigns API endpoint](http://merchant-api.tophatter.com/docs/create-a-campaign). After creating a new campaign, seller will want to add selected products into the campaign. If you want to first create a product, please take a look on our API article on [how to upload a product to Tophatter](http://merchant-api.tophatter.com/docs/product-create). Once uploaded successfully, linking a product into a campaign is a breeze as you can use Edit a product API endpoint, select the product you want to add to the campaign, and add `campaign_name` as one of the parameters! Example shown below: * Create a campaign with name "test1.0" * Check if campaign is created successfully. If it returns `200 OK`, that means campaign is created successfully. * Either create a product (upload a product into Tophatter) or edit a product, for this example we will try to edit a product to add into a Campaign [block:code] { "codes": [ { "code": "curl --location --request POST 'https://tophatter.com/merchant_api/v1/campaigns.json?access_token=YOUR_ACCESS_TOKEN_HERE&name=test&type=AuctionCampaign&daily_budget=10&bid_amount=0.01&daily_budget_per_product=1&lifetime_budget=10&lifetime_budget_per_product=10'", "language": "curl", "name": "Create a test campaign" } ] } [/block] [block:code] { "codes": [ { "code": "curl --location --request POST 'https://tophatter.com/merchant_api/v1/products/update.json?access_token=YOUR_ACCESS_TOKEN_HERE&identifier=TEST_PRODUCT_001&campaign_name=test'", "language": "curl", "name": "Update a product" } ] } [/block] Once you add a product into a campaign, you can take a look in seller dashboard if your product is binded into [Campaigns](https://tophatter.com/seller/campaigns?status=active). [block:image] { "images": [ { "image": [ "https://files.readme.io/abfd678-2020-04-144.00.14.png", "截屏2020-04-14下午4.00.14.png", 1560, 702, "#3c267f" ] } ] } [/block]
added
`campaign_name`
added
http://merchant-api.tophatter.com/docs/campaign-definition