hostex

package module
v0.0.0-...-235e5c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2025 License: MIT Imports: 9 Imported by: 0

README

hostex-go

Go Reference Go Report Card

A Go client library for the Hostex API v3.0.0 (Beta). Hostex is a property management platform that provides APIs for managing reservations, properties, availabilities, messaging, reviews, and more.

Features

  • Complete API Coverage: All Hostex API v3.0.0 endpoints
  • Type-Safe: Comprehensive type definitions for all API entities
  • Context Support: All methods accept context for cancellation and timeouts
  • Error Handling: Detailed error responses with API error codes
  • Clean API: Idiomatic Go interfaces and patterns
  • Well Documented: Extensive documentation and examples
  • Production Ready: Built for reliability and performance

Installation

go get github.com/keithah/hostex-go

Quick Start

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/keithah/hostex-go"
)

func main() {
	// Create a new client
	client, err := hostex.NewClient(hostex.Config{
		AccessToken: "your_hostex_api_token",
	})
	if err != nil {
		log.Fatal(err)
	}

	// List properties
	properties, err := client.ListProperties(context.Background(), nil)
	if err != nil {
		log.Fatal(err)
	}

	for _, property := range properties.Properties {
		fmt.Printf("%s (ID: %d)\n", property.Title, property.ID)
	}
}

API Coverage

Properties
  • ListProperties - List all properties
  • ListRoomTypes - List room types
Reservations
  • ListReservations - Search and filter reservations
  • CreateReservation - Create direct bookings
  • CancelReservation - Cancel reservations
  • UpdateLockCode - Update stay lock codes
  • GetCustomFields - Get custom field values
  • UpdateCustomFields - Update custom fields
Availabilities
  • ListAvailabilities - Check property availability
  • UpdateAvailabilities - Block/open dates
Conversations (Messaging)
  • ListConversations - List guest conversations
  • GetConversation - Get conversation details and messages
  • SendMessage - Send messages to guests
Reviews
  • ListReviews - Query reviews
  • CreateReview - Leave reviews or replies
Webhooks
  • ListWebhooks - List configured webhooks
  • CreateWebhook - Register new webhooks
  • DeleteWebhook - Remove webhooks
Listings
  • GetListingCalendar - Get listing calendars
  • UpdateListingPrices - Update channel prices
  • UpdateListingInventories - Update inventory levels
  • UpdateListingRestrictions - Update restrictions
Utilities
  • ListCustomChannels - List custom channels
  • ListIncomeMethods - List income methods

Usage Examples

List Recent Reservations
reservations, err := client.ListReservations(ctx, &hostex.ListReservationsParams{
	Status:           "accepted",
	StartCheckInDate: "2024-01-01",
	Limit:            50,
})
if err != nil {
	log.Fatal(err)
}

for _, res := range reservations.Reservations {
	fmt.Printf("%s: %s (%s to %s)\n",
		res.ReservationCode,
		res.GuestName,
		res.CheckInDate,
		res.CheckOutDate,
	)
}
Send a Message
err := client.SendMessage(ctx, "conversation_id", hostex.SendMessageData{
	Message: "Thank you for your booking! Check-in is at 3 PM.",
})
if err != nil {
	log.Fatal(err)
}
Update Availability
err := client.UpdateAvailabilities(ctx, hostex.UpdateAvailabilitiesData{
	PropertyIDs: []int{12345},
	Dates:       []string{"2024-07-15", "2024-07-16"},
	Available:   false, // Block these dates
})
if err != nil {
	log.Fatal(err)
}
Create a Direct Booking
reservation, err := client.CreateReservation(ctx, hostex.CreateReservationData{
	PropertyID:       "12345",
	CustomChannelID:  1,
	CheckInDate:      "2024-07-01",
	CheckOutDate:     "2024-07-07",
	GuestName:        "Jane Smith",
	Currency:         "USD",
	RateAmount:       84000, // $840.00 in cents
	CommissionAmount: 8400,
	ReceivedAmount:   75600,
	IncomeMethodID:   1,
})
if err != nil {
	log.Fatal(err)
}

fmt.Printf("Created reservation: %s\n", reservation.Reservation.ReservationCode)
Get Conversation Messages
conversation, err := client.GetConversation(ctx, "conversation_id")
if err != nil {
	log.Fatal(err)
}

