Magento 2 B2B Company Credit Extension supports both REST and GraphQL APIs. You can find them in the two links below.
Here is the list of REST APIs that our Magento 2 B2B Company Credit extension supports.
This table lists the GraphQL APIs that Magento 2 B2B Company Credit extension supports.
Notes for Saving Credit
- credit_limit: a positive number
- update_avaliable: a number
+ Postive integer
+ Not duplicated
+ Do not check whether order_id exists. Do not check whether order_id belongs to the customer or not.
Note: You must provide at least one of the following values: credit_limit, update_available, allow_exceed.
II. Logic for Saving
- Customer has not been assigned companycredit
- The input values: ""order_id"", ""po_number"", ""update_available"" are blank.
- Allow add/update credit_limit, update_available, allow_exceed
The logic is the same as customer account at backend and placing order at frontend
- When there are order_id value and po_number, the action will be Place Order.
- If input value of ""currency_code"" is:
a) null → take the base currency website
b) non-null → Automatically convert upon the base currency website rate, providing that admin configuration has set currency rate.
Note: Graphql allows implementing many actions simultaneously: Change Credit Limit, Place Order, Update Available, Allow Excess.