Skip to main content
PATCH
/
events
/
{event}
/
products
/
{eventProduct}
Atualizar produto do evento
curl --request PATCH \
  --url http://localhost/api/v1/events/{event}/products/{eventProduct} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "quantity": 2,
  "applied_unit_price": 1,
  "discount_total": 1,
  "sale_reference": "<string>",
  "notes": "<string>"
}
'
{
  "data": {
    "id": 123,
    "event_id": 123,
    "product_id": 123,
    "parent_id": 123,
    "quantity": 123,
    "table_unit_price": 123,
    "table_total": 123,
    "applied_unit_price": 123,
    "discount_total": 123,
    "final_total": 123,
    "difference_total": 123,
    "unit_cost": 123,
    "attributes_schema": [
      "<unknown>"
    ],
    "sale_reference": "<string>",
    "notes": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>",
    "product": {
      "id": 123,
      "name": "<string>",
      "type": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

API key do hub com escopo manage. Header: Authorization: Bearer <api_key>.

Path Parameters

event
string
required
eventProduct
integer
required

Body

application/json

PATCH /api/v1/events/{event}/products/{eventProduct} — atualização parcial de uma linha. Não permite trocar o produto da linha (espelha o painel, que edita qty/preço/desconto/refs). Totais são recalculados pelo model no saving().

quantity
integer
Required range: x >= 1
applied_unit_price
number
Required range: x >= 0
discount_total
number | null
Required range: x >= 0
sale_reference
string | null
Maximum string length: 100
notes
string | null
Maximum string length: 500

Response

JsonResource

data
EventProductResource · object
required