curl --location --request POST 'https://api.stateset.com/v1/cogs_entries' \ --header 'Content-Type: application/json' \ --header 'Authorization: Token <token>' \ --data-raw '{ "period": "2024-Q1", "product": "Widget A", "quantity_sold": 100, "cogs": 5000, "average_cost": 50, "ending_inventory_quantity": 500, "ending_inventory_value": 25000, "currency": "USD", "unit_selling_price": 75, "gross_sales": 7500, "cogs_method": "FIFO", "sale_date": "2024-03-15" }'
{ "id": 123, "message": "<string>" }
This endpoint creates a new COGS (Cost of Goods Sold) entry.
import requests import json url = "https://api.stateset.com/v1/cogs_entries" headers = { "Content-Type": "application/json", "Authorization": "Token <token>" } data = { "period": "2024-Q1", "product": "Widget A", "quantity_sold": 100, "cogs": 5000, "average_cost": 50, "ending_inventory_quantity": 500, "ending_inventory_value": 25000, "currency": "USD", "unit_selling_price": 75, "gross_sales": 7500, "cogs_method": "FIFO", "sale_date": "2024-03-15" } response = requests.post(url, headers=headers, data=json.dumps(data)) print(response.json())