B2B Company Account API Overview

B2B Company Account API

Info
We have created public API collections for B2B Company Account module and its Company Account Address submodule with all available queries and sample data that you can both test via our demo endpoints and copy to run local tests in your Magento environment. More details about using public collections can be found in the following FAQ post.

1. Amasty\CompanyAccount\Api\CompanyRepositoryInterface - class for managing company accounts.
  1. GET /V1/amcompany/company/:companyId, method="getById" - get information about the company by its ID;
  2. POST /V1/amcompany/company, method="save" - create a company account;
  3. PUT /V1/amcompany/company/:companyId, method="save" - edit a company account;
  4. DELETE /V1/amcompany/company/:companyId, method="deleteById" - delete a company account by its ID.

2. Amasty\CompanyAccount\Api\CreditRepositoryInterface - class for managing company credit balance.
  1. PUT /V1/amcompany/credit/:companyId, method="save" - update company account's store credits;
  2. GET /V1/amcompany/credit/:companyId - view company account's store credits

3. Amasty\CompanyAccount\Api\CustomerRepositoryInterface - class for managing users within company accounts.
  1. POST /V1/amcompany/customer/:companyId, method="assignToCompany" - add user to a company account;
  2. DELETE /V1/amcompany/customer/:customerId, method="delete" - delete user from a company account.
Notes
Since v. 2.6.2 we added the ability to fetch the list of all created companies via REST API. You can find the 'amasty/module-company-account-subscription-functionality' package for installing in composer suggest. Kindly note that the feature is available as a part of an active product subscription or support subscription.
     Amasty\CompanyAccount\Api\CompanyRepositoryInterface - class for managing the list of all created companies.
  1.   GET /V1/amcompany/company/all, method="getList" - to get the list of all created companies.