{
  "info": {
    "name": "CFX Delivery API",
    "description": "Charles Freight X Delivery API. Set apiKey to your sandbox key (cfx_test_...) to try everything safely, then to a live key. Docs: https://charlesfreightx.co.za/developers.html",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://charlesfreightx.co.za/api/v1"
    },
    {
      "key": "apiKey",
      "value": "cfx_test_paste_your_key_here"
    },
    {
      "key": "ref",
      "value": "TEST-000001"
    }
  ],
  "item": [
    {
      "name": "Start here",
      "item": [
        {
          "name": "Ping (does my key work?)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ping",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ping"
              ]
            },
            "description": ""
          }
        }
      ]
    },
    {
      "name": "Orders",
      "item": [
        {
          "name": "Quote a delivery",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/quote",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "quote"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"pickup\": \"1 Pickup St, Boksburg\",\n  \"dropoff\": \"2 Drop Rd, Kempton Park\",\n  \"packages\": [\n    {\n      \"size\": \"small\",\n      \"qty\": 1,\n      \"weight_kg\": 2\n    }\n  ],\n  \"items\": [\n    {\n      \"desc\": \"Kettle\",\n      \"value\": 450\n    }\n  ],\n  \"prohibited_ok\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Place an order",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/orders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders"
              ]
            },
            "description": "Save the ref from the answer into the ref variable.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"pickup\": \"1 Pickup St, Boksburg\",\n  \"dropoff\": \"2 Drop Rd, Kempton Park\",\n  \"recipient\": \"Thandi Mokoena\",\n  \"recipient_phone\": \"+27821234567\",\n  \"recipient_email\": \"thandi@example.com\",\n  \"packages\": [\n    {\n      \"size\": \"small\",\n      \"qty\": 1,\n      \"weight_kg\": 2\n    }\n  ],\n  \"items\": [\n    {\n      \"desc\": \"Kettle\",\n      \"value\": 450\n    }\n  ],\n  \"prohibited_ok\": true,\n  \"external_ref\": \"SHOP-1001\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get one order",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/orders/{{ref}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                "{{ref}}"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "List orders",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/orders?limit=25",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25"
                }
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Parcels are ready",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/orders/{{ref}}/ready",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                "{{ref}}",
                "ready"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Cancel an order",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/orders/{{ref}}/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                "{{ref}}",
                "cancel"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reason\": \"Customer changed their mind\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Waybill data",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/orders/{{ref}}/waybill",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                "{{ref}}",
                "waybill"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Rebook a failed delivery",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/deliveries/{{ref}}/rebook",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "deliveries",
                "{{ref}}",
                "rebook"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reason\": \"Customer is home tomorrow\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Daily",
      "item": [
        {
          "name": "Collection manifest",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/manifest?date=2026-11-30",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "manifest"
              ],
              "query": [
                {
                  "key": "date",
                  "value": "2026-11-30"
                }
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Invoices",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/invoices?from=2026-11-01&to=2026-11-30",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "invoices"
              ],
              "query": [
                {
                  "key": "from",
                  "value": "2026-11-01"
                },
                {
                  "key": "to",
                  "value": "2026-11-30"
                }
              ]
            },
            "description": ""
          }
        }
      ]
    },
    {
      "name": "Sandbox only",
      "item": [
        {
          "name": "Move a sandbox order on one step",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/test/orders/{{ref}}/advance",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "test",
                "orders",
                "{{ref}}",
                "advance"
              ]
            },
            "description": "confirmed -> ready_for_collection -> out_for_delivery -> completed. Each step sends a webhook."
          }
        },
        {
          "name": "Make a sandbox delivery fail",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/test/orders/{{ref}}/advance",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "test",
                "orders",
                "{{ref}}",
                "advance"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"delivery_failed\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Send a test webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/test/webhook",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "test",
                "webhook"
              ]
            },
            "description": ""
          }
        }
      ]
    }
  ]
}