fmt.Printf("Guest: %s\n", conversation.Guest.Name)
for _, msg := range conversation.Messages {
	fmt.Printf("[%s] %s: %s\n",
		msg.CreatedAt.Format("2006-01-02 15:04"),
		msg.SenderRole,
		msg.Content,
	)
}

Configuration

Custom HTTP Client
import (
	"net/http"
	"time"
)

client, err := hostex.NewClient(hostex.Config{
	AccessToken: "your_token",
	HTTPClient: &http.Client{
		Timeout: 60 * time.Second,
		Transport: &http.Transport{
			// Custom transport settings
		},
	},
})
Custom Base URL
client, err := hostex.NewClient(hostex.Config{
	AccessToken: "your_token",
	BaseURL:     "https://api-staging.hostex.io/v3",
})
Custom Timeout
client, err := hostex.NewClient(hostex.Config{
	AccessToken: "your_token",
	Timeout:     60 * time.Second,
})

Error Handling

All API methods return errors that include the Hostex API error code and message:

reservations, err := client.ListReservations(ctx, nil)
if err != nil {
	// Error includes API error code and message
	log.Printf("API error: %v", err)
	return
}

Context Usage

All API methods accept a context.Context parameter for cancellation and timeouts:

// With timeout
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

properties, err := client.ListProperties(ctx, nil)

// With cancellation
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

// Cancel the request if needed
cancel()

Documentation

Testing

The library includes comprehensive integration tests covering all API endpoints.

Running Tests
# Run unit tests (no API key needed)
make test-unit

# Run integration tests (requires API key)
export HOSTEX_API_KEY=your_key
make test-integration

# Or source .env file
source .env
make test-integration

# Run all tests with coverage
make test-all

# Check code quality
make check
Test Coverage

All endpoints are tested with comprehensive integration tests:

  • Properties - List, filter, pagination
  • Room Types - List, filter
  • Reservations - List, filter by status/date/property/code
  • Custom Fields - Get and update
  • Conversations - List, get details, pagination
  • Reviews - List, filter by status/property/code
  • Availabilities - List
  • Listings - Get calendar
  • Webhooks - List
  • Custom Channels - List
  • Income Methods - List

Tests that modify data (create/update/delete) are marked as skipped in automated runs to avoid affecting production data.

Continuous Integration

GitHub Actions runs tests automatically on every push:

  • Unit tests run on all PRs and pushes
  • Integration tests run on pushes to main (when HOSTEX_API_KEY secret is configured)
  • Code quality checks (formatting, vet, staticcheck)

Requirements

  • Go 1.18 or higher

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes and add tests
  4. Run tests: go test ./...
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support


Note: This library is not officially supported by Hostex. It's a community-driven project to provide Go developers with easy access to the Hostex API.

Documentation

Overview

Package hostex provides a Go client library for the Hostex API v3.0.0

Index

Constants

View Source
const (
	// DefaultBaseURL is the default Hostex API base URL
	DefaultBaseURL = "https://api.hostex.io/v3"

	// DefaultTimeout is the default HTTP client timeout
	DefaultTimeout = 30 * time.Second

	// UserAgent is the user agent string sent with requests
	UserAgent = "hostex-go/1.0.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	RequestID string      `json:"request_id"`
	ErrorCode int         `json:"error_code"`
	ErrorMsg  string      `json:"error_msg"`
	Data      interface{} `json:"data,omitempty"`
}

APIResponse represents a standard Hostex API response

type AvailabilitiesResponse

type AvailabilitiesResponse struct {
	Listings []struct {
		ID             int            `json:"id"`
		ChannelType    string         `json:"channel_type"`
		ListingID      string         `json:"listing_id"`
		Availabilities []Availability `json:"availabilities,omitempty"`
	} `json:"listings"`
}

AvailabilitiesResponse represents the response from listing availabilities

type Availability

type Availability struct {
	Date      string `json:"date"`
	Available bool   `json:"available"`
}

Availability represents property availability

type Channel

type Channel struct {
	ChannelType string `json:"channel_type"`
	ListingID   string `json:"listing_id"`
}

Channel represents a booking channel for a property

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the Hostex API client

func NewClient

func NewClient(config Config) (*Client, error)

NewClient creates a new Hostex API client

func (*Client) CancelReservation

func (c *Client) CancelReservation(ctx context.Context, reservationCode string) error

CancelReservation cancels a direct booking reservation

func (*Client) CreateReservation

func (c *Client) CreateReservation(ctx context.Context, data CreateReservationData) (*CreateReservationResponse, error)

