Dumpster Controls · agent page

This is the agent-optimized version of https://dumpstercontrols.io/help/booking-api/lesson-8-confirm-the-order-and-recover-with-sessions: the same content as the human page, without scripts, styles, animations or navigation. People should open the full page.

Canonical page
https://dumpstercontrols.io/help/booking-api/lesson-8-confirm-the-order-and-recover-with-sessions
Last updated
2026-10-05
Tokens
1,516 tokens (cl100k_base), within the 2,000-token budget for a help page
Size
11 KB for this page, against 23 KB for the human page (53% smaller)
Markdown
https://dumpstercontrols.io/help/booking-api/lesson-8-confirm-the-order-and-recover-with-sessions.md, or send Accept: text/markdown to the canonical URL
Cite as
Lesson 8: POST /confirm and GET /sessions, create the order and never lose one. Dumpster Controls. https://dumpstercontrols.io/help/booking-api/lesson-8-confirm-the-order-and-recover-with-sessions (accessed 2026-10-10).
More for agents
Facts sheet · llms.txt · llms-full.txt · All agent pages · Product manual

Booking API course · updated 2026-10-05

Lesson 8: POST /confirm and GET /sessions, create the order and never lose one

After the card is authorized, one call creates the order, the customer, the invoice and the payment record, sends the confirmations and puts the order on the dispatch board. If your page dies in between, the same call can be repeated at any time while the authorization is valid, and GET /sessions tells you where things stand.

Before you start

  • Lesson 7: confirmPayment returned without error
  1. ## POST /confirm
    ```
    { "session_id": "...", "payment_intent_id": "pi_..." }
    ```
    Response data: state (confirmed, or held when the company reviews suspicious orders), order_number, order_id, invoice_id, customer_id. Idempotent: calling it again returns the same order with already: true. Show order_number to the customer and fire your conversion tags now.
  2. ## The held state
    Some US companies hold suspicious orders for a manual review before capturing the money. Then state is held: the order exists, the customer gets a "received, under review" message instead of a confirmation, and the company approves or declines in the app. Show a calm message: the order was received and the company will confirm shortly. When the company approves, your webhook (lesson 10) gets booking.released.
  3. ## If /confirm fails
    409 unconfirmed: the message says why (for example the card was not authorized yet); fix and retry. 409 payment_intent_mismatch: you mixed sessions; use the pair from the same /intents response. 502 upstream: our order service did not answer. In every case the authorized payment is kept and you can call POST /confirm again with the same pair; it is idempotent and works as long as the authorization is valid. Nobody is charged without an order: the authorization is only captured when the order is created, and an authorization that never becomes an order is released or expires on its own. Within about 15 minutes of an authorized card without an order, the customer and the company are told by email and SMS so the office can finish it by hand.
  4. ## GET /sessions/:session_id
    Response data: session_id, service (dumpster or junk), state, payment_intent_id, order_number, order_id, job_number, job_id, last_error, updated_at. Poll it (every 5 seconds, up to a few minutes) when /confirm did not answer or when a return_url flow lands on a fresh page; stop when state is confirmed or held.
  5. ## What to persist on your side
    Keep session_id and payment_intent_id in sessionStorage during the checkout and in your own database if you want to reconcile later. order_number is the key the company uses in the app and in every webhook payload.
  6. ## material in the session
    ```
    GET /sessions/:id also returns amount_cents and material { slug, label, acknowledged_at } when the session was quoted, so support can see which material the server priced.
    ```

What happens next

  • The customer gets email and SMS; the office gets email, SMS, push and an in-app alert with sound; the order is on the dispatch board already paid.

Troubleshooting

Can I call /confirm before the card is confirmed?

It answers 409 unconfirmed with the Stripe status. Call it only after confirmPayment resolves without error, or after your return page loads with the PaymentIntent id.

Related guides

© 2026 Dumpster Controls. All rights reserved. Made in the USA.

Frequently asked questions

Is Dumpster Controls really free?

Yes. The software is free: dispatch, online booking, the driver app, invoicing, the Tresha AI assistant and every other feature, with no monthly fee, no trial period and no credit card to sign up. The only cost on the free plan is optional card processing when a customer pays by card through the platform: 2.99% plus $3.99 per transaction on the free plan. An optional Unlimited plan at $169 per month lowers that to 2.99% plus $0.30. Prices as published on dumpstercontrols.io/pricing on 2026-09-23.

Do you charge per driver, per truck or per order?

No. There is no per-driver, per-truck, per-user or per-order fee, and no order limit. A company with one truck and a company with twenty pay the same for the software: nothing.

Is there a contract?

No. There is no contract, no minimum term and no setup fee. You create the account yourself, and on the free plan there is nothing to cancel because nothing is billed. The optional Unlimited plan is billed month to month.

Which countries and languages are supported?

Dumpster Controls serves hauling companies in the United States and Canada. The app interface and the Tresha AI assistant are available in English, Spanish and Portuguese. The public pages, such as the blog, the help center and the landfill finder, are in English.

How do I switch from another dumpster software?

Create a free account at dumpstercontrols.io/login, with no sales call and no credit card. Then import your customers from a CSV file using the template provided in the app; past orders can also be imported from a CSV. Container sizes and pricing are set up in Settings. The landfill database, with 1,750 active US and Canadian landfills as counted on 2026-10-01, is already loaded, so disposal sites do not need to be typed in. Step-by-step guides are at dumpstercontrols.io/help.