πŸ“˜

Type Notation

  • primitive/simple types like (strings, ints) are in lowercase.
  • decimal types have exact precision and are encoded as strings
  • Objects or resources are in camel-case.
  • for string types, utf8_string(n) means string must have exactly n characters, not bytes
  • for string types, utf8_string(i..j) means string must have at least i characters and at most j characters
  • for integers, we will use uint32 (for unsigned 32 bit ints)
  • arrays of Objects or primitives are denoted with [] after the type
  • timestamp type is an ISO8601 with timezone offset relative to UTC utf8_string encoding
  • uuid_hex is a UUID in hex encoding (32 characters)

Order

PropertyTypeDescription
objectutf8_string(1..256)object type, value: Order
yelp_order_iduuid_hex(may be null if creating an Order) unique identifier for Order that’s assigned when Order is created
order_linesOrderLine[]order lines
serviceServicepolymorphic service resource
billing_typeBillingTypepartner or yelp. Describes who collects the money and affects crediting.
collection_type CollectionTypeprepaid or postpaid. Describes whether money will be collected upfront or on explicit /complete call from partner. CURRENTLY ONLY prepaid is SUPPORTED.
partner_business_idutf8_string(1..100)partner’s id of business that is β€œfulfilling” the order
partner_order_idutf8_string(1..64)an order id provided by partner for this order for partner’s tracking purposes
customer_addressAddressaddress of customer, may be null
merchant_commission_ratefloat (0.0 - 1.0)sets the proportion of the total cost of goods which is given to the merchant. If this is not provided, it will default to the value in the partner contract. On updates, if this is missing, the existing merchant_commission_rate will be used. This field is only used as part of order create and update requests.

Validation

  • order_lines must have at least one OrderLineItem or OrderLineBooking or OrderLineMedicalCompliant.
  • order_lines must have at least one OrderLineTax ($0 amount is okay for states, cities, etc. with no tax). We are requiring tax lines (even for $0) to be explicit that Yelp doesn't handle tax (yet), and the partner is responsible for specifying it.
  • order_lines must total to $0 or greater
  • partner_business_id must map to a yelp_business_id, which we determined when they uploaded their business feed to us via Data Ingestion API
  • merchant_commission_rate is enabled on a per partner basis at this time.

Service

PropertyTypeDescription
objectutf8_string(1..256)object type, value: Service
typeServiceTypethe ServiceType enum (e.g. food)
optionOptionTypethe OptionType enum (e.g. at_customer)

ServiceType enum

Type Value (utf8_string)Description
foodOrders for food-related goods (food delivery, takeout)
bookingOrders that are reserving appointments (e.g. spas) or requesting a service at a future date (e.g. plumber, repairs)
hotel_reservationOrders that reserve hotel rooms
restaurant_reservationOrders that reserve tables at restaurants
goodsOrders for physical non-food items
club_serviceOrders for club service (table booking and bottles)
medical_compliantOrders that are reserving medical appointments (e.g. dentist, doctor)

OptionType enum

Type Value (utf8_string)Description
at_customerService will be at customer’s address or food will be delivered to customer’s address
at_businessService will be at business’ address or food will be picked up at business’ address

BillingType enum

Type Value (utf8_string)Description
partnerPartner will collect payment from the business, which will in turn collect it directly from the customer. Yelp will debit Partner’s account for revenue sharing purposes.
yelpYelp will collect payment from the customer (via credit card). Yelp will credit Partner’s account for revenue sharing purposes.

CollectionType enum

Type Value (utf8_string)Description
prepaidYelp will collect payment from the user as soon as order is submitted, without any explicit action from partner.
postpaidNOT SUPPORTED.

OrderLine

OrderLine is polymorphic on the object field. The resources below describe the different types of OrderLines and what fields are required per type.

OrderLine object types

Type Value (utf8_string)Description
OrderLineItemA regular line describing a good being purchased, or a service
OrderLineBookingA line describing a reservation booking
OrderLineTipA line for specifying a tip amount
OrderLineTaxA line for specifying a tax amount
OrderLineMedicalCompliantA line for specifying a medical compliant reservation
OrderLineAdjustmentA line for specifying misc adjustments e.g. discounts, delivery fee, etc.

πŸ“˜

Notes

  • OrderLine is polymorphic instead of Order
  • OrderLine loosely corresponds to lines you would see on customer receipt or invoice and its structure depends on the partner. More information can be placed in description or can be split out into another OrderLine.

OrderLineTax, OrderLineAdjustment, OrderLineTip

If OrderLineAdjustment is used for specifying service fee, Please prefix while specifying name property. For example, "Yelp Test" partner would provide name as "Yelp Test Service Fee".

PropertyTypeDescription
objectutf8_string(1..256)one of OrderLineTax, OrderLineAdjustment, OrderLineTip
nameutf8_string(2..256)name of item/service
quantityuint32number of units being purchased
priceCurrencyprice per unit (could be negative)

