The Checkout endpoint if the final step in The Checkout Process. Here, the front-end should send Bbot's API a JSON object holding the information that has been culminated from earlier steps, as shown in both the example JSON and corresponding table. Some items of note are the various fulfillment methods, the Price Check object and information, and the information gathered from Handling Payment Information.
Once this has been submitted, you will either receive a successful or unsuccessful response. An error on the back-end side will return an error response with more information. An error in the Stripe payment handling will return a 200 response, but include an errorID and errorCode as noted in the Checkout Failure Object & Error Codes table. These will need some handling on the front end.
At the completion of this process, the checkout is complete!
Example Request JSON
{
"fulfillment_method": "patron_pickup",
"valid_promo_codes": [],
"guest_id": 156,
"cart_id": "b4ce9cbe-cb4b-4966-8dec-549f416bed81",
"cart":
[
{
"lineitem_id": "111800271",
"lineitem_tax_cents": 114,
"mods":
{
"b4ce9cbe-cb4b-4966-8dec-549f416bed97": [
{
"mods":
{},
"menuItemId": "b4ceba1f-32a9-484e-91b5-5b8a1fecba89",
"name_for_customer": "House Made Chips"
}]
},
"menuItemId": "b4ce892e-9cbd-4efd-83d3-151aad1a504e",
"frontend_post_discount_cents": 1286,
"displayed_tax_cents": 114,
"qty": 1,
"discounts": [],
"special_instructions": "",
"name_for_customer": "Ceviche",
"frontend_pre_discount_cents": 1286,
"customer_id": "ecde3351-606c-4971-ab5a-792bccb0e5e2",
"line_item_id": 111800271,
"lineitem_pretax_cents": 1286
},
{
"lineitem_id": "654946791",
"lineitem_tax_cents": 73,
"mods":
{
"b4ce9cbe-cb4b-4966-8dec-549f416bed97": [
{
"mods":
{},
"menuItemId": "b4ceba1f-32a9-484e-91b5-5b8a1fecba89",
"name_for_customer": "House Made Chips"
}],
"b4ce8824-6fe1-4fb1-a59e-9e3e64095178": [
{
"mods":
{},
"menuItemId": "b4ce8620-0a5e-4cb7-8343-7b3910745868",
"name_for_customer": "Gluten-Free Bun"
}]
},
"menuItemId": "b4cea6fa-ab3e-4a81-b20a-52fd74d63a88",
"frontend_post_discount_cents": 827,
"displayed_tax_cents": 73,
"qty": 1,
"discounts": [],
"special_instructions": "",
"name_for_customer": "1/4 lb Grilled Hot Dog",
"frontend_pre_discount_cents": 827,
"customer_id": "ecde3351-606c-4971-ab5a-792bccb0e5e2",
"line_item_id": 654946791,
"lineitem_pretax_cents": 827
},
{
"lineitem_id": "916464053",
"lineitem_tax_cents": 114,
"mods":
{
"b4ce9cbe-cb4b-4966-8dec-549f416bed97": [
{
"mods":
{},
"menuItemId": "32396r95-bce5-4574-92cd-afe2e2ec5b67",
"name_for_customer": "Pickle Chips"
}]
},
"menuItemId": "d2396895-bbv5-4178-84vd-afe2e2ec5u67",
"frontend_post_discount_cents": 1286,
"displayed_tax_cents": 114,
"qty": 1,
"discounts": [],
"special_instructions": "",
"name_for_customer": "Sloppy Joes",
"frontend_pre_discount_cents": 1286,
"customer_id": "ecde3351-606c-4971-ab5a-792bccb0e5e2",
"line_item_id": 916464053,
"lineitem_pretax_cents": 1286
}
],
"delivery_info":
{},
"pricechecks":
{},
"restaurant_id": "70d5db7a-c995-43fd-a651-eefee41af302",
"extra_checkout_info": [],
"integration_features":
{},
"promo_codes": [],
"fees": [],
"subtotal_amount": 3399,
"tax_amount": 301,
"extra_delivery_info": [],
"tip_amount": 680,
"checks": [
{
"tip_cents": 680,
"items": [
{
"tax_total": 114,
"cartItemId": 111800271,
"denominator": 1,
"numerator": 1,
"pretax_total": 1286
},
{
"tax_total": 73,
"cartItemId": 654946791,
"denominator": 1,
"numerator": 1,
"pretax_total": 827
},
{
"tax_total": 114,
"cartItemId": 916464053,
"denominator": 1,
"numerator": 1,
"pretax_total": 1286
}],
"seat": 1,
"charge":
{
"amount_cents": 4380,
"type": "saved_stripe",
"id": "b4deb3a7-1c99-48b4-9f61-f2dbe6b866aa",
"card_id": "b4deb3a7-1c99-48b4-9f61-f2dbe6b866aa"
},
"fees": [],
"sendReceipt":
{
"phone": "",
"email": ""
}
}]
}
Request Object Definitions
Attriubute | Type | Description |
---|---|---|
fulfillment_method | String | Available fulfillment methods:'patron_pickup', 'server_delivery', 'runner_with_cc', 'robot_delivery', 'driver_delivery', 'runner_nofeedback' |
valid_promo_codes | List of Strings | List of promo codes that have been deemed valid |
cart | Array of objects | Array of cart objects. |
guest_id | string | id of the logged in guest |
delivery_info | JSON | JSON representation of delivery information |
pricechecks | Array of objects | Array of pricecheck objects. See the pricecheck endpoint for where to retrieve these and how they should be formatted |
restaurant_id | String | ID of restaurant |
extra_checkout_info | JSON | Extra information added via custom questions on checkout |
integration_features | JSON | JSON representation of integration information such as Stripe |
checkout_id | String | ID of the checkout object |
promo_codes | Array of Strings | List of promo codes applied by the user |
fees | Array of Nums | List of fees applied at checkout |
subtotal_amount | Num | Subtotal of the checkout amount in cents |
tax_amount | Num | Tax amount of the checkout amount in cents |
extra_delivery_info | JSON | JSON representation of the extra delivery info added via custom fields to the check |
tip_amount | Num | TIp amount of the checkout amount in cents |
checks | Array of objects | Array of check objects |
Check Object
Attribute | Type | Description |
---|---|---|
tip_cents | Num | Tip amount of check in cents |
items | Array of Objects | Array of cart items with payment information. See the Check Item Object reference for more detail. |
seat | num | The seat number of the patron the check is for |
charge | Object | See the charge object definition below |
fees | Array of Nums | List of fees applied to the check |
sendReceipt | Object | A JSON object that holds the phone and email to send the receipt to for the patron |