Overview

Checkout is the final endpoint in the customer order flow. It is used to retrieve available payment options and to book orders.

Get Payments

HTTP Request

GET /customer/cart/{merchant_id}/checkout

Request Parameters

{
 "order_type": "pickup",
 "order_time": "2014-01-19T08:00:00-0500"
}
Property Name Type Notes
Required Properties
order_time String Must be ISO8601 format
order_type String Must be either ‘pickup’ or ‘delivery’

Success Response

HTTP 200 OK

{
   "message":[

   ],
   "allowed_payment_methods":[
      "cash",
      "credit_balance",
      "credit_card",
      "gift_code",
      "promo",
      "nonce_androidpay",
      "nonce_applepay",
      "nonce_paypal",
      "nonce_venmo",
      "visa_checkout"
   ],
   "disallowed_payment_methods":[

   ],
   "payment_methods":{
      "credit_card":[
         {
            "last_four":"3214",
            "cc_type":"Visa",
            "id":"123456",
            "exp_month":"6",
            "exp_year":"2018",
            "last_used":null
         }
      ],
      "name":"Test Merchant 20130315",
      "merchant_id":13431,
      "cash":{
         "max":65
      },
      "promo":[
         {
            "name":"Employee Deal",
            "id":35363,
            "minimum":0,
            "expires":"2020-06-28T23:59:00-0400",
            "code":null,
            "first_order":false,
            "total_uses":null,
            "limitType":null,
            "valueLimit":null,
            "checkout_message":"Note that the receipt from the merchant will not reflect the discount.",
            "value":10,
            "reward":"percent_off",
            "customer_group":"all",
            "is_vertical_specific":false,
            "verticals":null,
            "is_merchant_specific":false,
            "merchants":[

            ],
            "is_selectable":1,
            "selectable_message":null,
            "selectable_reason":null
         },
         {
            "name":"VisaCheckout",
            "id":1154227,
            "minimum":5.01,
            "expires":"2016-10-01T23:59:00-0400",
            "code":null,
            "first_order":false,
            "total_uses":1,
            "limitType":null,
            "valueLimit":null,
            "checkout_message":"Receive $5.00 off your order when use VisaCheckout.",
            "value":5,
            "reward":"dollar_off",
            "customer_group":"all",
            "is_vertical_specific":false,
            "verticals":null,
            "is_merchant_specific":false,
            "merchants":[

            ],
            "is_selectable":1,
            "selectable_message":null,
            "selectable_reason":null
         },
         {
            "name":"$5 off for Pander Users",
            "id":1424949,
            "minimum":15,
            "expires":"2017-01-03T00:00:00-0500",
            "code":null,
            "first_order":false,
            "total_uses":1,
            "limitType":null,
            "valueLimit":null,
            "checkout_message":"",
            "value":5,
            "reward":"dollar_off",
            "customer_group":"all",
            "is_vertical_specific":false,
            "verticals":null,
            "is_merchant_specific":false,
            "merchants":[

            ],
            "is_selectable":0,
            "selectable_message":"The selected deal does not apply for this platform.",
            "selectable_reason":"PLATFORM_MISMATCH"
         }
      ],
      "gift_code":[
         {
            "value":77.05,
            "last_four":"4JKT",
            "id":"3806031"
         },
         {
            "value":31.12,
            "last_four":"F726",
            "id":"3826096"
         }
      ],
      "credit_balance":[

      ],
      "paypal":true
   },
   "concur":false,
   "sms_notify":false,
   "has_used_visa_checkout":true
}

Place Order – Authenticated Users

HTTP Request

POST /customer/cart/{merchant_id}/checkout

Request Body

{
   "order_type":"delivery",
   "order_time":"ASAP",
   "location_id":3276032,
   "payments":[
      {
         "type":"credit_card",
         "id":1
      }
   ],
   "instructions":"",
   "save_instructions":false,
   "sms_notify":false,
   "extra_options":{
      "mute_concur":true
   },
   "phone_number":"6464030033",
   "tip":"0.00",
   "merchant_id":"13431",
   "client_id":"MDlkMzY3Nzg3MjU1ZjRkNmY4OWZjNDA0NjBjMTI0MWZl"
}

Request Body Split Payment