OrderLineItem

PropertyTypeDescription
objectutf8_string(1..256)object type, value: OrderLineItem
nameutf8_string(2..256)name of item/service
description utf8_string(0..1024)(optional) plaintext details about or customizations for item/service. newline-delimited (\n)
quantityuint32number of units being purchased
priceCurrencyprice per unit (could be negative)
partner_item_idutf8_string(0..64)partner’s unique id for what’s being purchased with this OrderLine

OrderLineMedicalCompliant

PropertyTypeDescription
objectutf8_string(1..256)object type, value: OrderLineMedicalCompliant
nameutf8_string(2..256)name of item/service
descriptionutf8_string(0..1024)plaintext details about or customizations for item/service. newline-delimited (\n)
quantityuint32number of units being purchased
priceCurrencyprice per unit (could be negative)
partner_item_idutf8_string(0..64)partner’s unique id for what’s being purchased with this OrderLine
cancellation_policy CancellationPolicy(optional) polymorphic object

OrderLineBooking

PropertyTypeDescription
objectutf8_string(1..256)object type, value: OrderLineBooking
nameutf8_string(2..256)name of item/service being reserved
description utf8_string(0..1024)(optional) plaintext details about or customizations for item/service. newline-delimited (\n)
priceCurrencyprice for reservation (could be negative). This is total value of the service. At the service time, the customer is expected to pay (price - upfront_price)
partner_item_idutf8_string(0..64)partner’s unique id for what’s being purchased with this OrderLine
start_timetimestampstart datetime of reservation
end_time timestamp(optional) end datetime of reservation
cancellation_policy CancellationPolicy(optional) polymorphic object
quantityuint32number of items being reserved

Validation

  • quantity must be >= 1 for all types
  • price is required for all types but may be 0
  • In cases where cancellation_policy object is missing, Yelp assumes that there is no cancellation policy to enforce, and the user can cancel an appointment without any penalty up to the start of the appointment.

Address

PropertyTypeDescription
objectutf8_string(1..255)object type, value: Address
address1utf8_string(0..255)address line 1
address2utf8_string(0..255)(optional) address line 2
address3utf8_string(0..255)(optional) address line 3
cityutf8_string(1..255)city / district / town / village
regionutf8_string(1..64)state (US) or region
postal_codeutf8_string(1..64)postal code
county utf8_string(0..255)(optional) county
countryutf8_string(2)country code (ISO 3166-1 alpha 2)

Currency

PropertyTypeDescription
amountdecimal(10, 3)currency amount with exact precision; number of decimal places should follow ISO 4217
currency_codeutf8_string(3)3-char code ISO 4217

Validation

  • amount must be above -10,000,000 and below 10,000,000.

CustomerAddressConstraint

This is provided as an availablity_constraint of Opportunity

PropertyTypeDescription
objectutf8_string(1..128)the object type, value: CustomerAddressConstraint
customer_address_strutf8_string(1..256)original user-inputted address string
customer_addressAddressaddress of customer, may be null

FulfillmentUserInfo

PropertyTypeDescription
first_nameutf8_string(1..256)first name
last_nameutf8_string(1..256)last name
emailutf8_string(1..256)email
phoneutf8_string(7..32)phone number
availability_constraints polymorphic availability_constraints[](optional) This is a list of constraints entered by the user. At the moment, it may be CustomerAddressConstraint

CancellationPolicy

