Developer Reference
API documentation, webhook endpoints, and code examples
v2.4
API Version
99.98%
Uptime (30d)
184ms
Avg Response
48,291
API Calls (30d)
API Keys
Production Key
gcrm_live_sk_4f8a2b...c9e1
Created 2025-01-15
Full Access
Staging Key
gcrm_test_sk_7d3e1a...f4b2
Created 2025-02-01
Read/Write
POS Terminal Key
gcrm_pos_pk_9c4b6e...a2d8
Created 2025-03-10
POS Only
Webhook Secret
gcrm_whk_sc_1a7f5d...b3c6
Created 2024-12-01
Webhooks
REST API Endpoints
GET
/api/v2/products
List all products
GET
/api/v2/products/{id}
Get single product
POST
/api/v2/products
Create product
PUT
/api/v2/products/{id}
Update product
DELETE
/api/v2/products/{id}
Delete product
GET
/api/v2/orders
List orders
POST
/api/v2/orders
Create order
GET
/api/v2/customers
List customers
POST
/api/v2/checkout
Initiate checkout
GET
/api/v2/inventory
Stock levels
Webhook Events
order.created
Fires when a new order is placed
order.paid
Fires when payment is confirmed
order.shipped
Fires when order is dispatched
order.delivered
Fires when order is delivered
product.updated
Fires on product changes
product.low_stock
Fires when stock drops below threshold
customer.registered
New customer sign-up
subscription.renewed
Subscription auto-renewed
refund.processed
Refund completed
cart.abandoned
Cart inactive > 30 min
Code Examples
# List all products curl -X GET https://cosmocode.co.za/api/v2/products \ -H "Authorization: Bearer gcrm_live_sk_4f8a2b...c9e1" \ -H "Content-Type: application/json" # Create a new order curl -X POST https://cosmocode.co.za/api/v2/orders \ -H "Authorization: Bearer gcrm_live_sk_4f8a2b...c9e1" \ -H "Content-Type: application/json" \ -d '{ "customer_id": 1042, "items": [ {"product_id": 15, "quantity": 2}, {"product_id": 28, "quantity": 1} ], "shipping_method": "standard" }'