CreateReservation creates a new direct booking reservation

func (*Client) CreateReview

func (c *Client) CreateReview(ctx context.Context, reservationCode string, data CreateReviewData) error

CreateReview creates a review or reply for a reservation

func (*Client) CreateWebhook

func (c *Client) CreateWebhook(ctx context.Context, webhookURL string) (*CreateWebhookResponse, error)

CreateWebhook creates a new webhook

func (*Client) DeleteWebhook

func (c *Client) DeleteWebhook(ctx context.Context, webhookID int) error

DeleteWebhook deletes a webhook by ID

func (*Client) GetConversation

func (c *Client) GetConversation(ctx context.Context, conversationID string) (*ConversationDetails, error)

GetConversation retrieves detailed information about a specific conversation

func (*Client) GetCustomFields

func (c *Client) GetCustomFields(ctx context.Context, stayCode string) (*CustomFieldsResponse, error)

GetCustomFields retrieves custom fields for a stay

func (*Client) GetListingCalendar

func (c *Client) GetListingCalendar(ctx context.Context, data GetListingCalendarData) (*ListingCalendarResponse, error)

GetListingCalendar retrieves calendar information for multiple listings

func (*Client) ListAvailabilities

func (c *Client) ListAvailabilities(ctx context.Context, params ListAvailabilitiesParams) (*AvailabilitiesResponse, error)

ListAvailabilities retrieves availability information for properties

func (*Client) ListConversations

func (c *Client) ListConversations(ctx context.Context, params *ListConversationsParams) (*ConversationsResponse, error)

ListConversations retrieves a list of conversations

func (*Client) ListCustomChannels

func (c *Client) ListCustomChannels(ctx context.Context) (*CustomChannelsResponse, error)

ListCustomChannels retrieves custom channels from Custom Options Page

func (*Client) ListIncomeMethods

func (c *Client) ListIncomeMethods(ctx context.Context) (*IncomeMethodsResponse, error)

ListIncomeMethods retrieves income methods from Custom Options Page

func (*Client) ListProperties

func (c *Client) ListProperties(ctx context.Context, params *ListPropertiesParams) (*PropertiesResponse, error)

ListProperties retrieves a list of properties

func (*Client) ListReservations

func (c *Client) ListReservations(ctx context.Context, params *ListReservationsParams) (*ReservationsResponse, error)

ListReservations retrieves a list of reservations

func (*Client) ListReviews

func (c *Client) ListReviews(ctx context.Context, params *ListReviewsParams) (*ReviewsResponse, error)

ListReviews retrieves a list of reviews

func (*Client) ListRoomTypes

func (c *Client) ListRoomTypes(ctx context.Context, params *ListRoomTypesParams) (*RoomTypesResponse, error)

ListRoomTypes retrieves a list of room types

func (*Client) ListWebhooks

func (c *Client) ListWebhooks(ctx context.Context) (*WebhooksResponse, error)

ListWebhooks retrieves a list of configured webhooks

func (*Client) SendMessage

func (c *Client) SendMessage(ctx context.Context, conversationID string, data SendMessageData) error

SendMessage sends a message to a conversation

func (*Client) UpdateAvailabilities

func (c *Client) UpdateAvailabilities(ctx context.Context, data UpdateAvailabilitiesData) error

UpdateAvailabilities updates property availability status

func (*Client) UpdateCustomFields

func (c *Client) UpdateCustomFields(ctx context.Context, stayCode string, customFields map[string]interface{}) error

UpdateCustomFields updates custom fields for a stay

func (*Client) UpdateListingInventories

func (c *Client) UpdateListingInventories(ctx context.Context, data UpdateListingInventoriesData) error

UpdateListingInventories updates inventory levels for channel listings

func (*Client) UpdateListingPrices

func (c *Client) UpdateListingPrices(ctx context.Context, data UpdateListingPricesData) error

UpdateListingPrices updates listing prices for channel listings

func (*Client) UpdateListingRestrictions

func (c *Client) UpdateListingRestrictions(ctx context.Context, data UpdateListingRestrictionsData) error

UpdateListingRestrictions updates listing restrictions for channel listings

func (*Client) UpdateLockCode

func (c *Client) UpdateLockCode(ctx context.Context, stayCode, lockCode string) error

UpdateLockCode updates the lock code for a stay

type Config

