Global Cannabis Product

Global Cannabis Products is now onboarding verified partners for secure international trade infrastructure

API Documentation | Global Cannabis Products
Developer Documentation

Build on the
GCP API

Integrate with the world's most trusted cannabis B2B platform. Full REST API access to marketplace, inventory, compliance, logistics, and analytics.

API v2.1 — Latest
api.globalcannabisproduct.com/v2
// Fetch marketplace products
GET /v2/marketplace/products

// Headers
{
  "Authorization": "Bearer gcp_sk_live_...",
  "Content-Type": "application/json"
}

// Response
{
  "status": "success",
  "data": {
    "products": [...],
    "total": 12000,
    "page": 1
  }
}
REST API Webhooks OAuth 2.0 JSON Rate Limiting SDK Real-Time Events Sandbox
REST API Webhooks OAuth 2.0 JSON Rate Limiting SDK Real-Time Events Sandbox
REST API Webhooks OAuth 2.0 JSON Rate Limiting SDK Real-Time Events Sandbox
REST API Webhooks OAuth 2.0 JSON Rate Limiting SDK Real-Time Events Sandbox
Getting Started

API Quick Start

Get up and running with the GCP API in under 5 minutes. This guide covers authentication, your first API call, and essential concepts.

Base URL

Base URL
https://api.globalcannabisproduct.com/v2

Sandbox Available

Use https://sandbox-api.globalcannabisproduct.com/v2 for testing. Sandbox data resets every 24 hours.

1. Get Your API Keys

Generate API keys from your Dashboard → Settings → API Keys. You'll receive:

  • gcp_pk_live_... — Public key (safe for client-side)
  • gcp_sk_live_... — Secret key (server-side only, never expose)

2. Make Your First Request

cURL
curl -X GET "https://api.globalcannabisproduct.com/v2/marketplace/products" \
  -H "Authorization: Bearer gcp_sk_live_your_key_here" \
  -H "Content-Type: application/json"

3. Install an SDK

Node.js / Python / PHP
# Node.js
npm install @globalcannabis/sdk

# Python
pip install globalcannabis-sdk

# PHP
composer require globalcannabis/sdk

4. Initialize the Client

JavaScript
import { GCPClient } from '@globalcannabis/sdk';

const gcp = new GCPClient({
  apiKey: 'gcp_sk_live_your_key_here',
  environment: 'production' // or 'sandbox'
});

// Fetch products
const products = await gcp.marketplace.getProducts({
  category: 'cbd',
  page: 1,
  limit: 20
});

console.log(products);
Security

Authentication

All API requests require authentication via a Bearer token in the Authorization header.

Header Format

HTTP Header
Authorization: Bearer gcp_sk_live_abc123def456ghi789

OAuth 2.0 (For User-Scoped Access)

For applications that act on behalf of a user, implement OAuth 2.0 Authorization Code flow.

OAuth Flow
// Step 1: Redirect user to authorization URL
const authUrl = `https://auth.globalcannabisproduct.com/oauth/authorize`
  + `?client_id=YOUR_CLIENT_ID`
  + `&redirect_uri=https://yourapp.com/callback`
  + `&response_type=code`
  + `&scope=marketplace:read orders:write`;

// Step 2: Exchange code for token
const token = await fetch('https://auth.globalcannabisproduct.com/oauth/token', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    grant_type: 'authorization_code',
    code: 'AUTH_CODE_FROM_CALLBACK',
    client_id: 'YOUR_CLIENT_ID',
    client_secret: 'YOUR_CLIENT_SECRET',
    redirect_uri: 'https://yourapp.com/callback'
  })
});

Keep Your Secret Key Safe

Never expose your gcp_sk_ key in client-side code, public repositories, or browser requests. Use environment variables on your server.

Rate Limits

API requests are rate-limited per API key to ensure platform stability.

PlanRequests / MinuteRequests / DayBurst
Starter6010,00010 req/sec
Growth300100,00050 req/sec
Enterprise1,000Unlimited200 req/sec

Rate limit headers are included in every response:

Response Headers
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 297
X-RateLimit-Reset: 1711234567

Error Handling

The API uses standard HTTP status codes. All error responses include a JSON body with details.

Error Response
{
  "status": "error",
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The API key provided is invalid or expired.",
    "doc_url": "https://docs.globalcannabisproduct.com/errors/INVALID_API_KEY"
  }
}
CodeStatusDescription
INVALID_API_KEY401API key is missing, invalid, or expired
PERMISSION_DENIED403Key doesn't have permission for this endpoint
NOT_FOUND404Resource doesn't exist
VALIDATION_ERROR422Request body has invalid parameters
RATE_LIMITED429Too many requests — retry after reset
SERVER_ERROR500Internal error — contact support
API Reference

All Endpoints

Complete list of available API endpoints grouped by resource.

Marketplace

MethodEndpointDescription
GET/v2/marketplace/productsList all marketplace products
GET/v2/marketplace/products/:idGet single product details
GET/v2/marketplace/categoriesList product categories
GET/v2/marketplace/producersList verified producers

Inventory

MethodEndpointDescription
GET/v2/inventoryList your inventory items
POST/v2/inventoryAdd new inventory item
PUT/v2/inventory/:idUpdate inventory item
DELETE/v2/inventory/:idRemove inventory item

