Skip to main content
POST
/
materials
/
components
/
{id}
/
consume
Decrement component stock
curl --request POST \
  --url https://api.autoprintfarm.com/public/v1/materials/components/{id}/consume \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "quantity": 2,
  "notes": "<string>"
}
'
{
  "success": true,
  "data": {
    "component": {
      "id": "<string>",
      "type": "<string>",
      "name": "<string>",
      "color": "<string>",
      "brand": "<string>",
      "diameter": "<string>",
      "size": "<string>",
      "remaining_units": 123,
      "low_threshold": 123,
      "status": "<string>",
      "location": "<string>",
      "created_at": "<string>",
      "updated_at": "<string>"
    },
    "consumed": {
      "quantity": 123,
      "notes": "<string>",
      "previous_quantity": 123,
      "new_quantity": 123
    }
  }
}

Authorizations

Authorization
string
header
required

API keys are minted in the AutoPrintFarm web app under Settings → API Keys. Send as Authorization: Bearer apf_live_.... Keys are shown exactly once at creation and can be revoked at any time.

Path Parameters

id
string
required

Body

application/json
quantity
integer
required

Number of units to remove from stock

Required range: x >= 1
reason
enum<string>

Reason for the decrement. Defaults to manual_adjustment.

Available options:
manual_adjustment,
damaged,
other
notes
string

Free-form note recorded with the movement

Maximum string length: 500

Response

Consumed

success
enum<boolean>
required
Available options:
true
data
object
required