type Config struct {
	// AccessToken is your Hostex API access token (required)
	AccessToken string

	// BaseURL is the Hostex API base URL (optional, defaults to DefaultBaseURL)
	BaseURL string

	// HTTPClient is a custom HTTP client (optional)
	HTTPClient *http.Client

	// Timeout is the HTTP request timeout (optional, defaults to DefaultTimeout)
	Timeout time.Duration
}

Config holds client configuration options

type Conversation

type Conversation struct {
	ID            string    `json:"id"`
	ChannelType   string    `json:"channel_type"`
	Guest         Guest     `json:"guest"`
	PropertyID    int       `json:"property_id,omitempty"`
	PropertyTitle string    `json:"property_title,omitempty"`
	CheckInDate   string    `json:"check_in_date,omitempty"`
	CheckOutDate  string    `json:"check_out_date,omitempty"`
	LastMessageAt time.Time `json:"last_message_at,omitempty"`
	UnreadCount   int       `json:"unread_count,omitempty"`
}

Conversation represents a guest conversation

type ConversationDetails

type ConversationDetails struct {
	Guest       Guest     `json:"guest"`
	ChannelType string    `json:"channel_type"`
	Messages    []Message `json:"messages"`
}

ConversationDetails represents detailed conversation information

type ConversationsResponse

type ConversationsResponse struct {
	Conversations []Conversation `json:"conversations"`
	Total         int            `json:"total"`
}

ConversationsResponse represents the response from listing conversations

type CreateReservationData

type CreateReservationData struct {
	PropertyID       string `json:"property_id"`
	CustomChannelID  int    `json:"custom_channel_id"`
	CheckInDate      string `json:"check_in_date"`
	CheckOutDate     string `json:"check_out_date"`
	GuestName        string `json:"guest_name"`
	Currency         string `json:"currency"`
	RateAmount       int    `json:"rate_amount"`
	CommissionAmount int    `json:"commission_amount"`
	ReceivedAmount   int    `json:"received_amount"`
	IncomeMethodID   int    `json:"income_method_id"`
	NumberOfGuests   int    `json:"number_of_guests,omitempty"`
	Email            string `json:"email,omitempty"`
	Mobile           string `json:"mobile,omitempty"`
	Remarks          string `json:"remarks,omitempty"`
}

CreateReservationData contains data for creating a new reservation

type CreateReservationResponse

type CreateReservationResponse struct {
	Reservation Reservation `json:"reservation"`
}

CreateReservationResponse represents the response from creating a reservation

type CreateReviewData

type CreateReviewData struct {
	HostReviewScore   int    `json:"host_review_score,omitempty"`
	HostReviewContent string `json:"host_review_content,omitempty"`
	HostReplyContent  string `json:"host_reply_content,omitempty"`
}

CreateReviewData contains data for creating a review

type CreateWebhookResponse

type CreateWebhookResponse struct {
	Webhook Webhook `json:"webhook"`
}

CreateWebhookResponse represents the response from creating a webhook

type CustomChannel

type CustomChannel struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

CustomChannel represents a custom booking channel

type CustomChannelsResponse

type CustomChannelsResponse struct {
	CustomChannels []CustomChannel `json:"custom_channels"`
}

CustomChannelsResponse represents the response from listing custom channels

type CustomFieldsResponse

type CustomFieldsResponse struct {
	CustomFields map[string]interface{} `json:"custom_fields"`
}

CustomFieldsResponse represents the response from getting custom fields

type GetListingCalendarData

type GetListingCalendarData struct {
	StartDate string    `json:"start_date"`
	EndDate   string    `json:"end_date"`
	Listings  []Listing `json:"listings"`
}

ListingCalendarData contains data for getting listing calendar

type Guest

type Guest struct {
	Name   string `json:"name,omitempty"`
	Email  string `json:"email,omitempty"`
	Mobile string `json:"mobile,omitempty"`
}

Guest represents a guest

type IncomeMethod

type IncomeMethod struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

IncomeMethod represents a payment method

type IncomeMethodsResponse

type IncomeMethodsResponse struct {
	IncomeMethods []IncomeMethod `json:"income_methods"`
}

IncomeMethodsResponse represents the response from listing income methods

type Inventory

type Inventory struct {
	Date      string `json:"date"`
	Inventory int    `json:"inventory"`
}

Inventory represents inventory for a specific date

type ListAvailabilitiesParams

type ListAvailabilitiesParams struct {
	PropertyIDs string // Comma-separated property IDs
	StartDate   string // YYYY-MM-DD
	EndDate     string // YYYY-MM-DD
}

