Product

Understanding the 'Product' Concept in Lavanda

1. Definition: A product, in our context, is essentially the sellable item that guests select and purchase.

2. Composition:

  • Space: This refers to either a specific unit or a unit type within our inventory.

  • Pricing Line: The pricing structure can vary based on different durations such as nightly or calendar monthly rates.

  • Availability: Whether the space for this product is available

  • Terms of Sale: These dictate the conditions of the purchase and include elements like the cancellation policy.

  • Eligibility Criteria: The product may have specific prerequisites for purchase such as:

    • Length of stay requirements

    • Contractual obligations

    • Down-payment details

    • Associated fees

    • Billing cycles

3. Visibility: The product is what guests encounter and interact with on various booking platforms. Whether they're navigating Lavanda's in-house booking engine or exploring external channels like Booking.com and Airbnb, it's the product they see and select.

The commerce suite of APIs are to surface product options for potential guests to purchase, whereas the manage suite of APIs are for managing the product itself.

Manage

type Product {
    id: ID
    name: String # This is the internal name of the product
    space: Unit | UnitType
    cancellation {
        # Note: Not all cancellation policies are viable on all distribution channels
        # This will result in the product not being an option when creating a listing
        policy: CancellationPolicyCode
    }
    pricing {
        interval: 'nightly' | 'calendar_monthly'
        discount: PercentageDiscount | FixedDiscount
    }
    billing {
        initial: PercentageInitialBilling | FixedInitialBilling | IntervalInitialBilling
        ongoing {
            interval: 'days' | 'weeks' | 'calendar_months'
            intervalNumber: Number
            paymentMethods: String[] # card, bank_transfer, apple_pay, ...
        }
    }
    criteria {
        minTerm: Number # Minimum number of days to stay
        maxTerm: Number # Maximum number of days to stay
    }
}

type PercentageDiscount {
    percentage: Number
    perpetuity: Boolean
}

type FixedDiscount {
    amountCents: Number
    perpetuity: Boolean
}

type PercentageInitialBilling {
    percentage: String
    paymentMethods: String[] # card, bank_transfer, apple_pay, ...
}

type FixedInitialBilling {
    amountCents: Number
    paymentMethods: String[] # card, bank_transfer, apple_pay, ...
}

type IntervalInitialBilling {
    numberOfIntervals: Number
    paymentMethods: String[] # card, bank_transfer, apple_pay, ...
}

Create product

mutation {
    products {
        createProduct(
            product: Product
        )
    }
}

Search / list products

input ProductSearchQueryInput {
    workspaceIds: ID[]
}

query {
    products {
        search(
            q: ProductSearchQueryInput
        ) {
            edges {
                node: Product
            }
        }
    }
}

* For brevity cursor types have been excluded - See Pagination (Cursors)

** For brevity most connection keys have been excluded - See Connections

Update product

mutation {
    products {
        updateProduct(
            id: ID
            product: Product
        )
    }
}

Delete product

mutation {
    products {
        deleteProduct(
            id: ID
        )
    }
}

Commerce

query {
    listings {
        search(
            workspaceIds: ID[]
            buildingIds ID[]
            startDate: Date
            endDate: Date
            includeUnavailable: Boolean
            numberOfBedrooms: Number
            numberOfBathrooms: Number
            numberOfAdults: Number
            numberOfChildren: Number
        ) {
            edges {
                node {
                    # A subset of the Product type, with availablity information, and pricing calculations
                }
            }
        }
    }
}

Last updated