Recipes
🦉
Checkout
Open Recipe

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

AttriubuteTypeDescription
fulfillment_methodStringAvailable fulfillment methods:
'patron_pickup', 'server_delivery', 'runner_with_cc', 'robot_delivery', 'driver_delivery', 'runner_nofeedback'
valid_promo_codesList of StringsList of promo codes that have been deemed valid
cartArray of objectsArray of cart objects.
guest_idstringid of the logged in guest
delivery_infoJSONJSON representation of delivery information
pricechecksArray of objectsArray of pricecheck objects. See the pricecheck endpoint for where to retrieve these and how they should be formatted
restaurant_idStringID of restaurant
extra_checkout_infoJSONExtra information added via custom questions on checkout
integration_featuresJSONJSON representation of integration information such as Stripe
checkout_idStringID of the checkout object
promo_codesArray of StringsList of promo codes applied by the user
feesArray of NumsList of fees applied at checkout
subtotal_amountNumSubtotal of the checkout amount in cents
tax_amountNumTax amount of the checkout amount in cents
extra_delivery_infoJSONJSON representation of the extra delivery info added via custom fields to the check
tip_amountNumTIp amount of the checkout amount in cents
checksArray of objectsArray of check objects

Check Object

AttributeTypeDescription
tip_centsNumTip amount of check in cents
itemsArray of ObjectsArray of cart items with payment information. See the Check Item Object reference for more detail.
seatnumThe seat number of the patron the check is for
chargeObjectSee the charge object definition below
feesArray of NumsList of fees applied to the check
sendReceiptObjectA JSON object that holds the phone and email to send the receipt to for the patron
Language
Authentication
Basic
base64
:
Click Try It! to start a request and see the response here!