Overposting, also called mass assignment, occurs when an API binds many client-supplied fields directly to an application object or database model. A client may then change fields reserved for server-controlled workflows. section 4.6.1
Changing a payment status
A payment API should accept an amount and currency, then manage statuses such as pending, accepted, settled, or rejected. If it constructs a payment from the entire request, a client can submit status: accepted and bypass the intended payment lifecycle. Sensitive fields can include order status, discounts, loyalty points, and access privileges. section 4.6.1
Prevent overposting by:
- Avoiding direct binding of unrestricted request data to database models, and testing inputs continuously for unauthorized field changes. section 1.8
Figure 4.6 A payment goes through a life cycle with stages such as pending, accepted, settled, and rejected. Those stages can be documented as an enumeration in an OpenAPI schema.
Use the payment lifecycle and its OpenAPI enumeration to distinguish client-settable payment data from server-controlled status transitions. section 4.6.1

