Authorization: Bearer ********************curl --location --request PUT '/desktop/transactions/update-cashin/1743715' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"sales": [
{
"sale_id": 48300,
"product_id": 20092,
"product_variant_id": 20654,
"quantity": 1,
"unit": "Crates",
"amount": 2500
},
{
"sale_id": 48301,
"product_id": 20091,
"product_variant_id": 20650,
"quantity": 1,
"unit": "Crates",
"amount": 4000
},
{
"sale_id": 20649,
"product_id": 20091,
"product_variant_id": null,
"quantity": 1,
"unit": "Crates",
"amount": 3600
}
],
"payment_type": "unpaid",
"unpaid_remind_date": "2024-08-22T14:41:13.038Z",
"transaction_date": "2024-08-15T14:39:56.173Z",
"unpaid_balance": 11574.75,
"discount": 5,
"discount_type": "percent",
"tax": 5,
"delivery_fee": 1500,
"delivery_date": "2024-08-17T14:41:13.038Z",
"customer_id": 3448
}'{
"success": true,
"message": "Transaction added successfully!",
"data": {
"totalSalesAmount": 1499,
"salesWithProfit": [
{
"sale_id": 47469,
"product_id": 20256,
"product_variant_id": 20958,
"quantity": 3,
"unit": "pieces",
"amount": 1500,
"profit": 1168.04,
"type": "product",
"discount": 1
}
],
"totalProductProfit": 1168.04,
"totalServiceProfit": 0,
"totalTransactionProfit": 1168.04,
"totalProductQuantity": 3,
"totalServiceCount": 0,
"totalTransactionQuantity": 3
}
}