REST API
cURL
curl --request POST \ --url http://localhost:3002/api/v1/products \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "sku": "PROD-002", "name": "New Product", "price": 123, "description": "<string>", "category": "<string>", "cost": 123, "stock": 123 } '
{ "id": "prod_123", "sku": "PROD-001", "name": "Product Name", "price": 100000, "description": "<string>", "category": "electronics", "cost": 75000, "stock": 50, "status": "active", "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z" }
Create new product
JWT Bearer token authentication
"PROD-002"
"New Product"
Product created
"prod_123"
"PROD-001"
"Product Name"
100000
"electronics"
75000
50
active
inactive
"active"
Was this page helpful?