Quickstart

Quickstart

Send your first order to the sandbox and get it back, in five steps. You need curl, and jq to read the token from the response.

  1. Get your sandbox credentials

    Ask us to set you up in the sandbox. We give you a client ID and a client secret. If your service runs on Kubernetes, you can use workload identity instead of a secret.

    export CLIENT_ID="your client ID"
    export CLIENT_SECRET="your client secret"
    
  2. Get an access token

    export TOKEN=$(curl -s -X POST "https://login.microsoftonline.com/b66ad013-3458-4610-a433-7bdd1264b5b4/oauth2/v2.0/token" \
      -d "grant_type=client_credentials" \
      -d "client_id=$CLIENT_ID" \
      -d "client_secret=$CLIENT_SECRET" \
      -d "scope=api://24579c38-caed-4940-a35f-8fc7763b718c/.default" | jq -r .access_token)
    

    It lasts about an hour. See Authentication for reusing it, and for what to do in your own code.

  3. Create an order

    Change the delivery date to today or later, then send the order:

    curl -s -X POST "https://api.sandbox.theflowerfactory.ie/partner/v1/orders" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "reference": "QUICKSTART-1",
        "purchaser": { "name": "Siobhán Murphy", "email": "siobhan@example.com" },
        "recipient": {
          "name": "Mary Murphy",
          "telephone": "+353 87 123 4567",
          "address": { "line1": "12 Main Street", "city": "Dublin 6", "postcode": "D06 A1B2", "country": "Ireland" }
        },
        "delivery": { "date": "2026-11-14" },
        "message": "Happy birthday",
        "items": [{ "sku": "BQT-ROSE-12", "name": "A dozen red roses", "quantity": 1, "unitPrice": 49.99 }]
      }'
    

    You get 201 Created and the order, with "status": "Received". A 400 lists what to fix under errors; a 409 means you’ve already used that reference, so pick another.

  4. Get the order back

    curl -s "https://api.sandbox.theflowerfactory.ie/partner/v1/orders/QUICKSTART-1" \
      -H "Authorization: Bearer $TOKEN"
    

    You find orders by your own reference. Until we start making it you can also change it, by sending the whole order again with PUT to the same URL.

  5. Follow it to delivery

    Get the order again to see its status and, once it’s dispatched, its tracking numbers in shipments. Or have us tell you when it changes, with webhooks.

Next

  • Orders: every field and response.
  • Errors: what to do when a request fails, and retrying safely.
  • Environments: moving from the sandbox to production.