Update Cost Periods
POST {{SL_BASE_URL}}/api/cogs/cost-periods
This endpoints allow you to modify all associated cost periods of a product (or a list of products). This action overrides all existing cost-periods with the new list provided, so make sure you do send all cost periods which you want to keep, every time, even if there's no change in them. In short, this endpoint behaves exactly the same way as do the COGS file upload.
Request Body
{"seller_id"=>"<string>", "marketplace_id"=>"<string>", "sku"=>"<string>", "data"=>[{"dates"=>{"from_date"=>"<yyyy-mm-dd>", "to_date"=>"<yyyy-mm-dd>"}, "cost_elements"=>[{"cost_element"=>"First element", "provider"=>"My provider", "notes"=>"My notes go here", "total_amount"=>10.99, "currency"=>"USD", "conversion_rate"=>1, "units"=>1, "amount"=>10.99}, {"cost_element"=>"Second element", "provider"=>"My provider", "notes"=>"", "total_amount"=>12.99, "currency"=>"USD", "conversion_rate"=>1, "units"=>1, "amount"=>12.99}]}]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string | Required |
RESPONSES
status: OK
{"status":"Success","code":200,"message":"Updates are enqueued","path":"api/cogs/cost-periods"}