curl --request DELETE \
--url https://lojinha.dev/api/v1/carts/:id/products/:pid \
--header 'Authorization: Bearer <token>'
{
"cart": {
"id": "4f24a75c-792a-4aff-9265-19deb198be07",
"store": "org_2StqHEqEqKtCH66IJjLb73J2ww6",
"customerId": null,
"addressId": null,
"price": 16000,
"originalPrice": null,
"status": "PENDING",
"createdAt": "2023-07-23T22:04:52.234Z",
"updatedAt": null,
"deletedAt": null,
"products": [
{
"id": "4cf35a0f-7f25-43ef-8e5e-208fbfeb1bd0",
"store": "org_2StqHEqEqKtCH66IJjLb73J2ww6",
"status": "ACTIVE",
"name": "A Tormenta de Espadas",
"slug": "a-tormenta-de-espadas",
"description": "<p>Terceiro livro da série</p>",
"price": 8000,
"originalPrice": 12000,
"quantity": 10,
"sku": "LI-004",
"createdAt": "2023-07-22T00:51:44.685Z",
"updatedAt": "2023-07-23T22:04:32.178Z",
"deletedAt": null,
"order": {
"quantity": 2,
"price": 16000
}
}
]
}
}
Remove um produto do carrinho.
curl --request DELETE \
--url https://lojinha.dev/api/v1/carts/:id/products/:pid \
--header 'Authorization: Bearer <token>'
{
"cart": {
"id": "4f24a75c-792a-4aff-9265-19deb198be07",
"store": "org_2StqHEqEqKtCH66IJjLb73J2ww6",
"customerId": null,
"addressId": null,
"price": 16000,
"originalPrice": null,
"status": "PENDING",
"createdAt": "2023-07-23T22:04:52.234Z",
"updatedAt": null,
"deletedAt": null,
"products": [
{
"id": "4cf35a0f-7f25-43ef-8e5e-208fbfeb1bd0",
"store": "org_2StqHEqEqKtCH66IJjLb73J2ww6",
"status": "ACTIVE",
"name": "A Tormenta de Espadas",
"slug": "a-tormenta-de-espadas",
"description": "<p>Terceiro livro da série</p>",
"price": 8000,
"originalPrice": 12000,
"quantity": 10,
"sku": "LI-004",
"createdAt": "2023-07-22T00:51:44.685Z",
"updatedAt": "2023-07-23T22:04:32.178Z",
"deletedAt": null,
"order": {
"quantity": 2,
"price": 16000
}
}
]
}
}
Show child attributes
PENDING
.Show child attributes
DRAFT | ACTIVE
string
com HTML
Stock Keeping Unit
, pode
ser o código de barras de um produto úniconull
{
"cart": {
"id": "4f24a75c-792a-4aff-9265-19deb198be07",
"store": "org_2StqHEqEqKtCH66IJjLb73J2ww6",
"customerId": null,
"addressId": null,
"price": 16000,
"originalPrice": null,
"status": "PENDING",
"createdAt": "2023-07-23T22:04:52.234Z",
"updatedAt": null,
"deletedAt": null,
"products": [
{
"id": "4cf35a0f-7f25-43ef-8e5e-208fbfeb1bd0",
"store": "org_2StqHEqEqKtCH66IJjLb73J2ww6",
"status": "ACTIVE",
"name": "A Tormenta de Espadas",
"slug": "a-tormenta-de-espadas",
"description": "<p>Terceiro livro da série</p>",
"price": 8000,
"originalPrice": 12000,
"quantity": 10,
"sku": "LI-004",
"createdAt": "2023-07-22T00:51:44.685Z",
"updatedAt": "2023-07-23T22:04:32.178Z",
"deletedAt": null,
"order": {
"quantity": 2,
"price": 16000
}
}
]
}
}