I am using a script that creates a MembershipPayment to connect an existing Membership to an existing Contribution (bugfix for CiviSepa). This script produces the following error:
Deprecated: Not having valid line items for membership payments is invalid. Caller: CRM_Contribute_BAO_Contribution::updateMembershipBasedOnCompletionOfContribution
In order to fix this, I thought I should switch to create the MembershipPayment via Order API instead of using
civicrm_api3('MembershipPayment', 'create', [...]);
In the CiviCRM documentation, it is clearly recommended to use the Order API for managing Contributions, Memberships etc. At the same time, it is also recommended to use APIv4 instead of APIv3 for all future projects: "APIv3 is now minimally maintained with no new features and regression bug-fixes only. Your code can use a combination of v3 and v4 API calls, but v4 is recommended for all new projects."
The problem is that the Order API doesn't even exist in API v4. I cannot choose the entity Order from the drop down menue in APIv4 Explorer.
Where does this contradiction come from? Which advice should I follow?