ListAvailabilitiesParams contains required parameters for listing availabilities

type ListConversationsParams

type ListConversationsParams struct {
	Offset int
	Limit  int
}

ListConversationsParams contains optional parameters for listing conversations

type ListPropertiesParams

type ListPropertiesParams struct {
	Offset int
	Limit  int
	ID     int
}

ListPropertiesParams contains optional parameters for listing properties

type ListReservationsParams

type ListReservationsParams struct {
	ReservationCode   string
	PropertyID        int
	Status            string
	StartCheckInDate  string
	EndCheckInDate    string
	StartCheckOutDate string
	EndCheckOutDate   string
	OrderBy           string
	Offset            int
	Limit             int
}

ListReservationsParams contains optional parameters for listing reservations

type ListReviewsParams

type ListReviewsParams struct {
	ReservationCode   string
	PropertyID        int
	ReviewStatus      string
	StartCheckOutDate string
	EndCheckOutDate   string
	Offset            int
	Limit             int
}

ListReviewsParams contains optional parameters for listing reviews

type ListRoomTypesParams

type ListRoomTypesParams struct {
	Offset int
	Limit  int
}

ListRoomTypesParams contains optional parameters for listing room types

type Listing

type Listing struct {
	ChannelType string `json:"channel_type"`
	ListingID   string `json:"listing_id"`
}

Listing represents a listing on a channel

type ListingCalendarResponse

type ListingCalendarResponse struct {
	Listings []struct {
		ChannelType string `json:"channel_type"`
		ListingID   string `json:"listing_id"`
		Calendar    []struct {
			Date              string `json:"date"`
			Price             int    `json:"price,omitempty"`
			Inventory         int    `json:"inventory,omitempty"`
			Available         bool   `json:"available,omitempty"`
			MinStay           int    `json:"min_stay,omitempty"`
			MaxStay           int    `json:"max_stay,omitempty"`
			ClosedToArrival   bool   `json:"closed_to_arrival,omitempty"`
			ClosedToDeparture bool   `json:"closed_to_departure,omitempty"`
		} `json:"calendar"`
	} `json:"listings"`
}

ListingCalendarResponse represents the response from getting listing calendar

type Message

type Message struct {
	ID         string    `json:"id"`
	SenderRole string    `json:"sender_role"` // "host" or "guest"
	Content    string    `json:"content"`
	CreatedAt  time.Time `json:"created_at"`
	ImageURL   string    `json:"image_url,omitempty"`
}

Message represents a conversation message

type Price

type Price struct {
	Date  string `json:"date"`
	Price int    `json:"price"`
}

Price represents a price for a specific date

type PropertiesResponse

type PropertiesResponse struct {
	Properties []Property `json:"properties"`
	Total      int        `json:"total"`
}

PropertiesResponse represents the response from listing properties

type Property

type Property struct {
	ID        int       `json:"id"`
	Title     string    `json:"title"`
	Address   string    `json:"address,omitempty"`
	Longitude float64   `json:"longitude,omitempty"`
	Latitude  float64   `json:"latitude,omitempty"`
	Channels  []Channel `json:"channels,omitempty"`
}

Property represents a Hostex property

type ReplyData

