How to create a shipment without an order through the API

Samples, replacements and B2B parcels that aren't store orders can be booked through the REST API, the way Create shipment books them in OrderKrab. It takes two calls - prepare a draft, then book it - so your system, or a person, can check the parcel before it's booked.

  1. 1

    Pick a carrier. Use an API key with Allow changes (write access) and ask which carriers and delivery methods you can use for the destination country:

    curl "https://api.orderkrab.com/api/v1/shipment_services?country_code=DE" \
      -H "Authorization: Bearer ok_your_key"

    Each carrier comes with its shipping_option_id and its methods - courier or parcel locker - with their shipping_method_id, plus the products to choose from where a carrier needs one. The answer also gives your sender address and whether the parcel needs customs data.

  2. 2

    For a parcel locker, find the locker. GET /api/v1/pickup_points with the carrier's shipping_option_id, the country_code and a city or a query (a street, the locker's name or a postcode) lists lockers with their shipping_point_id.

  3. 3

    Prepare a draft. Send the carrier, the method, the receiver and the parcel to POST /api/v1/shipment_drafts. Nothing is booked yet:

    curl -X POST "https://api.orderkrab.com/api/v1/shipment_drafts" \
      -H "Authorization: Bearer ok_your_key" -H "Content-Type: application/json" \
      -d '{"shipping_option_id": 12, "shipping_method_id": 34,
           "receiver_name": "Anna Weber", "receiver_phone": "+4915123456789",
           "receiver_email": "anna.weber@example.com", "country_code": "DE",
           "city": "Berlin", "address1": "Hauptstraße 5", "zip_code": "10115",
           "content_description": "Coffee samples", "weight_grams": 800}'

    The answer, 201, holds the draft_id, a summary to check, any warnings and the charges. A draft is kept for 24 hours. Invalid input answers 422 with invalid_shipment and every problem at once in details.

  4. 4

    Book it. Send the draft_id to POST /api/v1/shipments:

    curl -X POST "https://api.orderkrab.com/api/v1/shipments" \
      -H "Authorization: Bearer ok_your_key" -H "Content-Type: application/json" \
      -d '{"draft_id": 501}'

    OrderKrab books the parcel with the carrier and answers 201 with the shipment, its tracking code and tracking link and, once the label is ready, a label link. Sending the same draft_id again books nothing new: it answers 200 with "created": false and the same shipment, so a retry after a timeout is safe.

  5. 5

    Get the label. The label link works for 15 minutes without signing in. Later, download the label with GET /api/v1/shipments/{id}/label.pdf - or label.zpl for a thermal printer - or get a fresh link with GET /api/v1/shipments/{id}.

Good to know

  • Billing: every booked shipment counts as one fulfillment on your plan, exactly like an order's label, and your free fulfillments are used first. The carrier bills the parcel under your own contract; OrderKrab doesn't know its price.
  • Only carriers connected with your own contract are offered, and only with a courier or parcel locker method switched on for the destination country on the Delivery tab - store pick-up and local delivery aren't. One parcel per shipment, without cash on delivery.
  • The receiver's full address is required even for a parcel locker. Missing customs details - an export reason or an HS code for a parcel that crosses a customs border, or a state for countries such as the US - come back as warnings, not errors, and the draft is still saved.
  • POST /api/v1/shipments/{id}/void voids a shipment in OrderKrab only: the API stops serving its label, but the carrier isn't told and the shipment stays billed. Cancel the parcel with the carrier as well if it hasn't been handed over.
  • GET /api/v1/shipments lists your shipments without an order, newest first - those made with Create shipment in OrderKrab included. Search them with query (a tracking number or the receiver's name).
  • In OrderKrab, shipments booked through the API are listed on the Shipments tab of the Shipping page, and each shipment's details name the API key and the person it acts for: Created through ERP sync by ….
  • A read-only key can list carriers, lockers and shipments, but preparing, booking and voiding answer 403 with insufficient_scope. An organization can book up to 200 shipments an hour through the API.
  • The API reference lists every field - address2, state, total_price, currency (EUR, USD or GBP), hs_code, export_reason and note among them - and every error code.

Learn more about this in OrderKrab

We can set everything up for you

Book a free remote session. Our team connects to your computer and sets up OrderKrab while you watch. Most stores are ready in 30 minutes.

Secure screen sharingAn OrderKrab specialist

  1. Start a remote session

    You get a link. Click it and we connect. You can stop at any time.

  2. We set everything up

    Your store, your carriers, your printer, and one test order. You watch it happen.

  3. You stay in control

    You see every step. Our access ends when the session ends.