From 70532c58a974123be2db6d68e1802b264a714be3 Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Tue, 11 Aug 2026 21:50:40 +0800 Subject: [PATCH] fix(storefront): fill the delivery quote and checkout query params MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both requests shipped every query parameter empty, so each failed on its own validation and the published reference showed no values for endpoints that cannot work without them. Same gap as the empty request bodies. Retrieve a Delivery Service Quote answered "The origin field is required." origin and destination accept a place id, a store_location id, a vehicle id, a food_truck id, or a "lat,lng" pair — getPlaceFromId() handles all five. Coordinates are used because that is what a storefront client usually has: the store's position and the customer's address. No fixture is needed for them. It now also captures {{service_quote_id}}, which Checkout/Before addresses and nothing set. Before answered "The gateway field is required." `gateway` is the gateway CODE, not an id — CheckoutController reads $request->input('gateway') and resolves it with Storefront::findGateway(), so "stripe" is correct and matches the seeded gateway's code. The remaining params reuse variables the run already has. It now captures {{checkout_token}}, which Capture checkout as order and Get Checkout Status both address and nothing set. Co-Authored-By: Claude Opus 5 --- .../Before \342\235\227.request.yaml" | 26 +++++++++++++------ ...y Service Quote \342\235\227.request.yaml" | 19 +++++++++++--- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git "a/postman/collections/Fleetbase Storefront API/Checkout/Before \342\235\227.request.yaml" "b/postman/collections/Fleetbase Storefront API/Checkout/Before \342\235\227.request.yaml" index ea8dcd7..d898386 100644 --- "a/postman/collections/Fleetbase Storefront API/Checkout/Before \342\235\227.request.yaml" +++ "b/postman/collections/Fleetbase Storefront API/Checkout/Before \342\235\227.request.yaml" @@ -4,12 +4,22 @@ description: |- url: "{{base_url}}/{{api_prefix}}/{{namespace}}/checkouts/before" method: GET queryParams: - gateway: "" - customer: "" - cart: "" - service_quote: "" - cash: "" - pickup: "" - tip: "" - delivery_tip: "" + # `gateway` is the gateway CODE, not an id — "stripe", "cash", or whichever code the + # store has configured. CheckoutController resolves it with Storefront::findGateway(). + gateway: "stripe" + customer: "{{customer_id}}" + cart: "{{cart_id}}" + service_quote: "{{service_quote_id}}" + pickup: "false" +scripts: + - type: afterResponse + code: |- + // Capture checkout as order and Get Checkout Status both address + // {{checkout_token}}; nothing set it. + var json_response = pm.response.json(); + + if (json_response && json_response.token) { + pm.environment.set("checkout_token", json_response.token); + } + language: text/javascript order: 1000 diff --git "a/postman/collections/Fleetbase Storefront API/Delivery Service Quote/Retrieve a Delivery Service Quote \342\235\227.request.yaml" "b/postman/collections/Fleetbase Storefront API/Delivery Service Quote/Retrieve a Delivery Service Quote \342\235\227.request.yaml" index debc90c..7ca2162 100644 --- "a/postman/collections/Fleetbase Storefront API/Delivery Service Quote/Retrieve a Delivery Service Quote \342\235\227.request.yaml" +++ "b/postman/collections/Fleetbase Storefront API/Delivery Service Quote/Retrieve a Delivery Service Quote \342\235\227.request.yaml" @@ -4,7 +4,20 @@ description: |- url: "{{base_url}}/{{api_prefix}}/{{namespace}}/service-quotes/from-cart" method: GET queryParams: - origin: "" - destination: "" - cart: "" + # origin and destination accept a place id, a store_location id, a vehicle id, a + # food_truck id, or a "lat,lng" pair. Coordinates are shown because that is what a + # storefront client usually has: the store's position and the customer's address. + origin: "1.3521,103.8198" + destination: "1.3644,103.9915" + cart: "{{cart_id}}" +scripts: + - type: afterResponse + code: |- + // Checkout/Before addresses {{service_quote_id}}; nothing set it. + var json_response = pm.response.json(); + + if (Array.isArray(json_response) && json_response.length) { + pm.environment.set("service_quote_id", json_response[0].id); + } + language: text/javascript order: 1000