跳转到内容
Maple

Orders

Partner rejects a `submitted` order: its status becomes `rejected` and any payment is reversed.

此内容尚不支持你的语言。

POSThttps://api.maple.inc/v1/orders/{orderId}/rejectAPI key

Send an optional reason. Maple applies the action before it answers and returns the updated order, as GET /v1/orders/{orderId} does. An order already in the status the action sets is returned unchanged, so a resend is safe. Any other status answers 409 illegal_transition with details.from_status. If Maple has not finished applying the action within a few seconds it answers 409 operation_in_progress with details.retry_after: the action still applies; send the same request again. Needs orders:write and orders:read.

Authorization

Send your API key as Authorization: Bearer <key>: mpk_test_… for test mode, mpk_live_… for live mode. Both use https://api.maple.inc/v1. See Authentication. The samples read the key from MAPLE_KEY and the base URL from MAPLE_BASE, as set up in the Quickstart.

Parameters

  • orderId string path required

  • Idempotency-Key string header

    Your unique key for this request, such as a UUID. A retry with the same key and the same body within 24 hours returns the first response, with Idempotent-Replayed: true, and does not run again. See https://docs.maple.inc/developer-api/concepts/idempotency Up to 255 characters.

  • Maple-Version string header

    The API version your code expects. A version Maple does not serve answers 400 invalid_request with param Maple-Version. See https://docs.maple.inc/developer-api/concepts/versioning Always 2026-11-27.

Request body

application/json.

Option 1

  • reason string or null

Responses

200 OK

