id in the request body — this endpoint uses the same URL as Add New Package.id selects the recordid creates a new package instead of updating one, and still replies with an "Added Successfully" message. Always send id.| Field | Left out of the body |
|---|---|
branch_id | Set to null — the package loses its branch and stops appearing in Get All Packages |
product_id | Set to null — the package is unlinked from its product |
branch_id and product_id on every update, even when they are not changing.null for name, description, price, period_value, period_unit, status or type leaves the current value untouched. Send an empty string ("") to clear a text field.Accept: application/jsonAccept: application/json.Package Added Successfully — the same wording as a create. Do not read it as proof that a new package was inserted; check the id you sent.id that does not exist returns 400 with "error": "Record Not Found", not 404.modified is refreshed automatically; created and deleted_at should be omitted.curl --location --globoff 'https://.daftara.com/api2/package' \
--header 'Accept: application/json' \
--header 'apikey: ' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": 7,
"name": "Gold Membership",
"type": "membership",
"price": 300,
"period_value": 1,
"period_unit": "monthly",
"status": 1,
"description": "Unlimited access",
"product_id": null,
"branch_id": 1
}'{
"message": "Package Added Successfully",
"id": 7
}