- Edit Visit
Update the attendance status, bill comment, Services, Product Items, and payments of a visit.
This is a replace operation for the whole visit.
servicesandgoods_transactionsreplace every Service line and every Product Item of the visit, not only those ofrecord_id. A list that is omitted defaults to[]and deletes all its lines. There is no append. Read the visit first and echo every line exactly.
commentis required and overwrites the visit's bill (document) comment, not the Appointment comment. Echo the current bill comment.attendanceis required. When the Business User has the right to sell Products in Appointments, a status other than arrived (1) or confirmed (2) deletes every Product Item of the visit and cancels all its payments.servicesmust list every Service line of every Appointment of the visit, each with itsrecord_id; a line withoutrecord_idreturns422. An Appointment whose lines are missing loses them, and a changed set of Services sends the Booking User a "record changed" message.goods_transactionsmust list every Product Item of the visit. A line withidupdates that line, a line withoutidis created, and an existing line that is not sent is deleted together with any gift card or membership it issued.- Without the right to sell Products in Appointments,
goods_transactionsis ignored and the request still returns200. Read the visit back to confirm the change. This operation does not check the finer Product rights (create, edit, price, discount, and their day limits) that Save Visit Appointments enforces. - A printed sale bill refuses Product Item changes (
400), and refusesdeleted_transaction_ids(422). - When the Location forbids negative stock, a line that would take an Inventory below zero returns
406. Otherwise stock may go negative. - A gift card line needs
good_special_numberunless its type allows an empty code. A membership whose type expires on a specific date needsgood_planned_activation_date. Echo both for existing gift card and membership lines; otherwise the save fails or re-issues them. - Product Item changes re-apply the Booking User's loyalty discount programs to the visit. Send
costfrom the read'smanual_cost, never from the read'scost, which already includes loyalty discounts and would be discounted twice. Read the lines back after the save. - Every save sends the partner webhook "record update" for the Appointments of the visit.
Visit status (2 - The user confirmed the appointment, 1 - The user came, the services were provided, 0 - the user is waiting, -1 - the user did not show)
IDs of visit payments (financial transactions) to delete. Applied only with the Appointment finances right and without fast_payment.
Every Product Item of the visit. The list replaces the visit's Product Items: send each existing line with its id, add a line without id to create it, and leave a line out to delete it.
[ { "id": 2168657, "good_id": 232658, "amount": 1, "price": 15, "discount": 20, "cost": 12, "operation_unit_type": 1, "master_id": 55436, "storage_id": 91303 }, { "good_id": 232659, "amount": 2, "price": 10, "discount": 0, "cost": 20, "operation_unit_type": 1, "master_id": 55436, "storage_id": 91303 } ]
Every Service line of every Appointment of the visit. The list replaces the visit's Service lines; an Appointment whose lines are missing loses them.
[ { "id": 389045, "record_id": 10403702, "first_cost": 300, "discount": 15, "cost": 255, "amount": 1 } ]
- Mock serverhttps://developer.alteg.io/_mock/en/b2b-v1/openapi/visits/{visit_id}/{record_id}
- Productionhttps://api.alteg.io/api/v1/visits/{visit_id}/{record_id}
curl -i -X PUT \
https://developer.alteg.io/_mock/en/b2b-v1/openapi/visits/12345/67890 \
-H 'Accept: application/vnd.api.v2+json' \
-H 'Authorization: Bearer <YOUR_Bearer {PartnerToken}, User {UserToken}_HERE>' \
-H 'Content-Type: */*' \
-d '{
"attendance": 1,
"comment": "",
"goods_transactions": [
{
"id": 2168657,
"good_id": 232658,
"amount": 1,
"price": 15,
"discount": 20,
"cost": 12,
"operation_unit_type": 1,
"master_id": 55436,
"storage_id": 91303
},
{
"good_id": 232659,
"amount": 2,
"price": 10,
"discount": 0,
"cost": 20,
"operation_unit_type": 1,
"master_id": 55436,
"storage_id": 91303
}
],
"services": [
{
"id": 389045,
"record_id": 10403702,
"first_cost": 300,
"discount": 15,
"cost": 255,
"amount": 1
}
]
}'