Orders

MethodEndpointDescription
GET/v2/ordersList all orders
POST/v2/ordersCreate new order
GET/v2/orders/:idGet order details
PUT/v2/orders/:id/statusUpdate order status

Tracking

MethodEndpointDescription
GET/v2/track/:tracking_idGet shipment tracking data
GET/v2/track/:id/climateGet climate sensor readings
GET/v2/track/:id/timelineGet tracking timeline events

Compliance

MethodEndpointDescription
GET/v2/compliance/statusGet account compliance status
GET/v2/compliance/documentsList compliance documents
POST/v2/compliance/documents/generateAuto-generate compliance doc

Marketplace API

Search, filter, and retrieve products from the global marketplace.

List Products

GET /v2/marketplace/products
GET /v2/marketplace/products?category=cbd&origin=canada&page=1&limit=20

Query Parameters

ParameterTypeRequiredDescription
categorystringOptionalFilter by category: cbd, extract, flower, edible, preroll
originstringOptionalFilter by origin country
searchstringOptionalFull-text search across product names and descriptions
min_pricenumberOptionalMinimum price filter (per kg)
max_pricenumberOptionalMaximum price filter (per kg)
pageintegerOptionalPage number (default: 1)
limitintegerOptionalResults per page (max: 100, default: 20)
sortstringOptionalSort by: price_asc, price_desc, name, newest

Response

200 OK
{
  "status": "success",
  "data": {
    "products": [
      {
        "id": "prod_abc123",
        "name": "CBD Isolate 99.5% Pure",
        "category": "CBD Products",
        "price": 850,
        "unit": "kg",
        "origin": "Canada",
        "producer": {
          "id": "prod_xyz789",
          "name": "Your Brand",
          "verified": true
        },
        "certifications": ["GMP", "Organic", "COA"],
        "image_url": "https://cdn.gcp.com/products/cbd-isolate.jpg"
      }
    ],
    "pagination": {
      "total": 1200,
      "page": 1,
      "limit": 20,
      "pages": 60
    }
  }
}

Inventory API

Manage your product inventory across all warehouse locations.

Get Inventory

JavaScript
const inventory = await gcp.inventory.list({
  location: 'toronto',
  category: 'extract',
  low_stock: true  // Only items below reorder threshold
});

console.log(inventory.items);
// [{ id: "inv_001", product: "THC Distillate 92%", quantity: 500, ... }]

Orders API

Create and manage trade orders programmatically.

Create an Order

JavaScript
const order = await gcp.orders.create({
  product_id: 'prod_abc123',
  quantity: 100,
  unit: 'kg',
  shipping_address: {
    name: 'Acme Cannabis',
    address: '123 Trade St',
    city: 'Amsterdam',
    country: 'NL',
    postal_code: '1012 AB'
  },
  shipping_method: 'air_freight',
  payment_method: 'escrow'
});

console.log(order.id); // "ord_xyz456"

Tracking API

Real-time shipment tracking with GPS, climate, and compliance data.

Track Shipment

JavaScript
const tracking = await gcp.track.getShipment('GCP-4821');

console.log(tracking.status);    // "in_transit"
console.log(tracking.location);  // { lat: 52.3, lng: 4.9 }
console.log(tracking.eta);        // "2025-03-18T14:00:00Z"
console.log(tracking.climate);   // { temp: 4.2, humidity: 52 }

Compliance API

Manage regulatory compliance documents and status.

Generate Compliance Document

JavaScript
const doc = await gcp.compliance.generateDocument({
  type: 'certificate_of_origin',
  order_id: 'ord_xyz456',
  format: 'pdf'
});

console.log(doc.download_url); // "https://cdn.gcp.com/docs/..."
Advanced

Webhooks

Receive real-time notifications when events occur on your account.

Available Events

EventDescription
order.createdA new order has been placed
order.paidEscrow has been funded
order.shippedOrder has been shipped
order.deliveredDelivery confirmed
tracking.updatedShipment location or status changed
compliance.alertCompliance document expiring or required
inventory.lowInventory item below reorder threshold

Webhook Payload

POST /your-webhook-url
{
  "event": "order.shipped",
  "timestamp": "2025-03-15T14:30:00Z",
  "data": {
    "order_id": "ord_xyz456",
    "tracking_id": "GCP-4821",
    "carrier": "DHL Express",
    "eta": "2025-03-18T14:00:00Z"
  },
  "signature": "sha256=abc123..."
}

Verify Webhook Signatures

Always verify the signature field using your webhook secret to prevent spoofed requests. See our Security Guide for implementation details.

SDKs & Libraries

Official client libraries to accelerate your integration.

LanguagePackageInstall
JavaScript / Node.js@globalcannabis/sdknpm install @globalcannabis/sdk
Pythonglobalcannabis-sdkpip install globalcannabis-sdk
PHPglobalcannabis/sdkcomposer require globalcannabis/sdk
Rubyglobalcannabis-rubygem install globalcannabis-ruby

Need Help?

Contact our developer support at api-support@globalcannabisproduct.com or join our Developer Discord community for real-time assistance.