Order

  • object string required

    Always order.

  • id string required

  • livemode boolean required

    True when the order belongs to the live environment; false for test-mode data.

  • created integer required

  • updated integer required

    When the order last changed (Unix seconds), including its payment and delivery. Of two copies of one order, from webhooks that arrived out of order, the one with the larger updated is newer; on a tie, read it again with GET /v1/orders/{orderId}.

  • status string required

    One of pending, submitted, accepted, ready, in_delivery, fulfilled, rejected, canceled.

  • cancellation_reason string or null required

    Who canceled the order (customer or restaurant) when status is canceled; null otherwise.

  • canceled_at integer or null required

    When the order was canceled (Unix seconds); null unless status is canceled, and null for orders canceled before 2026-11-24.

  • rejection_reason string or null required

    Why the order is rejected: validation_failed (your app answered its validation invalid, or did not answer), submission_failed (Maple could not hand the order to your app), denied (your app denied it), decision_timeout (no decision arrived in time) or expired (the order was too old to make by the time Maple could send it). Null otherwise, and null for orders rejected before 2026-11-24.

  • location_id string required

    The location the order belongs to.

  • fulfillment_type string required

    pickup (the customer collects the order) or delivery. One of pickup, delivery.

  • number string or null required

    The short order number Maple gave the customer, the one they say at the counter (e.g. 1274). Not unique across locations or over time; use id to identify the order.

  • source string or null required

    Where the customer placed the order: phone (Maple’s phone agent), web (the restaurant’s Maple ordering website), kiosk, or pos. Null for orders Maple did not classify.

  • notes string or null required

    What the customer asked for on the whole order (special instructions); null when nothing. Item requests are on each line item’s notes, delivery instructions on delivery_address.notes.

  • ready_by integer required

    When the order is due (Unix seconds): scheduled_for for a scheduled order, otherwise the time Maple gave the customer, the order time plus the prep time.

  • scheduled_for integer or null required

    Customer-selected completion time (Unix seconds) for scheduled orders; null for ASAP orders. Prepare the order for this time, not on receipt.

  • delivery_address object or null required

    The delivery address for delivery orders, including delivery instructions; null for pickup orders or when no stored address is available.

  • delivery_address.line1 string or null required

  • delivery_address.line2 string or null required

  • delivery_address.city string or null required

  • delivery_address.state string or null required

  • delivery_address.postal_code string or null required

  • delivery_address.country string or null required

  • delivery_address.notes string or null required

  • customer object required

  • customer.name string required

  • customer.phone string or null required

    Customer phone number in E.164 format (e.g. +14155552671); null when the customer provided none.

  • customer.phone_last_four string or null required

    Last four digits of the customer phone number.

  • line_items object[] required

  • line_items[].name string required

  • line_items[].external_id string or null required

  • line_items[].quantity number required

  • line_items[].base_price_money object required

  • line_items[].base_price_money.amount integer required

  • line_items[].base_price_money.currency string required

  • line_items[].tax_money object required

  • line_items[].tax_money.amount integer required

  • line_items[].tax_money.currency string required

  • line_items[].notes string or null required

  • line_items[].modifier_groups object[] required

  • line_items[].modifier_groups[].name string required

  • line_items[].modifier_groups[].external_id string or null required

  • line_items[].modifier_groups[].options object[] required

  • line_items[].modifier_groups[].options[].name string required

  • line_items[].modifier_groups[].options[].external_id string or null required

  • line_items[].modifier_groups[].options[].quantity integer required

  • line_items[].modifier_groups[].options[].price_money object required

  • line_items[].modifier_groups[].options[].price_money.amount integer required

  • line_items[].modifier_groups[].options[].price_money.currency string required

  • line_items[].modifier_groups[].options[].modifier_groups object[] required

  • line_items[].modifier_groups[].options[].modifier_groups[].name string required

  • line_items[].modifier_groups[].options[].modifier_groups[].external_id string or null required

  • line_items[].modifier_groups[].options[].modifier_groups[].options object[] required

  • line_items[].modifier_groups[].options[].modifier_groups[].options[].name string required

  • line_items[].modifier_groups[].options[].modifier_groups[].options[].external_id string or null required

  • line_items[].modifier_groups[].options[].modifier_groups[].options[].quantity integer required

  • line_items[].modifier_groups[].options[].modifier_groups[].options[].price_money object required

  • line_items[].modifier_groups[].options[].modifier_groups[].options[].modifier_groups object[] required

  • totals object required

    Each amount is { amount, currency }: amount in integer minor units (cents for USD). subtotal_money is the line items and their modifiers before discounts; discount_money is what discounts took off them; tax_money is the tax charged, after discounts; surcharge_money is Maple’s processing fee passed to the customer; service_charge_money is the restaurant’s own fees its POS adds to the check; tip_money is the tip for the restaurant. Two POS systems file the restaurant’s fees elsewhere: Toast counts its non-gratuity service charges in subtotal_money, and Chowbus fees are in surcharge_money. total_money is what the customer pays: the amount charged online, or for an in_store order the amount the restaurant should collect (Maple does not see what it took). It is subtotal - discount + tax + surcharge + service charge + tip + delivery fee + delivery tip.

  • totals.subtotal_money object required

  • totals.subtotal_money.amount integer required

  • totals.subtotal_money.currency string required

  • totals.discount_money object required

  • totals.discount_money.amount integer required

  • totals.discount_money.currency string required

  • totals.tax_money object required

  • totals.tax_money.amount integer required

  • totals.tax_money.currency string required

  • totals.surcharge_money object required

  • totals.surcharge_money.amount integer required

  • totals.surcharge_money.currency string required

  • totals.service_charge_money object required

  • totals.service_charge_money.amount integer required

  • totals.service_charge_money.currency string required

  • totals.tip_money object required

  • totals.tip_money.amount integer required

  • totals.tip_money.currency string required

  • totals.delivery_fee_money object required

  • totals.delivery_fee_money.amount integer required

  • totals.delivery_fee_money.currency string required

  • totals.delivery_tip_money object required

  • totals.delivery_tip_money.amount integer required

  • totals.delivery_tip_money.currency string required

  • totals.total_money object required

  • totals.total_money.amount integer required

  • totals.total_money.currency string required

  • payment object required

    How the customer pays. method: online (through a payment link or the ordering website) or in_store (at the restaurant, at pickup or delivery); null only when Maple recorded none. provider: the payment processor, null before a payment exists. payment_link_url: the link Maple sent the customer; null for in_store orders or before a link exists.

  • payment.method string or null required

  • payment.provider string or null required

  • payment.status string or null required

    Where the customer’s payment stands: pending (not paid yet; an in_store order stays pending until your app marks it paid with POST /v1/orders/{orderId}/pay), paid, failed (the payment did not go through), voided (Maple canceled the payment before it settled), refunded or partially_refunded. Null only when Maple recorded none.

  • payment.payment_link_url string or null required

Errors

  • 400 Bad request Invalid request (invalid_request_error), or idempotency_error for idempotency_key_mismatch

  • 401 Unauthorized Missing or invalid credential (authentication_error)

  • 403 Forbidden Not allowed (permission_error)

  • 404 Not found Not found (invalid_request_error)

  • 409 Conflict Conflicts with current state (invalid_request_error), or idempotency_error for idempotency_key_in_use

  • 415 Unsupported Content-Type (invalid_request_error)

  • 429 Too many requests Rate limit reached (rate_limit_error)

  • 500 Server error Maple could not complete the request (api_error)

Every error body is one error object: branch on its type and code; message is for people, param names the field at fault, and doc_url links the code on Errors.

A 429 also sends Retry-After: Seconds to wait before retrying; also returned as error.retry_after in the body.