type ReplyData struct {
	Content   string    `json:"content,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
}

ReplyData contains reply details

type Reservation

type Reservation struct {
	ReservationCode  string     `json:"reservation_code"`
	StayCode         string     `json:"stay_code"`
	ChannelID        string     `json:"channel_id,omitempty"`
	PropertyID       int        `json:"property_id"`
	ChannelType      string     `json:"channel_type"`
	ListingID        string     `json:"listing_id,omitempty"`
	CheckInDate      string     `json:"check_in_date"`
	CheckOutDate     string     `json:"check_out_date"`
	NumberOfGuests   int        `json:"number_of_guests,omitempty"`
	NumberOfAdults   int        `json:"number_of_adults,omitempty"`
	NumberOfChildren int        `json:"number_of_children,omitempty"`
	NumberOfInfants  int        `json:"number_of_infants,omitempty"`
	NumberOfPets     int        `json:"number_of_pets,omitempty"`
	Status           string     `json:"status"`
	GuestName        string     `json:"guest_name,omitempty"`
	GuestPhone       string     `json:"guest_phone,omitempty"`
	GuestEmail       string     `json:"guest_email,omitempty"`
	CancelledAt      *time.Time `json:"cancelled_at,omitempty"`
	BookedAt         *time.Time `json:"booked_at,omitempty"`
	CreatedAt        *time.Time `json:"created_at,omitempty"`
	Creator          string     `json:"creator,omitempty"`
	ConversationID   string     `json:"conversation_id,omitempty"`
	Tags             []string   `json:"tags,omitempty"`
	CustomFields     any        `json:"custom_fields,omitempty"`
	InReservationBox bool       `json:"in_reservation_box,omitempty"`
}

Reservation represents a booking reservation

type ReservationsResponse

type ReservationsResponse struct {
	Reservations []Reservation `json:"reservations"`
	Total        int           `json:"total"`
}

ReservationsResponse represents the response from listing reservations

type Restriction

type Restriction struct {
	Date              string `json:"date"`
	MinStay           int    `json:"min_stay,omitempty"`
	MaxStay           int    `json:"max_stay,omitempty"`
	ClosedToArrival   bool   `json:"closed_to_arrival,omitempty"`
	ClosedToDeparture bool   `json:"closed_to_departure,omitempty"`
}

Restriction represents restrictions for a specific date

type Review

type Review struct {
	ReservationCode string      `json:"reservation_code"`
	PropertyID      int         `json:"property_id"`
	ChannelType     string      `json:"channel_type"`
	CheckOutDate    string      `json:"check_out_date"`
	ReviewStatus    string      `json:"review_status"`
	HostReview      *ReviewData `json:"host_review,omitempty"`
	GuestReview     *ReviewData `json:"guest_review,omitempty"`
	HostReply       *ReplyData  `json:"host_reply,omitempty"`
}

Review represents a guest or host review

type ReviewData

type ReviewData struct {
	Score     int       `json:"score,omitempty"`
	Content   string    `json:"content,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
}

ReviewData contains review details

type ReviewsResponse

type ReviewsResponse struct {
	Reviews []Review `json:"reviews"`
	Total   int      `json:"total"`
}

ReviewsResponse represents the response from listing reviews

type RoomType

type RoomType struct {
	ID         int        `json:"id"`
	Title      string     `json:"title"`
	Properties []Property `json:"properties,omitempty"`
	Channels   []Channel  `json:"channels,omitempty"`
}

RoomType represents a room type in Hostex

type RoomTypesResponse

type RoomTypesResponse struct {
	RoomTypes []RoomType `json:"room_types"`
	Total     int        `json:"total"`
}

RoomTypesResponse represents the response from listing room types

type SendMessageData

type SendMessageData struct {
	Message    string `json:"message,omitempty"`
	JpegBase64 string `json:"jpeg_base64,omitempty"`
}

SendMessageData contains data for sending a message

type UpdateAvailabilitiesData

type UpdateAvailabilitiesData struct {
	PropertyIDs []int    `json:"property_ids"`
	StartDate   string   `json:"start_date,omitempty"`
	EndDate     string   `json:"end_date,omitempty"`
	Dates       []string `json:"dates,omitempty"`
	Available   bool     `json:"available"`
}

UpdateAvailabilitiesData contains data for updating availability

type UpdateListingInventoriesData

type UpdateListingInventoriesData struct {
	ChannelType string      `json:"channel_type"`
	ListingID   string      `json:"listing_id"`
	Inventories []Inventory `json:"inventories"`
}

UpdateListingInventoriesData contains data for updating listing inventories

type UpdateListingPricesData

type UpdateListingPricesData struct {
	ChannelType string  `json:"channel_type"`
	ListingID   string  `json:"listing_id"`
	Prices      []Price `json:"prices"`
}

UpdateListingPricesData contains data for updating listing prices

type UpdateListingRestrictionsData

type UpdateListingRestrictionsData struct {
	ChannelType  string        `json:"channel_type"`
	ListingID    string        `json:"listing_id"`
	Restrictions []Restriction `json:"restrictions"`
}

UpdateListingRestrictionsData contains data for updating listing restrictions

type Webhook

type Webhook struct {
	ID         int       `json:"id"`
	URL        string    `json:"url"`
	Manageable bool      `json:"manageable"`
	CreatedAt  time.Time `json:"created_at"`
}

Webhook represents a webhook configuration

type WebhooksResponse

type WebhooksResponse struct {
	Webhooks []Webhook `json:"webhooks"`
}

WebhooksResponse represents the response from listing webhooks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL