Fulfill and ship orders
Once an order is paid, your warehouse, store, or team gets the goods to the buyer, and Flint records how. A fulfillment covers some quantity of the order's line items and says how they reach the buyer. You report each step. Flint keeps the fulfillment's status, the order's fulfillment_status, the stock ledger, and the buyer's shipping emails in step with what you report.
Flint doesn't buy labels or track carriers. Your shipping software or carrier integration reports package progress, and Flint emails the buyer at each moment that matters. To set up the delivery methods and rates the buyer picks at checkout, see Add shipping to a checkout. Every field is in the Fulfillment API reference.
- Flint sends fulfillment.created, shortly after payment to Your server
- Your server sends mark_picked or mark_packed (optional) to Flint
- Your server sends POST /v1/fulfillments/{id}/shipments with shipped packages to Flint
- Flint sends shipped email for each package, with tracking to Buyer
- Flint sends fulfillment.updated, status dispatched to Your server
- Your server sends mark_delivered on each package to Flint
- Flint sends delivered email for each package to Buyer
- Flint sends fulfillment.completed to Your server
How a fulfillment is organized#
Each fulfillment has a type, which decides the steps it accepts and when its stock leaves on hand:
type | Steps you send | Stock leaves on hand at |
|---|---|---|
shipment | accept, mark_picked, mark_packed, then package actions | dispatch, or complete if it skips dispatch |
local_delivery | accept, mark_preparing, dispatch, complete | dispatch, or complete if it skips dispatch |
pickup | accept, mark_preparing, mark_ready, complete | complete |
digital | accept, complete | complete |
service | accept, schedule, start, complete | complete |
Every step is optional. A fulfillment can go straight from pending to the last step when you have nothing to report in between.
A shipment-type fulfillment holds one or more shipments, one per carrier leg. Each shipment holds packages, one per parcel. Tracking lives on the package, and package items record which order line quantities are in each box. The shipment has no actions of its own: its status comes from its packages, where an exception outranks everything else and otherwise the least advanced package sets the pace.
Flint also keeps two logs for each fulfillment. Fulfillment events are its timeline: status changes, tracking changes, and carrier scans. Fulfillment notifications record every buyer email Flint sent or skipped.
1. Find the work#
Fulfillments Flint creates#
When an order is paid with a delivery choice (shipping, pickup, or local delivery), Flint creates its fulfillments shortly after payment: one for each execution leg of the delivery the buyer chose. Each starts at pending, and Flint sends fulfillment.created for each one. Start your delivery work from that event and use those fulfillments. This applies whether the buyer chose at checkout or your backend selected the delivery and paid.
To list an order's fulfillments:
curl "https://api.withflintpay.com/v1/fulfillments?order_id=ord_1kmn0aExample" \
-H "Authorization: Bearer YOUR_API_KEY"
fulfillment.created is the signal to act on. A handler that reacts to order.paid instead can find this list still empty, because creation runs after payment. Don't create a fulfillment of your own for those quantities. While Flint is still creating them, that returns 409 OPERATION_IN_PROGRESS with details[0].reason: delivery_selection_materializing; afterward, it returns 409 LIMIT_EXCEEDED.
Flint never creates digital or service fulfillments, and you can create one only for a custom line whose fulfillment sets requirement: "required", resolution_mode: "manual", and allowed_types with digital or service. See Create a fulfillment yourself. A catalog product with product_type digital or service, and a custom line with requirement: "none", has nothing to fulfill: the order's fulfillment_status is not_applicable, and creating a fulfillment for the line returns 404 RESOURCE_NOT_FOUND. Deliver those from your own app after order.paid.
Work from queues#
To work from a list instead of reacting to each event, filter by state. GET /v1/fulfillments takes status, type, location_id, and order_id. Repeat status or type, or separate values with commas, to match any of them. To work through a schedule, add sort_by=scheduled_start_at&sort_direction=asc. scheduled_start_at is the start of the pickup, local delivery, or shipment window, or the service appointment, and is null for digital and unbooked fulfillments.
Once shipments exist, list them by state. This lists outbound shipments that are packed and waiting for the carrier:
curl "https://api.withflintpay.com/v1/shipments?direction=outbound&status=packed&page_size=50" \
-H "Authorization: Bearer YOUR_API_KEY"
status=exception,delivery_attempted finds shipments that need attention. To find the package behind a carrier scan, send its carrier and tracking number. Both match the whole stored value exactly, and tracking numbers can repeat across carriers, so send both:
curl "https://api.withflintpay.com/v1/packages?carrier=ups&tracking_number=1Z999AA10123456784" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"package_id": "pkg_1kmn0aExample",
"shipment_id": "shp_1kmn0aExample",
"fulfillment_id": "ful_1kmn0aExample",
"order_id": "ord_1kmn0aExample",
"status": "shipped",
"carrier": "ups",
"tracking_number": "1Z999AA10123456784",
"shipped_at": "2026-09-22T16:05:00Z"
}
],
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}
This example leaves out most package fields. With no next_page_token, it is the last page. When you page, send the same filters with each page_token; a token works only with the filters it was issued for. List shipments and packages has every filter, including updated_after, handed_off_after, and partial matching with query. Add expand=order to any of these lists to get each row's order beside it.
Find orders that still need a fulfillment#
To find paid orders with quantity that no fulfillment owns, such as digital lines or units handed back by a failed fulfillment:
curl "https://api.withflintpay.com/v1/orders?payment_status=paid&has_unassigned_fulfillment_quantity=true" \
-H "Authorization: Bearer YOUR_API_KEY"
Each line item carries fulfillment_quantities. Its unassigned_quantity is what you can put into a new fulfillment. An order leaves this list once fulfillments own all of its quantity, and comes back when a fulfillment fails with release_quantity: true. A shipping, pickup, or local delivery order also appears here for the moment before Flint creates its fulfillments, so check the order's fulfillments before you create one. See Filter orders by unassigned quantity.
2. Prepare the order#
Every fulfillment lists the actions it accepts right now in supported_actions. Send one of them to its transitions endpoint:
curl -X POST https://api.withflintpay.com/v1/fulfillments/ful_1kmn0aExample/transitions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ful_1kmn0aExample-packed" \
-H "Content-Type: application/json" \
-d '{ "action": "mark_packed", "expected_version": 2 }'
{
"data": {
"fulfillment_id": "ful_1kmn0aExample",
"order_id": "ord_1kmn0aExample",
"type": "shipment",
"status": "packed",
"version": 3,
"picked_at": "2026-09-22T14:30:00Z",
"packed_at": "2026-09-22T15:10:00Z",
"supported_actions": ["dispatch", "complete", "cancel", "fail", "hold"]
},
"request_id": "req_01KWM6S28J37K3GFF9QRM8YWA4"
}
The response is the updated fulfillment; this example leaves out most of its fields. It doesn't include the timeline event or email records the action created. Read those as in Read events and notifications.
- Send
expected_version. It must match the fulfillment'sversion. A stale value returns409 VERSION_CONFLICTand changes nothing. - Each action takes only its own fields.
holdneeds areason,scheduleneedsscheduled_start_atandscheduled_end_at,failneedsrelease_quantity, andmark_no_showneeds areason. Every action acceptsoccurred_atfor when it happened andreason_message, a note of up to 500 characters. - Retry with the same
Idempotency-Keyand body. A replay returns the original result without another email. See Idempotency.
Until dispatch, every type also accepts hold and fail, and cancel while it has no shipment that isn't voided. A service also accepts mark_no_show. A dispatched fulfillment accepts only complete and fail.
Fulfillment status#
status reports exactly where the fulfillment is. Each type uses the values its steps reach. Filter GET /v1/fulfillments by any of them.
status on fulfillmentactive_hold is present exactly when status is on_hold, and outcome exactly when it is no_show. terminal_at records when the fulfillment reached a terminal status.
Hold and release#
hold pauses the fulfillment at on_hold with a reason, such as address_issue or customer_request. Your reason_message appears as active_hold.reason_notes:
curl -X POST https://api.withflintpay.com/v1/fulfillments/ful_1kmn0aExample/transitions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ful_1kmn0aExample-hold-1" \
-H "Content-Type: application/json" \
-d '{ "action": "hold", "reason": "address_issue", "reason_message": "Confirming the apartment number", "expected_version": 3 }'
active_hold.initiated_by is merchant when you or your integration placed the hold, or flint when Flint placed a payment hold. This read-only field identifies who paused the work. Merchant holds block package-derived progress whatever their reason, including legacy holds with reason payment_review.
payment_review is reserved for Flint. Sending it as the reason for a merchant hold returns 400 INVALID_REQUEST with detail INVALID_VALUE at reason. Use fraud_review for your own review, or other with reason_message.
active_hold.previous_status records the status the hold paused, which is never on_hold or terminal. A held fulfillment can only move forward from there:
release_holdreturns it toprevious_status. It keeps the schedule and progress timestamps such aspicked_atandpacked_at, never emails the buyer, and rejectsbuyer_notification_behavior.- Any other action that
previous_statusallows, excepthold, moves it on and clears the hold. A fulfillment held atpackedacceptsdispatchbut notmark_picked.
supported_actions lists exactly these exits. Holds are private to the merchant: buyer responses under /v1/me show a held fulfillment at its previous_status with no active_hold, and putting work on hold sends no email.
Require approval#
When the merchant turns on fulfillment.approval_required in settings, a new fulfillment offers only accept, hold, cancel, and fail until someone accepts it. A fulfillment held before acceptance also offers release_hold.
3. Ship the packages#
For a shipment-type fulfillment, create its shipment with one package per box. Give each package its contents and tracking, and status: shipped to report the carrier handoff in the same call:
curl -X POST https://api.withflintpay.com/v1/fulfillments/ful_1kmn0aExample/shipments \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: shipment-1042" \
-H "Content-Type: application/json" \
-d '{
"direction": "outbound",
"packages": [
{
"status": "shipped", "carrier": "ups", "tracking_number": "1Z999AA10123456784",
"items": [
{ "order_line_item_id": "li_1kmn0aExampleA", "quantity": 1 },
{ "order_line_item_id": "li_1kmn0aExampleB", "quantity": 1 }
]
},
{
"status": "shipped", "carrier": "ups", "tracking_number": "1Z999AA10123456785",
"items": [{ "order_line_item_id": "li_1kmn0aExampleC", "quantity": 1 }]
}
]
}'
{
"data": {
"shipment_id": "shp_1kmn0aExample",
"fulfillment_id": "ful_1kmn0aExample",
"order_id": "ord_1kmn0aExample",
"direction": "outbound",
"status": "shipped",
"package_count": 2,
"shipped_at": "2026-09-22T16:05:00Z",
"handed_off_at": "2026-09-22T16:05:00Z",
"packages": [
{ "package_id": "pkg_1kmn0aExample", "status": "shipped", "carrier": "ups", "tracking_number": "1Z999AA10123456784" },
{ "package_id": "pkg_1kmn0aExampleB", "status": "shipped", "carrier": "ups", "tracking_number": "1Z999AA10123456785" }
]
},
"request_id": "req_01KWM6H6EF3N5C3ZK19ZSFRE11"
}
These examples leave out most fields. The shipment, its packages and items, the timeline entries, the buyer emails, and any fulfillment progress commit together; a failure commits nothing. Because every unit is in a shipped box, this call also moves the fulfillment to dispatched, as described in How packages move the fulfillment.
- Send 1 to 20 packages. Each needs
status: createdorstatus: shipped.itemsis optional per package; when you send it, give 1 to 100 entries, with each order line at most once per box. Across all packages, quantities can't exceed what the fulfillment covers. - Create labels before handoff. Send
status: created, thenmark_shippedon each package when the carrier takes it. To add a box later, usePOST /v1/shipments/{shipment_id}/packages. - Choose when to email. Each
shippedpackage sends one shipped email with its tracking link. Setbuyer_notification_behavior: suppresson a package to skip its email.shipped_atdefaults to the request time. Both fields are allowed only withshipped. - Retry with the same
Idempotency-Keyand body. A replay returns the original IDs and sends no second email.external_reference_idhelps you find a shipment later but doesn't prevent duplicates. - The delivery address is on the fulfillment.
recipientholds the address and buyer email copied from the order. If the buyer asks for a change, update it withPATCH /v1/fulfillments/{fulfillment_id}.
Return shipments carry goods back from the buyer and take no packages here; see Return labels and tracking.
Change a box's contents#
Read a package's contents with GET /v1/packages/{package_id}/items. Each item has its own version. To change a quantity only if nobody changed the item since you read it, send that version as expected_version:
curl -X PATCH https://api.withflintpay.com/v1/packages/pkg_1kmn0aExample/items/pki_1kmn0aExample \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: pkg-item-qty-pki_1kmn0aExample-1" \
-H "Content-Type: application/json" \
-d '{ "quantity": 2, "expected_version": 1 }'
DELETE /v1/packages/{package_id}/items/{package_item_id}?expected_version=1 removes an item the same way. A stale value returns 409 VERSION_CONFLICT and changes nothing. Contents, new packages, and voids are allowed only before handoff.
Correct tracking#
PATCH /v1/packages/{package_id} corrects tracking, carrier, service, label URL, weight, dimensions, expected delivery time, status reason, external references, or metadata. These fields stay editable after delivery and completion, until the package is voided. Send null to clear a field. PATCH /v1/shipments/{shipment_id} corrects a shipment's external references and metadata until it is voided. Corrections never email the buyer.
Void a mistake#
Before handoff, void what you created by mistake. POST /v1/packages/{package_id}/void and POST /v1/shipments/{shipment_id}/void work while the shipment is created or packed. Voiding a package returns the package. Voiding a shipment voids its packages too, so it returns both:
{
"data": {
"shipment": { "shipment_id": "shp_1kmn0aExample", "status": "voided" },
"packages": [{ "package_id": "pkg_1kmn0aExample", "status": "voided" }]
}
}
This example leaves out most fields. Voided packages and shipments no longer count toward the fulfillment's progress.
4. Report carrier progress#
As each parcel moves, send its package action to POST /v1/packages/{package_id}/transitions. Each package publishes the actions it accepts in supported_actions. For label-first work, mark_shipped records the handoff and can set the final tracking in the same request:
curl -X POST https://api.withflintpay.com/v1/packages/pkg_1kmn0aExample/transitions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: pkg_1kmn0aExample-shipped" \
-H "Content-Type: application/json" \
-d '{
"action": "mark_shipped",
"occurred_at": "2026-09-22T16:05:00Z",
"carrier": "ups",
"service_code": "ground",
"tracking_number": "1Z999AA10123456784",
"tracking_url": "https://www.ups.com/track?tracknum=1Z999AA10123456784"
}'
carrier, service_code, tracking_number, and tracking_url are accepted only on mark_shipped. Fields you send replace the package's values before the shipped email is built; fields you leave out stay unchanged. They can't be null here, so clear a field with PATCH. The response is the updated package.
| Action | Package status | Buyer email |
|---|---|---|
mark_packed | packed | None |
mark_shipped | shipped | Shipped, with the tracking link |
mark_in_transit | in_transit | None |
mark_out_for_delivery | out_for_delivery | Out for delivery |
mark_delivery_attempted | delivery_attempted | Delivery attempted |
mark_delivered | delivered | Delivered |
mark_exception | exception | Delivery issue |
mark_returned | returned | Returned to sender |
A package starts at created or shipped, and voiding it sets voided. Every action accepts occurred_at, reason_message, expected_version, and buyer_notification_behavior. Nothing in Flint moves a package on its own, in live mode or a sandbox, so your integration sends each step it learns from the carrier.
Share an expected delivery time#
expected_delivery_at is when you or the carrier expect a package to arrive. Set it when you create the package, change it with PATCH /v1/packages/{package_id}, or send it with mark_shipped, mark_in_transit, or mark_out_for_delivery:
curl -X POST https://api.withflintpay.com/v1/packages/pkg_1kmn0aExample/transitions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: pkg_1kmn0aExample-in-transit-1" \
-H "Content-Type: application/json" \
-d '{
"action": "mark_in_transit",
"occurred_at": "2026-09-23T09:40:00Z",
"expected_delivery_at": "2026-09-25T21:00:00Z"
}'
Leave it out to keep the current value, or send null to clear it. Past times are accepted, so a late parcel keeps its estimate as history, and the value stays on the package after delivery; hide it from buyer arrival estimates once the package is delivered. It belongs to one package and is separate from the fulfillment's promised shipping window, shipment_details.window_start_at and window_end_at.
Record a carrier scan#
A scan that changes no status, such as a departure from a sorting facility, goes to the fulfillment's timeline instead:
curl -X POST https://api.withflintpay.com/v1/fulfillments/ful_1kmn0aExample/events \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event_type": "carrier_scan",
"package_id": "pkg_1kmn0aExample",
"external_system": "ups",
"external_event_id": "scan-88412",
"external_status": "Departed facility",
"location_description": "Louisville, KY",
"occurred_at": "2026-09-23T03:12:00Z"
}'
event_type is carrier_scan or custom. Add package_id or shipment_id to attach the entry to a box or a leg. Send external_system with external_event_id so a repeated scan is recorded once: the first returns 201 with the new event, and a repeat returns 200 with the same fulfillment_event_id. Reusing an external_event_id with different details returns 409 ALREADY_EXISTS with the recorded event in details[0].current_resource. These entries never email the buyer. Status changes such as shipped or delivered are package actions; sending one as an event_type returns 400 INVALID_REQUEST with param: event_type.
How packages move the fulfillment#
Once a shipment-type fulfillment has a package, its packages move it forward. Only packages that aren't voided, in outbound shipments that aren't voided, count:
- Dispatched once every unit of the fulfillment is in a package and every package has left with the carrier (
shippedor later).dispatched_atis the latest package'sshipped_at, and stock leaves on hand. - Completed once, with every unit packed, every package is
delivered.completed_atis the latest package'sdelivered_at, so a return window that starts at delivery counts from the carrier's delivery. The order'sfulfillment_statusupdates andfulfillment.completedfires. - Not yet while any unit is outside a package, any package is still
createdorpacked, or, for completion, any package is inexceptionorreturned.
Each step happens in the same request as the package action that triggers it. That response is the package, so read the fulfillment or listen for fulfillment.updated and fulfillment.completed to see the step. Two packages delivered at the same moment complete the fulfillment once.
Packages don't move a fulfillment that is waiting for accept, that you put on hold (whatever the hold reason), or whose payment is holding fulfillment. The package still records its progress and emails the buyer. When the fulfillment can go on, send dispatch or complete yourself. On a held fulfillment, that also clears the hold.
Once completed, a fulfillment stays completed. A later package action, such as mark_returned after a return to sender, changes only the package and sends its own events and email. With packages, the delivery time comes only from them, so PATCH /v1/fulfillments/{fulfillment_id} with completed_at returns 409 ACTION_NOT_ALLOWED with details[0].reason: derived_from_packages.
5. Complete it#
With packages, delivery of the last package completes the fulfillment. Send complete yourself when nothing will report it: a pickup handed over, a local delivery dropped off, a digital or service order finished, a shipment you track without packages, or a parcel whose carrier never reports delivery.
curl -X POST https://api.withflintpay.com/v1/fulfillments/ful_1kmn0aExample/transitions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ful_1kmn0aExample-complete" \
-H "Content-Type: application/json" \
-d '{ "action": "complete", "occurred_at": "2026-09-24T18:20:00Z" }'
occurred_at on complete becomes the fulfillment's completed_at, the delivery or handover time. Send it when you know it. Without it, completed_at stays empty, and a return window that counts from delivery sends the order's returns to manual review. To record the time later, PATCH /v1/fulfillments/{fulfillment_id} with completed_at.
The order's fulfillment_status counts only completed fulfillments. It stays not_fulfilled through packing and dispatch, moves to partially_fulfilled when some quantity is complete, and reaches fulfilled when all of it is. If all of it was canceled, the order ends canceled, and if some was completed and the rest canceled, it ends closed. An order with nothing to ship is not_applicable. The full list is in Statuses and lifecycles.
Pickup, local delivery, digital, and service#
- Pickup.
mark_readyemails the buyer that the order is waiting.completerecords the collection and takes the stock off hand. For a buyer who never comes, sendcancelorfail;mark_no_showis for services only.pickup_detailsnames the store, andrecipient.instructionsholds any note the buyer left for it. - Local delivery. Works like a shipment without shipments or packages:
dispatchwhen the courier leaves, which emails the buyer, thencompleteon delivery. Put the courier's link inlocal_delivery_details.tracking_url. - Digital. Only a custom line that requires a
digitalfulfillment gets one. Put the download link indigital_details.delivery_urland sendcompleteonce the buyer has it. The completed email links the buyer to their order in their account rather than to the file. A catalog digital product gets no fulfillment, so deliver it from your app afterorder.paid. - Service.
schedulebooks the appointment window,startmarks it underway, andmark_no_showrecords a missed appointment with areason, such ascustomer_no_show.
Create a fulfillment yourself#
Create a fulfillment with POST /v1/orders/{order_id}/fulfillments when no fulfillment covers the quantity: a custom line that requires a digital or service fulfillment, or units a failed fulfillment handed back. The order must be paid, and the fulfillment's type must be in the line's allowed_types. For a custom line created with "fulfillment": {"requirement": "required", "resolution_mode": "manual", "allowed_types": ["digital"]}:
curl -X POST https://api.withflintpay.com/v1/orders/ord_1kmn0aExample/fulfillments \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: order-1042-ebook" \
-H "Content-Type: application/json" \
-d '{
"type": "digital",
"line_items": [{ "order_line_item_id": "li_1kmn0aExampleD", "quantity": 1 }],
"digital_details": { "delivery_url": "https://downloads.example.com/orders/1042/guide.pdf" }
}'
For a shipment, you can create its boxes in the same call. shipment.packaging: itemized takes 1 to 20 shipment.packages, each with non-empty items naming only lines in the request's line_items. Their totals can cover less than, but not more than, each requested quantity. For one box holding every requested unit, send packaging: single_package and a shipment.package without items. This reships three units from another warehouse:
curl -X POST https://api.withflintpay.com/v1/orders/ord_1kmn0aExample/fulfillments \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: order-1042-reship" \
-H "Content-Type: application/json" \
-d '{
"type": "shipment",
"line_items": [
{ "order_line_item_id": "li_1kmn0aExampleA", "quantity": 1 },
{ "order_line_item_id": "li_1kmn0aExampleB", "quantity": 1 },
{ "order_line_item_id": "li_1kmn0aExampleC", "quantity": 1 }
],
"external_reference_id": "wms-order-1042-reship",
"shipment": {
"packaging": "itemized",
"packages": [
{
"status": "shipped", "carrier": "ups", "tracking_number": "1Z999AA10123456786",
"items": [
{ "order_line_item_id": "li_1kmn0aExampleA", "quantity": 1 },
{ "order_line_item_id": "li_1kmn0aExampleB", "quantity": 1 }
]
},
{
"status": "shipped", "carrier": "ups", "tracking_number": "1Z999AA10123456787",
"items": [{ "order_line_item_id": "li_1kmn0aExampleC", "quantity": 1 }]
}
]
}
}'
The response is the new fulfillment, with the created shipment and packages in its shipments and packages fields. An item for a line outside line_items returns 400 INVALID_REQUEST with detail NOT_ALLOWED, and the item that pushes a line over its requested quantity returns detail INVALID_VALUE. Both name the item in param.
- Quantities are capped. A line can be split across several fulfillments, but a request can't claim more than the
unassigned_quantityin the line'sfulfillment_quantities(see Read what is left to fulfill). Asking for more returns409 LIMIT_EXCEEDEDwith the quantity field inparamand the remaining amount indetails[0].available_quantity. - Tracked stock comes from one location. For inventory items, a fulfillment draws on stock committed at a single location, so stock committed at two locations needs two fulfillments.
- The address comes from the order. Without
recipient, Flint copies the order's delivery destination and buyer email. - Supply an
Idempotency-Keyfor every fulfillment create. An inline shipped package can consume stock, so the key is required for every body. A missing key returns400 INVALID_REQUESTwith detailREQUIREDatIdempotency-Key. Store it before you send, so after a timeout you can replay the same key and body and get the original IDs.external_reference_idlets you find the fulfillment later withGET /v1/fulfillments?order_id=...&external_reference_id=....
Cancel, fail, and try again#
Canceling and failing both end a fulfillment, but they leave the order in different places:
| Action | Stock | Quantity | Use it when |
|---|---|---|---|
cancel | Released | Stays with the fulfillment and counts in the line's canceled_quantity | The goods won't be sent at all |
fail with release_quantity: true | Released, unless it already left on hand. A shipment fulfillment with a shipment that isn't voided returns 409 RESOURCE_IN_USE instead | Returns to the line's unassigned_quantity | You'll send it another way, such as from another warehouse |
fail with release_quantity: false | Stays committed or consumed | Stays with the fulfillment and counts in the line's failed_quantity | The goods are gone, such as a parcel lost after it shipped |
A no_show counts in canceled_quantity too. After a fail with release_quantity: true, read the line's unassigned_quantity and create the replacement:
curl -X POST https://api.withflintpay.com/v1/fulfillments/ful_1kmn0aExample/transitions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ful_1kmn0aExample-fail" \
-H "Content-Type: application/json" \
-d '{ "action": "fail", "release_quantity": true, "reason_message": "Out of stock at the east warehouse" }'
While a fulfillment has a shipment that isn't voided, cancel drops out of supported_actions, and fail with release_quantity: true returns 409 RESOURCE_IN_USE with the shipment in details[0].blocking_resources. Before handoff, void the shipment first. Once a parcel has left, its shipment can't be voided, so fail with release_quantity: false is the way to end the fulfillment without completing it.
When a payment stops shipping#
A payment provider can ask Flint to stop shipping for a payment, for example while it reviews the payment. Every open fulfillment on the order then goes on hold with reason payment_review, and only cancel and hold remain in supported_actions. Any other action, including release_hold, returns 409 ACTION_NOT_ALLOWED with details[0].reason: on_hold. You receive payment_intent.fulfillment_hold_updated when the stop starts and again when it lifts.
Lifting the payment stop leaves the fulfillment on_hold. You can send release_hold or the next forward action. Later package progress can also advance a hold placed by Flint once the payment stop lifts; it never advances a merchant hold.
Refunding money never cancels a fulfillment or restocks anything on its own. Returned goods come back through Returns.
What the buyer receives#
Flint sends the buyer one email per moment, from the call that reports it:
| Source | Emails on |
|---|---|
| Package actions | mark_shipped, mark_out_for_delivery, mark_delivery_attempted, mark_delivered, mark_exception, and mark_returned, once per package. A package created as shipped counts as mark_shipped |
| Fulfillment actions | mark_ready, complete, cancel, fail, mark_no_show, and dispatch for local delivery |
| A shipment without packages | dispatch sends the shipped email, and complete the delivered email |
Nothing else emails: not accept, mark_picked, mark_packed, mark_preparing, schedule, start, hold, release_hold, mark_in_transit, tracking corrections, or entries posted to the events endpoint. When packages move a fulfillment to dispatched or completed, the package email is the only one, and a dispatch or complete you send stays silent when a package already sent that moment. Flint also drops a repeat of a moment it already recorded, such as two integrations both reporting that the same package shipped.
- Recipient. Each email goes to the fulfillment's
recipient.email. Without one, Flint uses the order'sbuyer_contact.email, then the email of the order's customer. With no address at all, the email is skipped withsuppression_reason: recipient_missing. - Skipping one. Send
buyer_notification_behavior: suppresson the action. - Unsubscribes. Buyers can unsubscribe from shipping progress emails: shipped, out for delivery, delivered, and a local delivery's dispatch. Every other email always goes out.
- Sending your own. Set
customer_email_delivery.fulfillment_updatestomerchant_sendsand Flint sends none of these. See Customer email delivery.
A signed-in buyer can read their own fulfillments, shipments, and packages through GET /v1/me/fulfillments, /v1/me/shipments, and /v1/me/packages with a customer session.
Read events and notifications#
Writes return the resource they changed, not the records they logged. Read those through their lists:
GET /v1/fulfillment-events?fulfillment_id=...returns the timeline: every status change, withprevious_statusandcurrent_status, plus tracking changes and carrier scans. Filter bypackage_id,shipment_id,order_id, orevent_type. Sort byreceived_at(the default) oroccurred_at, withsort_directiondesc(the default) orasc.GET /v1/fulfillment-notifications?fulfillment_id=...returns the email record. Each entry has astatusofpending,sent,failed, orsuppressed, and asuppression_reasonwhen it was skipped. Filter byfulfillment_event_idto find the email a step sent.
Staying in sync#
Each event carries its resource in data.object, as its GET returns it. A status change sends exactly one fulfillment event: fulfillment.completed, fulfillment.canceled, or fulfillment.failed for those statuses, with no fulfillment.updated, and fulfillment.updated for every other status. Changes to the order's embedded fulfillments or fulfillment_status send order.updated, and order.closed is sent only when the order moves from open to closed. Delivery details are in the event catalog.
- Calls you make send events too. Resources a call creates send their
.createdevents at their final revision, with no.updatedevents of their own. The call also sends its timeline entries and the fulfillment and order events for any progress it causes. Adding a package to an existing shipment sendspackage.createdand ashipment.updatedwith the finalpackage_count. - Tracking changes are timeline entries. A tracking change, through
PATCHormark_shipped, sendspackage.updatedand afulfillment_event.createdwithevent_type: tracking_updated. A correction alone sends no fulfillment or order event. - Contents aren't in the package snapshot. Creating, editing, or deleting a package item advances the package's
versionand sends onepackage.updated. When you receive a package with a higherversionthan your copy, listGET /v1/packages/{package_id}/items, paging to the end, to refresh its contents. - Deliveries can repeat or arrive out of order. Deduplicate by
webhook_event_id, and replace a stored fulfillment, shipment, or package only when the snapshot'sversionis higher. A retry resends the original snapshot, so fetch the resource when you need its current state. - Updates aren't moments. An update event says a resource changed. It isn't a timeline entry and doesn't mean the buyer got an email. To send your own mail, key it to the moments Flint emails for, which
fulfillment_event.createdrecords.
Common errors#
The full list is in the error reference.
