How to Connect Shopify to API2Cart?
To connect Shopify store to API2Cart you need to specify the following credentials:
Required credentials:
- shopify_access_token - for connection via Custom app
- shopify_shared_secret - is needed to work with Live Shipping Rates or Webhooks
- shopify_client_id - is needed to work with shopify_access_token with an expiration time
Starting from 01.01.2026, creating custom apps in Shopify will no longer be available (apps created before this date will continue to work as before).
App creation will be available through the Developer Dashboard.
To create a new app, log in to the Developer Dashboard and click Create App.
Enter the app name in the App Name field.
Select the required scopes and fill in the Redirect URLs field (if the app will use the Authorization Code Flow for authentication: Authorization Code Flow).
The required scopes for API methods are listed in the table below.
After that, the new app will be available on the dashboard.
The app can be installed on a store directly by clicking the Install button.
Then select the desired store and confirm the app installation.
You can also choose distribution for the app.
There are two types of distribution:
- Public distribution
- Custom distribution
If you choose the Custom distribution type, you need to generate an installation link (multi-store installation is also possible). This link allows the app to be installed by store owners, who will confirm the installation.
Apps installed this way will receive offline tokens with an expiration time. To get an access_token, execute the request:
curl --location 'https://{store_url}.myshopify.com/admin/oauth/access_token' \
--header 'Content-Type: application/json' \
--data '{
"grant_type": "client_credentials",
"client_id": "{client_id}",
"client_secret": "{client_secret}"
}'
Replace client_id and client_secret with values from the app settings.
The response will include access_token, list of scopes, and token expiration time.
Stores with this offline token type must be added to API2Cart with optional parameters shopify_client_id and shopify_shared_secret. This allows token refresh on our side. Without these parameters, the offline token will eventually cause authorization errors and API methods will fail.
To generate an online token with unlimited duration, the app must be authorized using the Authorization Code Flow. Build the authorization URL:
https://{store_url}/admin/oauth/authorize?client_id={client_id}&scope={scopes}&redirect_uri={redirect_uri}&state={nonce}
Where:
- store_url – store URL
- client_id – app client ID
- scopes – scopes used by the app
- redirect_uri – redirect URL specified during app creation
- nonce – random value to unify the authorization request
Note: You can also add grant_options[]=per-user to generate a token with limited duration.
After visiting the authorization link, the store owner will approve app access to the scopes, and a code parameter will be sent to the redirect URL. Use this code in the request:
curl --location 'https://a2c-demo.myshopify.com/admin/oauth/access_token' \
--header 'Content-Type: application/json' \
--data '{
"code": "{code}",
"client_id": "{client_id}",
"client_secret": "{client_secret}"
}'
Where code is the code received at the redirect URL, and client_id / client_secret are the app credentials. This token will have no expiration and will only become invalid if the store owner uninstalls the app.
The obtained access_token can be used as the shopify_access_token parameter to add a store to API2Cart.
Note: For shopify_shared_secret, used to verify webhook signatures and live shipping rates, use the app client secret.
Table of Required Shopify App Scopes for our API Methods:
| Method | Scopes |
|---|---|
| basket.live_shipping_service.list | read_shipping |
| basket.live_shipping_service.create | write_shipping |
| basket.live_shipping_service.delete | write_shipping |
| cart.info | read_products, read_locations,
read_shipping, read_locales |
| cart.catalog_price_rules.count | read_products, read_discounts |
| cart.catalog_price_rules.list | read_products, read_discounts |
| cart.coupon.list | read_products, read_discounts |
| cart.coupon.add | read_products, write_price_rules,
write_discounts |
| cart.coupon.delete | read_products, write_price_rules,
write_discounts |
| cart.coupon.condition.add | read_products, write_price_rules,
write_discounts |
| cart.giftcard.count | read_gift_cards |
| cart.giftcard.list | read_gift_cards |
| cart.giftcard.add | read_customers, write_gift_cards |
| cart.giftcard.delete | write_gift_cards |
| cart.meta_data.list | read_products, read_customers,
read_orders or read_marketplace_orders,
read_locales |
| cart.meta_data.set | read_locales, write_products,
write_orders, write_customers |
| cart.meta_data.unset | write_products, write_orders,
write_customers |
| cart.script.list | read_script_tags |
| cart.script.add | write_script_tags |
| cart.script.delete | write_script_tags |
| cart.shipping_zones.list | read_shipping |
| category.info | read_products, read_locales |
| category.count | read_products |
| category.list | read_products, read_locales |
| category.find | read_products |
| category.assign | write_products |
| category.unassign | write_products |
| category.add | write_products, write_publications |
| category.add.batch | write_products, write_publications |
| category.update | read_locales, write_products,
write_publications |
| category.delete | write_products |
| category.image.add | write_products, write_images or
write_themes |
| category.image.delete | write_products, write_images or
write_themes |
| customer.info | read_customers, read_orders or
read_marketplace_orders |
| customer.count | read_customers |
| customer.list | read_customers, read_orders or
read_marketplace_orders |
| customer.find | read_customers |
| customer.add | write_customers |
| customer.update | write_customers |
| customer.delete | write_customers |
| customer.address.add | write_customers |
| order.info | read_orders or read_marketplace_orders,
read_customers, read_locations,
read_shipping, read_fulfillments,
read_products, read_locales |
| order.count | read_orders or read_marketplace_orders,
read_customers |
| order.list | read_orders or read_marketplace_orders,
read_customers, read_locations,
read_shipping, read_fulfillments,
read_products, read_locales |
| order.find | read_orders or read_marketplace_orders,
read_customers, read_locations,
read_shipping, read_fulfillments,
read_products |
| order.add | write_orders, write_customers,
read_products, read_locales |
| order.update | write_orders |
| order.abandoned.list | read_orders or read_marketplace_orders,
read_customers, read_products |
| order.refund.add | write_orders, read_products |
| order.return.add | write_orders, write_returns |
| order.return.update | write_returns |
| order.shipment.info | read_orders or read_marketplace_orders,
read_customers, read_locations,
read_fulfillments, read_products |
| order.shipment.list | read_orders or read_marketplace_orders,
read_customers, read_locations,
read_fulfillments, read_products |
| order.shipment.add | read_orders or read_marketplace_orders,
read_customers, read_locations,
read_inventory, write_fulfillments,
read_products,
write_merchant_managed_fulfillment_orders,
write_third_party_fulfillment_orders,
write_assigned_fulfillment_orders |
| order.shipment.add.batch | read_orders or read_marketplace_orders,
read_customers, read_locations,
read_inventory, write_fulfillments,
read_products,
write_merchant_managed_fulfillment_orders,
write_third_party_fulfillment_orders,
write_assigned_fulfillment_orders |
| order.shipment.update | read_orders or read_marketplace_orders,
read_inventory, write_fulfillments,
read_products,
write_merchant_managed_fulfillment_orders,
write_third_party_fulfillment_orders,
write_assigned_fulfillment_orders |
| order.shipment.delete | read_orders or read_marketplace_orders,
read_inventory, write_fulfillments,
read_products,
write_merchant_managed_fulfillment_orders,
write_third_party_fulfillment_orders,
write_assigned_fulfillment_orders |
| order.shipment.tracking.add | read_orders or read_marketplace_orders,
read_inventory, write_fulfillments,
read_products,
write_merchant_managed_fulfillment_orders,
write_third_party_fulfillment_orders,
write_assigned_fulfillment_orders |
| order.transaction.list | read_orders or read_marketplace_orders |
| product.info | read_products, read_inventory,
read_locations |
| product.count | read_products |
| product.list | read_products, read_inventory,
read_locations |
| product.find | read_products |
| product.fields | read_products |
| product.add | write_products, read_locations,
write_inventory |
| product.add.batch | write_products, read_locations,
write_inventory |
| product.update | write_products, read_locations,
write_inventory |
| product.update.batch | write_products, read_locations,
write_inventory |
| product.delete | write_products |
| product.delete.batch | write_products |
| product.attribute.list | read_products |
| product.attribute.value.set | write_products |
| product.attribute.value.unset | write_products |
| product.child_item.info | read_products, read_inventory,
read_locations |
| product.child_item.list | read_products, read_inventory,
read_locations |
| product.child_item.find | read_products, read_inventory,
read_locations |
| product.image.add | write_products, write_images or
write_themes |
| product.image.delete | write_products, write_images or
write_themes |
| product.option.add | write_products |
| product.variant.count | read_products |
| product.variant.add | write_products, read_locations,
write_inventory |
| product.variant.add.batch | write_products, read_locations,
write_inventory |
| product.variant.update | write_products, read_locations,
write_inventory |
| product.variant.update.batch | write_products, read_locations,
write_inventory |
| product.variant.delete | write_products |
| product.variant.delete.batch | write_products |
| product.variant.image.delete | write_products, write_images or
write_themes |
| return.info | read_orders, read_returns,
read_customers |
| return.list | read_orders, read_returns,
read_customers |
| tax.class.info | read_products |
| webhook.create | Depending on the entity, the scopes will be the same as for the {entity}.info methods. |