A polymorphic object that describes when a particular cancellation action (e.g. it's ok to cancel, the user must contact business, etc). The following object types are supported.

Object typeDescription
AlwaysCancellationPolicyan action that applies unconditionally
MinutesBeforeCancellationPolicyan action that applied specified period of time before the appointment begins.

AlwaysCancellationPolicy

Indicates that the cancellation action applies unconditionally of time.

PropertyTypeDescription
objectutf8_string(1..256)object type, value: AlwaysCancellationPolicy
flat_fee Currency(optional): a flat cancellation fee that applies to cancellation (e.g. $10 fee independent of the value of the service).
violation_actionViolationActionEnumindicates who should enforce the cancellation policy and how, in cases when User wants to cancel within cancellation policy window

MinutesBeforeCancellationPolicy

PropertyTypeDescription
objectutf8_string(1..256)object type, value: MinutesBeforeCancellationPolicy
minutes_beforeintegerdescribes a cancellation policy that is in effect if current time is within this many minutes before the appointment start time (E.g. 24 hours would be minutes_before=24*60)
violation_actionViolationActionEnumindicates who should enforce the cancellation policy and how, in cases when User wants to cancel within cancellation policy window

ViolationActionEnum

Describes who should enforce the cancellation fee and how

Type Value (utf8_string)Description
contact_businessYelp will show user a message to call/contact the business for cancellation. Whether a cancellation fee is waived, or partially or fully applied is up to the discretion of the business/partner.

Opportunity

This resource represents a user's request to enter the ordering flow.

PropertyTypeDescription
opportunity_iduuid_hexunique identifier for this Opportunity
partner_business_idutf8_string(1..100)partner’s business id to check availability against. Partner provided this to Yelp via Data Ingestion.
request_timetimestampISO8601 UTC, time user requested
service_typeServiceTypeservice type enum
selected_optionOptionTypeoption selected by user
availability_constraintspolymorphic availability_constraints[]This is a list of constraints entered by the user. At the moment, it may be CustomerAddressConstraint

CouponInfo

PropertyTypeDescription
codeutf8_string(1..256)coupon code that was applied to Order. This could be null if no coupon was applied to this Order.
discountCurrencydiscount amount for the applied coupon

OrderStatus

PropertyTypeDescription
yelp_order_iduuid_hexunique identifier of Order
order_statusOrderStatusCodestatus of Order (see status codes below)
time_createdtimestamptime Order was created
time_updatedtimestamptime Order was last updated

OrderStatusCode enum

Type Value (utf8_string)Description
pending_user_submitwaiting for user to provide billing/required information and to confirm purchase or reservation
charge_pendingwaiting for the billing to charge user
update_pendingYelp is processing an /update call
cancel_pendingYelp is processing a /cancels call
ready_for_fulfillmentOrder is in a completed state and Yelp is not waiting on the Partner to call any other API endpoint. Partner/business could fulfill orders in this state.
cancelledorder was cancelled by partner
cancelled_by_yelporder was cancelled by Yelp because there has been no action on it after a while or for other reasons like security
cancelled_by_userorder was cancelled by user
cancel_by_user_pendingYelp is processing a cancel by user request.

OperationType enum

Type Value (utf8_string)Description
chargeuser submitted purchase on the Yelp checkout page
updateupdate operation requested by partner
cancelcancel operation requested by partner.

OperationStatus enum

Type Value (utf8_string)Description
successoperation specified from OperationType is successful
failedoperation specified from OperationType failed
pendingoperation specified from OperationType is pending

TransactionStatusChange

PropertyTypeDescription
operation_typeOperationTypeoperation as requested by partner or user
amountCurrencydepending on the operation_type, this is charged or refunded amount.
time_updatedtimestampUTC time notification was created
operation_statusOperationStatusstatus of the above operation request

OrderStatusChangeNotification

PropertyTypeDescription
notification_iduuid_hexuuid identifying this notification
yelp_order_iduuid_hexuuid identifying order
order_request_id utf8_string(0..32)(optional) present for notifications corresponding to /update and /cancel partner requests
time_createdtimestampUTC time notification was created
order_statusOrderStatusCodethe most current order status regardless of when the notification was created
coupon CouponInfo(optional) includes discount information if Yelp coupon was applied for this order
user_info FulfillmentUserInfo(optional) user information required for fulfilling this order, will only be present for charge operation_type
transaction_status_changeTransactionStatusChangeTransaction operation requested by partner and status of the operation
billing_typeBillingTypeCorresponds to the billing type of the order

ConfirmationType enum

Type Value (utf8_string)Description
order_confirmedThe order is confirmed
delivery_in_progressThe delivery is in progress

CheckoutConfirmationStatusBody

PropertyTypeDescription
confirmation_typeConfirmationTypeThe state the order is being updated to
eta_in_minutesintegerThe estimated time of arrival

CancellationScenario enum

Type Value (utf8_string)Description
cancelled_by_user_via_yelpThis /cancel call would be in response to AWAITING_CANCEL_POLICY_RESOLUTION, which the case where a user initiated a cancel on the yelp, yelp notified the partner of user’s intent, and now yelp is waiting for the partner to call /cancels with an appropriate cancellation_fee and bring the order to one of the cancelled states. Yelp Platform Action: fully refund the order and set it to CANCELLED or CANCELLED_WITH_FEE state.
cancelled_by_partnerAdministrative cancelled by partner. In this case, cancellation_fee should not be present in the POST request body. Yelp Platform Action: fully refund the order and set it to CANCELLED state.
customer_no_showBusiness has reported to the partner that the customer was not at the appointment. cancellation_fee contains the penalty that business wishes to charge the customer. YTP Action: charge the user the cancellation_fee, and set the order to CANCELLED or CANCELLED_WITH_FEE as appropriate.
customer_contacted_business_to_cancelCustomer contacted the business and cancelled the appointment. cancellation_fee contains the penalty that business wishes to charge the customer. If customer cancels in time when and no penalty applies, cancellation_fee should be $0. YTP Action: charge the user the cancellation_fee, and set the order to CANCELLED or CANCELLED_WITH_FEE as appropriate.
customer_cancelled_through_yelpThis is an order cancelled by Yelp, most likely because a customer contacted Yelp requesting a cancel / disputing an order.