OrderFulfillability specification

OrderFulfillability contains the information about the fulfillability of a customer order, including its individual Line Items.

message OrderFulfillability {
  // The result of an order fulfillability check.
  enum OrderFulfillabilityResult {
    // Default value: Don't use.
    ORDER_FULFILLABILITY_RESULT_UNSPECIFIED = 0;
    // The order can be fulfilled.
    CAN_FULFILL = 1;
    // The order cannot be fulfilled due to one or more unfulfillable line
    // item(s).
    UNFULFILLABLE_LINE_ITEM = 2;
    // The combination of the line items requested cannot be fulfilled.
    UNFULFILLABLE_SERVICE_COMBINATION = 3;
    // The order cannot be fulfilled due to reasons that do not fall into the
    // categories above.
    ORDER_UNFULFILLABLE_OTHER_REASON = 4;
  }

  OrderFulfillabilityResult result = 1;
  // Fulfillability results of all line items in this order (required).
  repeated LineItemFulfillability item_fulfillability = 2;
  // Additional description of the reason if the item is unfulfillable.
  // (optional)
  string unfulfillable_reason = 3;
}
// Fulfillability of a line item.
message LineItemFulfillability {
  // The line item of question. (required)
  LineItem item = 1;

  // The result of a line item fulfillability check.
  enum ItemFulfillabilityResult {
    // Default value: Don't use.
    ITEM_FULFILLABILITY_RESULT_UNSPECIFIED = 0;
    // This line item can be fulfilled.
    CAN_FULFILL = 1;
    // No adequate availability for the slot requested.
    SLOT_UNAVAILABLE = 2;
    // Child tickets cannot be booked without an adult ticket.
    CHILD_TICKETS_WITHOUT_ADULT = 6;
    // The combination of ticket types requested cannot be fulfilled.
    UNFULFILLABLE_TICKET_COMBINATION = 3;
    // The total price of this line item is not correct.
    INCORRECT_PRICE = 4;
    // The line item cannot be fulfilled since a ticket constraint specified by
    // the partner has been violated.
    TICKET_CONSTRAINT_VIOLATED = 7;
    // The line item cannot be fulfilled for reasons that do not fall into
    // the categories above.
    ITEM_UNFULFILLABLE_OTHER_REASON = 5;
  }
  // (required)
  ItemFulfillabilityResult result = 2;
  // Additional description of the reason if the item is unfulfillable.
  // (optional)
  string unfulfillable_reason = 3;
  // Updated availability for this slot can be piggybacked in
  // CheckOrderFulfillabilityResponse.
  message UpdatedAvailability {
    // Number of available spots for the given slot. 0 indicates no
    // availability. (required)
    int32 spots_open = 1;
  }
  // (optional)
  UpdatedAvailability availability = 4;
  // Updated ticket types can be piggybacked in
  // CheckOrderFulfillabilityResponse. If non-empty, all available ticket types
  // for this slot with up-to-date prices should be listed without omitting any.
  // (optional)
  repeated TicketType ticket_type = 5;

  // This represents the constraints imposed by the partner for enforcing
  // minimum and maximum number of tickets that can be purchased in a line-item.
  // This must be set if ItemFulfillabilityResult is TICKET_CONSTRAINT_VIOLATED.
  message ViolatedTicketConstraint {
    oneof value {
      int32 min_ticket_count = 1;
      int32 max_ticket_count = 2;
    }
  }

  ViolatedTicketConstraint violated_ticket_constraint = 6;
}
// The specific partner-named fees that must be paid for each ticket the user
// purchases.
message SpecificPerTicketFee {
  // ID of a ticket type.
  string ticket_id = 1;
  // A localized partner-provided name for this fee or tax.
  string fee_name = 2;
  // The amount of the fee or tax.
  Price fee_amount = 3;
}

// The specific partner-named fees that must be paid once per order, regardless
// of number of tickets.
message SpecificPerOrderFee {
  // A localized partner-provided name for this fee or tax.
  string fee_name = 1;
  // The amount of the fee or tax.
  Price fee_amount = 2;
}

// Breakdown of the specific, partner-named per-ticket and per-order fees and
// taxes.
message Fees {
  // Fees and taxes that must be paid for each ticket the user purchases.
  repeated SpecificPerTicketFee per_ticket_fee = 1;
  // Fees and taxes that must be paid once per order, regardless of the number
  // of tickets purchased.
  repeated SpecificPerOrderFee per_order_fee = 2;
}