← Back to EcomCentral
CS-CART REST API 1.0

CS-Cart Setup Guide

Connect your CS-Cart store to EcomCentral using HTTP Basic authentication with your admin email and auto-generated API key.

Prerequisites

ℹ️ CS-Cart uses HTTP Basic authentication: your admin email as the username and the auto-generated API key as the password. No OAuth flow is required. The API base URL follows the pattern: https://your-store.com/api/

Generating Your API Key

  1. Log in to your CS-Cart administration panel
  2. Click your name or avatar in the top-right corner and select Profile
  3. Scroll down to the API Access section
  4. Click Generate API key — a new key will appear immediately
  5. Copy and save the key (it is shown only once; regenerating creates a new key)
  6. In EcomCentral, add a new CS-Cart connection with your store URL, admin email, and API key
  7. Click ⚡ Test — a successful test returns the total number of orders in your store
⚠️ Regenerating your API key invalidates the old one immediately. If you regenerate, update the key in EcomCentral as well.

Credentials Reference

KeyRequiredDescriptionExample
base_url Required The full URL of your CS-Cart store (with or without /api — EcomCentral appends it automatically) https://store.example.com
email Required Administrator email address used to log in to the CS-Cart admin panel admin@example.com
api_key Required Auto-generated API key from Profile → API Access in the admin panel a1b2c3d4e5f6…
✅ Alternative key names accepted: baseUrl, store_url, or url for the store URL; user or login for the email; apiKey or key for the API key.

API Endpoints Used

OperationMethodEndpoint
Test connectionGET/api/orders?page=1&items_per_page=1
List ordersGET/api/orders?page=P&items_per_page=N
Order detailGET/api/orders/{id}
List productsGET/api/products?page=P&items_per_page=N
Product detailGET/api/products/{id}
Update stockPUT/api/products/{id} with { "amount": "N" }
Create shipmentPOST/api/shipments with order_id, shipping_id, products map, tracking_number, carrier
ℹ️ CS-Cart REST API 1.0 uses a consistent URL pattern: https://store/api/:object for lists and https://store/api/:object/:id for single resources. All responses are JSON; write operations require Content-Type: application/json.

Order Status Codes

CodeLabelMeaning
O Open Order has been placed and is awaiting processing
P Processed Payment has been received and the order is being fulfilled
C Complete Order has been fully shipped and delivered
F Failed Payment or order processing failed
D Declined Order was declined (e.g. by fraud check or manually)
B Backordered One or more items are out of stock; order is waiting
I Cancelled Order has been cancelled
Y Awaiting Call Order requires a call-back before it can be processed

Supported Features

FeatureSupportedNotes
View orders (paginated)Order ID, date (UNIX timestamp), status code, total
View order detailCustomer info, shipping & billing addresses, line items, shipping method, tracking
Add tracking / create shipmentTracking number + carrier; EcomCentral automatically derives shipping_id and products map from the order
View products (paginated)Product ID, SKU (product_code), name, price, stock (amount)
View product detailFull product data including description, image, category, and current stock
Update stock quantityBy product_id via PUT /api/products/{id} with { "amount": "N" }
Test connectionReturns total order count from the orders list endpoint
ℹ️ Shipment creation note: The CS-Cart API requires a shipping_id and a products map (cart item ID → quantity) when creating a shipment. EcomCentral handles this automatically by fetching the full order before posting the shipment — you only need to supply the tracking number and optional carrier name.

Troubleshooting

✕ 401 Unauthorized

The email or API key is incorrect, or the key was regenerated after saving the connection. Go to Profile → API Access in your CS-Cart admin panel, regenerate the key if necessary, and update the connection in EcomCentral.

✕ 403 Forbidden

The admin account does not have sufficient privileges to access the API, or the store URL is incorrect. Ensure the account used is a root administrator (not a restricted admin group).

✕ Connection error / SSL error

Verify that the base_url is correct and that your CS-Cart store has a valid SSL certificate. EcomCentral connects over HTTPS with peer verification enabled.

✕ Shipment creation fails with "Could not determine shipping_id"

CS-Cart requires a shipping_id linked to the order's selected shipping method. This is resolved automatically from the order's shipping array. If the order was created without a shipping method (e.g. downloadable products or manual orders), the shipment API call cannot proceed.

✕ Shipment creation fails with "No shippable line items"

The order's products map returned no items with a quantity greater than zero. This can happen with refunded or voided orders. Verify the order in the CS-Cart admin panel before retrying.