Connect your Magento 2 store to EcomCentral using the REST API with an Admin Integration Bearer token.
https://shop.example.com)/admin)Sales / Orders — for reading and creating shipmentsCatalog / Products — for reading products and updating stockStores / Store Configs — for the connection testbase_url = your store URL ·
access_token = the token you just copied
| Key | Required | Description | Example |
|---|---|---|---|
base_url |
Required | Root URL of your Magento 2 store — no trailing slash | https://shop.example.com |
access_token |
Required | Admin Integration access token from System → Integrations | a1b2c3d4e5f6… |
store_code |
Optional | Magento store view code. Defaults to default if omitted |
default |
baseUrl / url for base URL;
accessToken / token for the access token;
storeCode for the store view.
| Operation | Method | Endpoint |
|---|---|---|
| Test connection | GET | /rest/V1/store/storeConfigs |
| List orders | GET | /rest/V1/orders?searchCriteria[…] |
| Order detail | GET | /rest/V1/orders/{id} |
| Create shipment | POST | /rest/V1/order/{id}/ship |
| Add order comment | POST | /rest/V1/orders/{id}/comments |
| List products | GET | /rest/V1/products?searchCriteria[…] |
| Product detail | GET | /rest/V1/products/{sku} |
| Update stock | PUT | /rest/V1/products/{sku} |
| Feature | Supported | Notes |
|---|---|---|
| View orders (paginated) | ✅ | Sorted by created_at DESC |
| View order detail | ✅ | Billing + shipping address, line items, totals, order history |
| Create shipment + tracking | ✅ | POST /ship — returns new shipment ID |
| Add status comment | ✅ | Change status + optional customer email notify |
| View products (paginated) | ✅ | Name, SKU, price, stock qty |
| Update stock quantity | ✅ | PUT product with stock_item.qty |
| Multi-store views | ✅ | Set store_code per connection |
| Test connection | ✅ | Returns store count + base currency |
The access token is invalid or expired. Regenerate the integration token in System → Integrations and update the connection credential.
The integration token lacks permission for the requested resource. Edit the integration, expand the API resource tree, and ensure Sales/Orders and Catalog/Products are checked.
Your Magento store must use a valid HTTPS certificate. Self-signed certs on staging
environments will be rejected. Either use a trusted cert or set up a Let's Encrypt certificate.
For dev only, you can disable peer verification in Magento2Client.php
(CURLOPT_SSL_VERIFYPEER => false).
Magento 2.3+ with Multi-Source Inventory (MSI) uses a different stock
architecture. The stock update via stock_item.qty targets the legacy CatalogInventory
table. For MSI, use the dedicated
PUT /rest/V1/inventory/source-items endpoint — you would need to extend
Magento2Client.php to support it.
The entity_id (numeric ID) does not exist. Note that the orders list uses
entity_id internally — this is different from the visible increment_id
(e.g. #000000123). EcomCentral passes the correct entity_id automatically.