POST
/
product
Create a product
curl --request POST \
  --url https://lightyshare.com/api/token-secured/product \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "product": {
    "title": "4K Pro Camera",
    "description": "Professional camera with full frame sensor",
    "rent": 250,
    "cost": 3500,
    "productType": 0,
    "stock_type": 0,
    "sku": "CAM-4K-001",
    "quantity": 2,
    "equipments": [
      {
        "name": "Battery",
        "quantity": 4
      }
    ],
    "images": [
      {
        "src": "https://cdn.example.com/camera-front.jpg"
      }
    ],
    "online": true,
    "archived": false
  }
}'
{
  "success": true,
  "id": 14567,
  "location": "/api/token-secured/product/14567"
}

Authorizations

Authorization
string
header
required

Use your API token in the Authorization header with Bearer scheme. Alternative: You can also pass the token as a query parameter ?token=your_token for backward compatibility.

Query Parameters

token
string
required

User authentication token

Example:

"YOUR_TOKEN"

Body

application/json
product
object
required

Response

Product successfully created

success
boolean
Example:

true

id
integer
Example:

14567

location
string
Example:

"/api/token-secured/product/14567"