← Back to EcomCentral
BRICKLINK DEVELOPER API v1

BrickLink Setup Guide

Connect your BrickLink store to EcomCentral using the Store API v1 with OAuth 1.0a (HMAC-SHA1) authentication.

Prerequisites

ℹ️ BrickLink uses OAuth 1.0a with HMAC-SHA1 signatures — not OAuth 2.0. No redirect or browser flow is required. EcomCentral signs every API request automatically using your four credentials.

Getting Your API Credentials

  1. Log in to your BrickLink account and go to My BrickLink → Settings → API (or visit bricklink.com/v3/api.page)
  2. Click Register as a developer if you have not already done so
  3. Under Access Token Registration, click Add access token
  4. Fill in a name and the IP address of your server (or leave blank for all IPs if in development)
  5. Save — you will receive four values: Consumer Key, Consumer Secret, Token Value, and Token Secret
  6. In EcomCentral, add a new BrickLink connection and enter all four values
  7. Click ⚡ Test — a successful orders fetch confirms the credentials work
⚠️ All four credential values are required. A missing or incorrect value will result in an oauth_problem=signature_invalid error from BrickLink.

Credentials Reference

KeyRequiredDescriptionExample
consumer_key Required OAuth 1.0a Consumer Key from BrickLink API settings XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
consumer_secret Required OAuth 1.0a Consumer Secret XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
token Required OAuth 1.0a Token Value (Access Token) XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
token_secret Required OAuth 1.0a Token Secret XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
✅ Alternative key names accepted: consumerKey / consumerSecret / tokenValue / tokenSecret.

OAuth 1.0a Signing

Every request to the BrickLink API is signed using HMAC-SHA1. EcomCentral handles this automatically — you never need to generate signatures manually. Here is how it works for reference:

  1. Build OAuth parameters: oauth_consumer_key, oauth_nonce, oauth_signature_method=HMAC-SHA1, oauth_timestamp, oauth_token, oauth_version=1.0
  2. Merge query parameters with OAuth parameters → percent-encode and sort → build parameter string
  3. Create signature base string: METHOD&percent(url)&percent(paramStr)
  4. Sign with HMAC-SHA1 using key: percent(consumer_secret)&percent(token_secret)
  5. Add oauth_signature to OAuth params → build Authorization: OAuth … header
ℹ️ GET query parameters are included in the OAuth signature base string. JSON request bodies (PUT/POST) are not included in the signature.

API Endpoints Used

OperationMethodEndpoint
Test connection / list ordersGET/orders?direction=in&page=1&page_size=1
List orders (paginated)GET/orders?direction=in&page=P&page_size=N
Order detailGET/orders/{order_id}
Order itemsGET/orders/{order_id}/items
Update order (tracking / status)PUT/orders/{order_id}
List inventories (paginated)GET/inventories?page=P&page_size=N
Inventory item detailGET/inventories/{inventory_id}
Update inventory quantityPUT/inventories/{inventory_id}
ℹ️ Base URL: https://api.bricklink.com/api/store/v1. All requests include an Authorization: OAuth … header generated via HMAC-SHA1.

Order Statuses

StatusColorMeaning
PENDING Amber Order placed, awaiting seller action
UPDATED Blue Order details have been updated
PROCESSING Amber Seller is preparing the order
READY Amber Order is ready to be shipped
PAID Blue Payment received from buyer
PACKED Amber Order has been packed
SHIPPED Green Order shipped; tracking submitted
RECEIVED Green Buyer confirmed receipt
COMPLETED Green Order fully completed; feedback exchanged
OCR Blue On-site credit request filed
NPB Red Non-paying buyer (strike filed)
NPX Red NPB exception granted
NRS Red Non-responsive seller
NSS Red Non-shipping seller
CANCELLED Red Order cancelled
PURGED Red Order purged from the system

Supported Features

FeatureSupportedNotes
View orders (paginated)Order ID, buyer name, date, status, currency + total; inbound orders only
View order detailFull order data: buyer, shipping address, payment info, and all line items
Add tracking / mark shippedSubmits tracking number + link and sets status to SHIPPED in one PUT request
View inventory (paginated)Part no, name, color, condition, unit price, quantity; projected from /inventories
Inventory detailFull inventory item: color hex, type, category, description
Update stock quantityKeyed by inventory_id (integer), not by part number or SKU string
Test connectionFetches page 1 of inbound orders — a 200 response confirms all four OAuth credentials are valid
⚠️ Stock updates use inventory_id, not part number. BrickLink's PUT /inventories/{id} endpoint is keyed by the integer inventory_id assigned when you listed the item. The EcomCentral stock update form pre-fills this value from the inventory list row.

Troubleshooting

✕ Connection test fails — signature_invalid

One or more of the four OAuth credentials is incorrect. Double-check all four values in the BrickLink API settings page. Whitespace or a truncated copy-paste is a common cause — each credential is a long alphanumeric string with no spaces.

✕ 401 Unauthorized — IP not allowed

When registering your access token on BrickLink, you may have restricted it to specific IP addresses. Add your server's public IP (or leave blank during development). Find the restriction under My BrickLink → Settings → API → Access Token Registration.

✕ add_tracking fails

BrickLink only allows status changes in a valid forward direction. Orders already in COMPLETED, CANCELLED, or PURGED status cannot be marked SHIPPED. Verify the current order status before submitting tracking.

✕ update_stock returns 404

Ensure you are using the inventory_id (an integer assigned by BrickLink), not the part number (item.no). The EcomCentral inventory table shows the inventory_id in the first column; it is also pre-filled in the stock update form.

✕ No orders returned

EcomCentral fetches direction=in (buyer orders placed in your store). If you have no inbound orders for the period, the list will be empty. Check your BrickLink store dashboard to confirm there are open orders.