Skip to main content

Overview

The sandbox environment lets you test your integration without:
  • Creating real shipments
  • Incurring shipping costs
  • Affecting production data
All sandbox operations are isolated. Nothing created in sandbox will appear in production.

Sandbox vs Production

FeatureSandboxProduction
Base URLsandbox.crbtrack.comapi.crbtrack.com
API Key Prefixpk_test_pk_live_
Tracking NumbersStart with SBReal carrier numbers
LabelsMarked “SANDBOX”Production labels
WebhooksSimulated eventsReal events
Rate Limits100 req/sec (relaxed)50 req/sec
Data Persistence30 daysPermanent

Getting a Sandbox Key

1

Login to Dashboard

2

Navigate to API Keys

Click SettingsAPI Keys
3

Generate Sandbox Key

Click Generate Sandbox Key (or create a key and select “Sandbox” environment)

Test Scenarios

The sandbox supports special tracking number prefixes to simulate different scenarios:
Prefix: SB-SUCCESS-*Simulates a parcel that progresses through all statuses to successful delivery.
ORDERED → LABEL_GENERATED → CUSTOMS_CLEARANCE → 
IN_TRANSIT → OUT_FOR_DELIVERY → DELIVERED
Status updates occur every 5 minutes.

Example: Testing Different Scenarios

Create a successful delivery test

curl -X POST https://sandbox.crbtrack.com/api/v1/orders/create \
  -H "X-API-Key: <YOUR_SANDBOX_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "idempotencyKey": "test-success-001",
    "trackingNumber": "SB-SUCCESS-12345",
    "sender": { ... },
    "receiver": { ... },
    "parcelDetails": { ... }
  }'

Create a customs hold test

curl -X POST https://sandbox.crbtrack.com/api/v1/orders/create \
  -H "X-API-Key: <YOUR_SANDBOX_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "idempotencyKey": "test-customs-001",
    "trackingNumber": "SB-CUSTOMS-67890",
    "sender": { ... },
    "receiver": { ... },
    "parcelDetails": { ... }
  }'

Webhook Testing

Sandbox webhooks behave the same as production but:
  • Fire immediately (no real carrier delay)
  • Include "environment": "sandbox" in the payload
  • Use your configured sandbox webhook URL

Configure Sandbox Webhooks

In the dashboard, set a separate webhook URL for sandbox:
Sandbox Webhook URL: https://your-server.com/webhooks/crossborderly-sandbox

Sample Sandbox Webhook Payload

{
  "event": "parcel.status_changed",
  "environment": "sandbox",
  "timestamp": "2024-12-21T10:30:00Z",
  "data": {
    "trackingNumber": "SB-SUCCESS-12345",
    "previousStatus": "IN_TRANSIT",
    "newStatus": "OUT_FOR_DELIVERY",
    "location": "Guayaquil, EC"
  }
}

Sandbox Limitations

Some features are limited in sandbox mode:
FeatureSandbox Behavior
Carrier IntegrationSimulated (no real carrier calls)
Label PrintingWorks, but labels marked “SANDBOX”
Customs ValidationSimplified validation rules
Data Retention30 days (then deleted)
Carrier TrackingSimulated status progression

Transitioning to Production

When you’re ready to go live:
1

Generate Production Key

Create a new API key with “Production” environment
2

Update Base URL

Change from sandbox.crbtrack.com to api.crbtrack.com
3

Update Webhook URL

Configure your production webhook endpoint
4

Replace API Key

Update your environment variables with the production key (pk_live_...)
5

Test a Real Order

Create a small test order to verify everything works

Sandbox Data Cleanup

Sandbox data is automatically purged after 30 days. You can also manually clear your sandbox data:
curl -X POST https://sandbox.crbtrack.com/api/v1/sandbox/reset \
  -H "X-API-Key: <YOUR_SANDBOX_KEY>"
This permanently deletes all your sandbox orders, manifests, and tracking data. This action cannot be undone.