Magento 2 B2B Extensions

  1. Home
  2. Docs
  3. Magento 2 B2B Extensions
  4. Magento 2 B2B Company Credit
  5. API Support

API Support

Magento 2 B2B Company Credit Extension supports both REST and GraphQL APIs. You can find them in the two links below.

REST API

Here is the list of REST APIs that our Magento 2 B2B Company Credit extension supports.

Magento 2 B2B Company Credit REST API Support

GraphQL API

This table lists the GraphQL APIs that Magento 2 B2B Company Credit extension supports.

Magento 2 B2B Company Credit GraphQL API Support

Notes for Saving Credit

I. Validate

- credit_limit: a positive number

- update_avaliable: a number

- order_id:

+ 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

  1. Customer has not been assigned companycredit

- The input values: ""order_id"", ""po_number"", ""update_available"" are blank. 

  1. Allow add/update credit_limit, update_available, allow_exceed

The logic is the same as customer account at backend and placing order at frontend

  1. When there are order_id value and po_number, the action will be Place Order.
  2. 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.

Was this article helpful to you? Yes No

How can we help?