Beta
Not authenticated — log in first
Vendor

Vendor API

Authenticated REST API for a single vendor — profile, products, orders, shipments, and bulk import.

What this means in plain English

The Vendor API is for suppliers integrating with G-Commerce on behalf of one vendor account. Every endpoint requires authentication. Start at Login — your token is saved automatically and reused across all Try it panels.

Getting started

  1. Log inPOST /api/v1/auth/login with your vendor user credentials.
  2. Session saved — The docs portal stores your access_token from the login response.
  3. Call vendor endpoints — Open any page below and click Send request. Your token is pre-filled.

Session bar

Check the toolbar at the top right — it shows whether you are authenticated and which vendor is active. Use Clear to reset the session.

Authentication headers

Every vendor endpoint requires:

HeaderValue
AuthorizationBearer {access_token} from login

Vendor context

Your vendor is resolved from the account on your token. There is no vendor header to send, and no vendorId to include in request bodies.

Vendor roles

RoleReadWrite (create/update/delete)
OWNERYesYes
ADMINYesYes
EDITORYesYes
VIEWERYesNo

Write operations require OWNER, ADMIN, or EDITOR.

Product approval

New products require platform admin approval before they appear on storefronts. Edits to already-live products use a separate staging flow so the storefront keeps showing the current data until an admin approves.

ActionWhat happens
Create productStored as PENDING_APPROVAL until admin publishes
Update live product (PUBLISHED / HIDDEN) — name, shortDescription, description, or imagesStaged in pendingRevision; status stays PUBLISHED; storefront shows live fields
Update non-live product (PENDING_APPROVAL / DRAFT) — moderated fieldsApplied directly to the product row
Stock / vendor price (cost) / MSRP / slug / metadata / bulk updateApplied immediately; no re-approval. Customer retail price is derived from vendor price × commission.
Bulk upload (feed)New products start as PENDING_APPROVAL
Replace images (PUT …/images)Same staging rules as PATCH images on live products

Tracking approval:

  • First-time publish: GET /vendor/products?status=PENDING_APPROVAL or ?needsModeration=true until status becomes PUBLISHED.
  • Staged live edits: GET /vendor/products/:id — top-level name / description / images are still live; proposed values are under pendingRevision. Filter with ?hasPendingRevision=true or ?needsModeration=true.

The vendor REST API does not accept a status field on create or update.

API sections

All paths use the singular /vendor/ prefix and are scoped to your authenticated vendor.

SectionBase pathDescription
Profile/vendor/me/profileProfile and logo
Shipping Methods/vendor/me/shipping-methodsShipping options
Categories/vendor/categoriesRead-only G-Commerce category trees (lookup IDs for product categoryIds)
Products/vendor/productsCatalog CRUD
Bulk Operations/vendor/products/bulk-*Bulk update, upload, export
Orders/vendor/ordersSuborder fulfillment
Purchase Orders/vendor/purchase-ordersThe same orders priced at your vendor cost
Shipments/vendor/shipmentsTracking and fulfillment

Base URL: https://api.next.gcommerce.glass/api/v1 (production) or https://sandbox.api.next.gcommerce.glass/api/v1 (local).

Media URLs (images & documents)

Product images, vendor logos, category images, order line imageUrl, and uploaded document paths are returned as absolute public URLs:

{API_ORIGIN}/assets/{storage-path}

{API_ORIGIN} is the cockpit host (from GLASS_COCKPIT_URL), e.g. https://api.next.gcommerce.glass or http://localhost:8080 locally.

FieldExample
images[].url{API_ORIGIN}/assets/products/…/images/…
image (vendor logo){API_ORIGIN}/assets/vendors/logos/…
image (category){API_ORIGIN}/assets/categories/…
items[].imageUrl (orders){API_ORIGIN}/assets/products/…
documents[].document{API_ORIGIN}/assets/products/…/docs/…

These links are public (no auth on the image URL). External http(s) URLs are returned unchanged.

How to upload images

EndpointUpload styleNotes
POST /vendor/me/logomultipart fileReplaces existing logo. Requires OWNER, ADMIN, or EDITOR.
POST /vendor/products/:id/imagesmultipart file + optional text fieldsAdd one image. Staged on live products. Requires OWNER, ADMIN, or EDITOR.
PUT /vendor/products/:id/imagesmultipart images files + optional metadata JSON partReplace full set. Requires OWNER, ADMIN, or EDITOR.
Bulk uploadExternal URL strings (///-separated)Fetched server-side — not the same as returned /assets/… paths.

Create/update product JSON bodies do not accept image files — upload images with the endpoints above after the product exists.

Live testing

Each endpoint page has a Try it panel. After logging in once, token and vendor ID flow automatically to every vendor endpoint — no need to copy-paste again. Multipart upload pages are copy-only (use curl).