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.

      • Related Articles

      • What Amasty extensions support API?

        Each Amasty extension that has API support, includes the etc/webapi.xml file. The webapi.xml file contains API configurations with the list of available API requests. For example, a request from the Custom Form module interface: 1 - endpoint URL; 2 - ...
      • Gift Card API

        We have created public API collections for Gift Card module and its Gift Card Account 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 ...
      • Can I test how your modules work with API?

        Our team have created a public Postman workspace where we provide access to API collections from our modules. You can copy these API collections to test them in your own Magento installation together with our modules, and some collections can be ...
      • One Step Checkout API

        We have created public API collections for One Step Checkout module, as well its One Step Checkout Delivery Date and One Step Checkout Gift Wrap submodules, with all available queries and sample data that you can both test via our demo endpoints and ...
      • Request a Quote API

        We have created a public API collection for Request a Quote with sample queries and data, you can copy it to run local tests in your Magento environment. More details about using public collections can be found in the following FAQ post. 1. ...