API Reference

Motivation

Purchase Request is a new API that allows partners to request purchase orders on a merchant's SumUp POS. Once validated by the merchant, an order is created in the SumUp POS system. When compared to Delivery API v2, Purchase Request uses OAuth to authenticate all requests and uses more abstract terminology to describe purchases, which is not specific to restaurants.

Migrating

Authentication

Instead of using the partner_name, restaurant_token and provider_token in the request body to authenticate requests, Purchase Requests uses OAuth. More information available here. In short, the provided credentials are used to request an access token from the Auth Server and it needs to be included in every request’s Authorization header (Authorization: Bearer <access token>). When requesting the token to use Purchase Request, the purchase-request/write scope needs to be included.

Concept mapping

The terminology used in the Delivery API was focused on restaurants. For Purchase Request, the terminology has changed to cover other areas such as retail. We have compiled below a list mapping the terms used in Delivery API to the ones used in Purchase Request. You may also refer to the Glossary for more information.

Delivery API v2Purchase RequestDescription
RestaurantStoreRestaurants are now referred to as stores, a more general concept.
ProviderPartnerProviders are now partners. Partners are identified by their OAuth credentials and their information is excluded from the request body.
LineItemLineNew name, but still refers to an item.
OptionItemOptionLineNew name, refers to the options associated to an ItemLine.
MealLinePackageLineMeals are now referred to as packages, a more generic term. It refers to a list of items that are bundled together.
MealSubLinePackageItemLineRefers to an item contained in the package.
MealOptionPackageItemOptionLineRefers to an option associated with a PackageItemLine.

Request body attribute mapping

The general structure of the request didn’t change, however, besides the concept name changes mentioned above, there are changes to attributes. First of all, a camelCase is now used instead of snake_case. We have compiled below a table for each schema in Delivery API v2, which maps all changes in attributes when migrating to the corresponding Purchase Request schema.

Delivery API v2 - RequestPurchase Request - Purchase RequestComments
restaurant_token-The store id is now required as a path parameter.
provider_token-Removed, the information in the access token is now used to identify partners.
typepurchaseRequestTypeThis is now required.
external_referenceexternalId
store_reference-The store id is now required as a path parameter.
display_iddisplayName
datedate
pickup_timepickupTime
total_price-Removed.
total_vat-Removed.
is_paid-Removed. Have been replaced by payments field at the order level.
allow_denyallowDeny
provider-Removed, the information in the access token is now used to identify partners.
consumerconsumer
orderorder
-purchaseRequestType
Delivery API v2 - ConsumerPurchase Request - ConsumerComments
firstnamefirstname
lastnamelastname
phone_numberphoneNumber
emailemail
delivery_addressdeliveryAddress
billing_addressbillingAddress
Delivery API v2 - AddressPurchase Request - AddressComments
citycity
countrycountry
streetaddressLine1Street has been split into two address lines.
-addressLine2
-state
zip_codezipCode
commentcomment
Delivery API v2 - OrderPurchase Request - OrderComments
currency_codecurrencyCode
nb_consumersconsumerCount
priceprice
vattax
commentcomment
mealspackageLines
linesitemLines
discountsdiscounts
-paymentsReplacement of isPaid old field. Array of objects.
Delivery API v2 - MealLinePurchase Request - PackageLineComments
idpackageIdChanged type to integer.
external_idexternalId
unit_priceunitPriceChanged type to an object.
linesitemLines
discountdiscount
Delivery API v2 - MealSubLinePurchase Request - PackageItemLineComments
iditemIdChanged type to integer.
external_idexternalId
optionsoptionLines
-comment
Delivery API v2 - MealOptionPurchase Request - PackageItemOptionLineComments
iditemIdChanged type to integer.
external_idexternalId
Delivery API v2 - LinePurchase Request - ItemLineComments
iditemIdChanged type to integer.
namename
unit_priceunitPriceChanged type to an object.
menupriceBookId
vat_ratetaxRateMinimum 0.
external_idexternalId
type-Removed.
commentcomment
quantityquantityMinimum 1.
linesoptionLines
discountdiscount
Delivery API v2 - OptionPurchase Request - ItemOptionLineComments
iditemIdChanged type to integer.
namename
unit_priceunitPriceChanged type to an object.
vat_ratetaxRateMinimum 0.
external_idexternalId
type-Removed.
commentcomment
-quantityRequired, minimum 1.
Delivery API v2 - DiscountPurchase Request - DiscountComments
priceamount
namename
Delivery API v2 - SuccessResponsePurchase Request - SuccessResponse
successsuccess
partner_namepartnerName
external_referenceexternalId
-referenceIdOur internal id for the purchase request.
-storeId
statusstatus
display_iddisplayName