You can split an order among multiple credit cards.  A split payment can only be made among credit cards.  Gift cards and promos cannot be applied. Other than the amount field, the call is identical to the standard checkout api call. The amounts must add up to the order total, including tip.  Note: if you don’t wish a do a split payment order the amount field should not be present.

{
  "tip": 1.00,
  "location_id": 10,
  "uhau_id" : 12345,
  "instructions": "Don't burn my toast again, grandma!",
  "payments": [
    {
      "type": "credit_card",
      "id": 1,
      "amount": 5.00
    },
    {
      "type": "credit_card",
      "id": 2,
      "amount": 10.00
  ],
  "order_type": "delivery",
  "order_time": "2014-01-19T08:00:00-0500"
}
Property Name Type Notes
Required Properties
order_type String Must be either ‘pickup’ or ‘delivery’
payments PaymentType[]
location_id int Required ONLY for delivery orders
Optional Properties
tip Double Generally used for delivery orders only
order_time String Must be ISO8601 format
instructions String Maximum 100 characters
uhau_id int User Hear About Us ID. Please use this to associate the order to your account.
sms_notify Boolean Whether to send the customer an SMS when their order is confirmed by the merchant

Payments Types Array

This array contains objects that specify which payment methods will be used to pay for an order. The id and type for each object must correspond to the payment_methods object properties returned in the GET response. Omit payment types from the array that won’t be used to pay for the order.

Payment Type Notes
cash Doesn’t require an an id attribute
credit_card
promo
gift_code
nonce
credit_balance Delivery.com’s user promotion credit

Special Cash Order Considerations

  • Cash can be applied to an order only if the order total is less than or equal to payment_methods.cash.max in the GET response.
  • Cash can NOT be combined with any other payment method

Example Configurations

//Cash order
[
  {
    "type": "cash"
  }
]
//Nonce order
[
  {
    "type":"nonce",
    "value": "bb08093c-1ewe-47as-9asd-063508a11f67"
  }
]
//Credit card and promo payment combination array
[
  {
    "type": "credit_card",
    "id": 1
  },
  {
    "type": "promo",
    "id": 10
  }
]

Success Response

HTTP 200 OK

{
  "code": "ok",
  "delivery_points": 1000,
  "order_id": 123456,
  "user_msg": "Order successfully placed.",
  "dev_msg": "Order successfully placed."
}

Error Responses

Merchant Not Found Response

You receive this response when no merchant exists for merchant_id or the merchant is inactive.
HTTP 400 Bad Request

{
  "message": [
    {
      "code": "no_rest",
      "user_msg": "Merchant not found.",
      "dev_msg": "Merchant not found."
    }
  ]
}

Bad Order Time Response

You receive this response for invalid order times.
HTTP 400 Bad Request

{
  "message": [
    {
      "code": "chkout_error",
      "user_msg": "There was a problem with checkout.",
      "dev_msg": "There was a problem with checkout."
    },
    {
      "code": "cart_invalid_future",
      "user_msg": "Order time too far into the future.",
      "dev_msg": "Order time too far into the future."
    },
    {
      "code": "cart_invalid_time",
      "user_msg": "Order time can not be in the past.",
      "dev_msg": "Order time can not be in the past."
    },
    {
      "code": "cart_time_unavailabile",
      "user_msg": "Merchant is closed at the requested time.",
      "dev_msg": "Merchant is closed at the requested time."
    },
    {
      "code": "ckout_asap_unavailable",
      "user_msg": "he merchant is not currently available for ordering. Please select a future order time.",
      "dev_msg": "he merchant is not currently available for ordering. Please select a future order time."
    }
  ]
}

More Checkout Error Response

You receive this response when the order subtotal doesn’t meet the minimum.
HTTP 400 Bad Request

{
  "message": [
    {
      "code": "ckout_min_not_met",
      "user_msg": "Subtotal minimum does not meet $:minimum.",
      "dev_msg": "Subtotal minimum does not meet $:minimum."
    }
  ]
}

You receive this response when you are using a location id that is out of service range.
HTTP 400 Bad Request

{
  "message": [
    {
      "code": "ckout_bad_loc",
      "user_msg": "Your address is not currently serviceable.",
      "dev_msg": "Your address is not currently serviceable."
    }
  ]
}

You receive this response when there is already a checkout process for this same order.
HTTP 400 Bad Request

{
  "message": [
    {
      "code": "ckout_in_progress",
      "user_msg": "Checkout is in progress, please wait.",
      "dev_msg": "Checkout is in progress, please wait."
    }
  ]
}

You receive this response when you’re trying to checkout an empty cart.
HTTP 400 Bad Request

{
  "message": [
    {
      "code": "ckout_empty_cart",
      "user_msg": "Your cart is empty. Please add some items before checking out.",
      "dev_msg": "Your cart is empty. Please add some items before checking out."
    }
  ]
}

You receive this response when you’re trying to checkout using cash as a payment method, but that merchant doesn’t accept cash order up to that amount.
HTTP 400 Bad Request

{
  "message": [
    {
      "code": "cash_not_allowed_merch_max",
      "user_msg": ":merchant_name only accepts cash orders up to $ :max_price. Please use a different payment method or remove some items from your bag.",
      "dev_msg": ":merchant_name only accepts cash orders up to $ :max_price. Please use a different payment method or remove some items from your bag."
    }
  ]
}

Error Responses – Split Payment

Card Declined Error

You will receive this error if  one of the cards is declined for any reason.

{
  "message": [
       {
         "code": "cc_number_declined",
         "user_msg": "Sorry, that credit card was declined. Please try re-entering the card details, since the expiration date or zip code may have changed, or use a different card.",
         "dev_msg": "Expired Card on card:2"
      }
   ]
}

Order Balance Not Met Error

You will receive this error if the amounts on the cards don’t add up to the order total.

{
    "message": [
         {
           "code": "balance_not_met",
           "user_msg": "The order balance has not been met.",
           "dev_msg": "The order balance has not been met"
         }
    ]
}

Missing amount error

You will receive this error of you don’t provide amounts for every payment type.

{
    "message": [
         {
           "code": "missing_amount_values",
           "user_msg": "messages.missing_amount_values",
           "dev_msg": "Missing amount parameter for some payments"
         }
    ]
}

Place Order – Guest Users

IMPORTANT : THIS API CALL TAKES A GUEST TOKEN RATHER THAN AN AUTHORIZATION TOKEN

HTTP Request

POST /guest/cart/{merchant_id}/checkout

Request Body

{
   "order_type":"delivery",
   "order_time":"ASAP",
   "street":"199 Water St",
   "city":"New York",
   "state":"NY",
   "zip_code":"10038",
   "unit":"Apt 300",
   "payments":[
      {
         "type":"credit_card",
         "card":{
            "cc_number":"4111111111111111",
            "exp_year":"2024",
            "exp_mon":"08",
            "cvv":"123",
            "billing_zip":"11223",
            "save":false
         }
      }
   ],
   "instructions":"",
   "sms_notify":false,
   "isOptingIn" : true,
   "phone_number":"2125551212",
   "tip":"3.90",
   "merchant_id":"69391",
   "first_name":"sa",
   "last_name":"yo",
   "email":"sa@yo.com",
   "client_id":"xxxxxxxxxxxxxxxx",
   "uhau_id" : 12345
}
Property Name Type Notes
Required Properties
order_type String Must be either ‘pickup’ or ‘delivery’
payments PaymentType[]
phone_number String User’s phone number as 10 character string
first_name String User’s first name
last_name String User’s last name
email String User’s email address
Optional Properties
tip Double Generally used for delivery orders only
order_time String Must be ISO8601 format
street String User’s street address (Required for delivery orders)
city String User’s city (Required for delivery orders)
state String User’s state as a 2 character string (Required for delivery orders)
zip_code String User’s city (Required for delivery orders)
unit String User’s apartment/unit number
instructions String Maximum 100 characters
uhau_id int User Hear About Us ID. Please use this to associate the order to your account.
sms_notify Boolean Whether to send the customer an SMS when their order is confirmed by the merchant
isOptingIn Boolean Whether to allow delivery.com to send customer promotion and marketing emails

Success Response

HTTP 200 OK

{
  "code": "ok",
  "delivery_points": 1000,
  "order_id": 123456,
  "user_msg": "Order successfully placed.",
  "dev_msg": "Order successfully placed."
}

Error Responses

See Authenticated Checkout.