ma

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 4 Imported by: 0

README

go-myallocator (Myallocator API for PMS partners.)

GoDoc Run Tests codecov Go Report Card

Golang SDK for OTA's to easily integrate with the MyAllocator OTA BuildToUs API. See documentation for myallocator's Build2Us API (OTA Facing)

Feature

Support the following API.

  • ARIUpdate
  • AssociateUserToPMS
  • VendorSet
  • RoomAvailabilityList
  • ChannelList
  • PropertyChannelList
  • BookingList

Documentation

Index

Constants

View Source
const (
	// ARIUpdateURL for an allocation sets the number of rooms or beds API
	ARIUpdateURL = "https://api.myallocator.com/pms/v201804/json/ARIUpdate"
	// AssociateUserToPMSURL for Creates a permanent link between an existing myallocator user and a PMS Vendor
	AssociateUserToPMSURL = "https://api.myallocator.com/pms/v201804/json/AssociateUserToPMS"
	// VendorSetURL for if you're using booking callbacks to set the callback URL and password.
	VendorSetURL = "https://api.myallocator.com/pms/v201804/json/VendorSet"
	// RoomAvailabilityListURL is RoomAvailabilityList API URL
	RoomAvailabilityListURL = "https://api.myallocator.com/pms/v201804/json/RoomAvailabilityList"
	// ChannelListURL is ChannelList API URL
	ChannelListURL = "https://api.myallocator.com/pms/v201804/json/ChannelList"
	// PropertyChannelListURL is PropertyChannelList API URL
	PropertyChannelListURL = "https://api.myallocator.com/pms/v201908/json/PropertyChannelList"
	// BookingListURL is BookingList API URL
	BookingListURL = "https://api.myallocator.com/pms/v201804/json/BookingList"
	// BookingCancelURL allows you to cancel a booking both in myallocator and the channel.
	BookingCancelURL = "https://api.myallocator.com/pms/v201804/json/BookingCancel"
)

Variables

This section is empty.

Functions

func SendRequest

func SendRequest(url string, body interface{}, res interface{}, debug bool) error

SendRequest for myallocator api

Types

type ARIRequest

type ARIRequest struct {
	AuthUserToken      string            `json:"Auth/UserToken"`
	AuthPropertyID     string            `json:"Auth/PropertyId"`
	AuthVendorID       string            `json:"Auth/VendorId"`
	AuthVendorPassword string            `json:"Auth/VendorPassword"`
	Channels           []string          `json:"Channels"`
	Allocations        []Allocation      `json:"Allocations"`
	Options            ARIRequestOptions `json:"Options"`
}

ARIRequest ARIUpdate Rule https://myallocator.github.io/apidocs/#api-3_API_Methods-ARIUpdate

type ARIRequestOptions

type ARIRequestOptions struct {
	QueryForStatus     bool `json:"QueryForStatus"`
	IgnoreInvalidRooms bool `json:"IgnoreInvalidRooms"`
}

ARIRequestOptions .... If QueryForStatus is true then the ARIUpdateResponse will contain the additional parameter UpdateId, which is needed for ARIUpdateStatus. It is extremely likely that blocking updates will be phased out in favour of QueryForStatus so we highly recommend that you send only non-blocking ARIUpdate requests and poll myallocator using ARIUpdateStatus.

type ARIUpdateMessage

type ARIUpdateMessage struct {
	EndDate   string `json:"EndDate"`
	ID        int    `json:"id"`
	StartDate string `json:"StartDate"`
	User      string `json:"user"`
	EndDay    int    `json:"end_day"`
	End       int    `json:"end"`
	Type      string `json:"type"`
	Units     string `json:"Units"`
	MaxStay   string `json:"MaxStay"`
	StartDay  int    `json:"start_day"`
	Msg       string `json:"msg"`
	Pid       int    `json:"pid"`
	Source    string `json:"source"`
	Price     string `json:"Price"`
	Start     int    `json:"start"`
	RoomID    string `json:"RoomId"`
	MinStay   string `json:"MinStay"`
}

ARIUpdateMessage for ARIUpdate Message struct

type ARIUpdateResponse

type ARIUpdateResponse struct {
	Errors   []ErrResponse      `json:"Errors"`
	Messages []ARIUpdateMessage `json:"Messages"`
	Success  bool               `json:"Success"`
	Channels struct{}           `json:"Channels"`
	UpdateID interface{}        `json:"UpdateId"`
	Options  struct {
		FIUA int `json:"FIUA"`
	} `json:"Options"`
}

ARIUpdateResponse ARI Update Response

type Allocation

type Allocation struct {
	RoomID    string `json:"RoomId"`
	StartDate string `json:"StartDate"`
	EndDate   string `json:"EndDate"`
	Units     string `json:"Units"`
	MinStay   string `json:"MinStay,omitempty"`
	MaxStay   string `json:"MaxStay,omitempty"`
	Price     string `json:"Price,omitempty"`
}

Allocation for ARIUpdateURL API

type AssociateUserToPMSRequest

type AssociateUserToPMSRequest struct {
	AuthUserID         string `json:"Auth/UserId"`
	AuthUserPassword   string `json:"Auth/UserPassword"`
	AuthVendorID       string `json:"Auth/VendorId"`
	AuthVendorPassword string `json:"Auth/VendorPassword"`
	PMSUserID          string `json:"PMSUserId,omitempty"`
}

AssociateUserToPMSRequest creates a permanent link between an existing myallocator user and a PMS Vendor. https://myallocator.github.io/apidocs/#api-3_API_Methods-AssociateUserToPMS

type AssociateUserToPMSResponse

type AssociateUserToPMSResponse struct {
	Success       bool   `json:"Success"`
	AuthUserToken string `json:"Auth/UserToken"`
}

AssociateUserToPMSResponse for AssociateUserToPMS response

type BookingCancelReq

type BookingCancelReq struct {
	AuthUserToken      string `json:"Auth/UserToken"`
	AuthVendorID       string `json:"Auth/VendorId"`
	AuthVendorPassword string `json:"Auth/VendorPassword"`
	AuthPropertyID     string `json:"Auth/PropertyId"`
	MyAllocatorID      string `json:"MyAllocatorId"`
	CancellationReason string `json:"CancellationReason"`
}

BookingCancelReq allows you to cancel a booking both in myallocator and the channel. Only very few channels support this, check the 'api_cancellation' flag on the ChannelList call to see which channels support this.

type BookingCancelResp

type BookingCancelResp struct {
	StartDate string `json:"start_date"`
	Success   bool   `json:"Success"`
	QueryType string `json:"query_type"`
	Bookings  []struct {
		MyallocatorID           string `json:"MyallocatorId"`
		OrderSource             string `json:"OrderSource"`
		MyallocatorCreationDate string `json:"MyallocatorCreationDate"`
		Version                 int    `json:"Version"`
		IsModification          bool   `json:"IsModification"`
		MyallocatorCreationTime string `json:"MyallocatorCreationTime"`
		TotalCurrency           string `json:"TotalCurrency"`
		OrderTime               string `json:"OrderTime"`
		Channel                 string `json:"Channel"`
		IsCancellation          bool   `json:"IsCancellation"`
		Customers               []struct {
			CustomerIP          string `json:"CustomerIP"`
			CustomerNote        string `json:"CustomerNote"`
			CustomerLName       string `json:"CustomerLName"`
			CustomerPhone       string `json:"CustomerPhone"`
			CustomerNationality string `json:"CustomerNationality"`
			CustomerFName       string `json:"CustomerFName"`
			CustomerEmail       string `json:"CustomerEmail"`
		} `json:"Customers"`
		Rooms []struct {
			Units                  string        `json:"Units"`
			EndDate                string        `json:"EndDate"`
			RoomTypeIds            []int         `json:"RoomTypeIds"`
			MyallocatorRateplanIds []interface{} `json:"MyallocatorRateplanIds"`
			RateID                 string        `json:"RateId"`
			StartDate              string        `json:"StartDate"`
			Price                  int           `json:"Price"`
			RateDesc               string        `json:"RateDesc"`
			ChannelRoomType        string        `json:"ChannelRoomType"`
			Currency               string        `json:"Currency"`
			DayRates               []struct {
				Date        string      `json:"Date"`
				Currency    string      `json:"Currency"`
				Rate        int         `json:"Rate"`
				Description interface{} `json:"Description"`
			} `json:"DayRates"`
		} `json:"Rooms"`
		MarkedAsRead                bool   `json:"MarkedAsRead"`
		MyallocatorModificationDate string `json:"MyallocatorModificationDate"`
		OrderDate                   string `json:"OrderDate"`
		CancellationReason          string `json:"CancellationReason"`
		StartDate                   string `json:"StartDate"`
		Acknowledged                bool   `json:"Acknowledged"`
		TotalPrice                  string `json:"TotalPrice"`
		EndDate                     string `json:"EndDate"`
		PropertyID                  int    `json:"PropertyId"`
		MyallocatorModificationTime string `json:"MyallocatorModificationTime"`
		OrderID                     string `json:"OrderId"`
	} `json:"Bookings"`
	EndDate string `json:"end_date"`
}

BookingCancelResp for booking cacnel response.

type BookingListReq

type BookingListReq struct {
	AuthUserToken         string `json:"Auth/UserToken"`
	AuthVendorID          string `json:"Auth/VendorId"`
	AuthVendorPassword    string `json:"Auth/VendorPassword"`
	AuthPropertyID        string `json:"Auth/PropertyId"`
	ModificationStartDate string `json:"ModificationStartDate"`
	ModificationEndDate   string `json:"ModificationEndDate"`
}

BookingListReq allows you to query for bookings made to a specific property by booking date, modification date or arrival date. https://myallocator.github.io/apidocs/#api-3_API_Methods-BookingList

type BookingListRes

type BookingListRes struct {
	QueryType string `json:"query_type"`
	EndDate   string `json:"end_date"`
	Success   bool   `json:"Success"`
	Bookings  []struct {
		TotalCurrency string `json:"TotalCurrency"`
		OrderID       string `json:"OrderId"`
		Rooms         []struct {
			RoomTypeIds []int `json:"RoomTypeIds"`
			Adults      int   `json:"Adults"`
			DayRates    []struct {
				RateID      string `json:"RateId"`
				Description string `json:"Description"`
				Date        string `json:"Date"`
				Rate        string `json:"Rate"`
			} `json:"DayRates"`
			RateID                 string        `json:"RateId"`
			Policy                 string        `json:"Policy"`
			RoomDesc               string        `json:"RoomDesc"`
			ChannelRoomType        string        `json:"ChannelRoomType"`
			RateDesc               string        `json:"RateDesc"`
			MyallocatorRateplanIds []interface{} `json:"MyallocatorRateplanIds"`
			StartDate              string        `json:"StartDate"`
			Occupancy              int           `json:"Occupancy"`
			EndDate                string        `json:"EndDate"`
			Children               int           `json:"Children"`
			Units                  string        `json:"Units"`
			Breakfast              bool          `json:"Breakfast"`
		} `json:"Rooms"`
		PropertyID                  int    `json:"PropertyId"`
		StartDate                   string `json:"StartDate"`
		EndDate                     string `json:"EndDate"`
		MyallocatorCreationDate     string `json:"MyallocatorCreationDate"`
		PaymentCollect              string `json:"PaymentCollect,omitempty"`
		IsModification              bool   `json:"IsModification"`
		MarkedAsRead                bool   `json:"MarkedAsRead"`
		MyallocatorModificationTime string `json:"MyallocatorModificationTime"`
		OrderDate                   string `json:"OrderDate"`
		OrderTime                   string `json:"OrderTime"`
		IsCancellation              bool   `json:"IsCancellation"`
		Acknowledged                bool   `json:"Acknowledged"`
		Version                     int    `json:"Version"`
		Channel                     string `json:"Channel"`
		MyallocatorCreationTime     string `json:"MyallocatorCreationTime"`
		MyallocatorID               string `json:"MyallocatorId"`
		MyallocatorModificationDate string `json:"MyallocatorModificationDate"`
		TotalPrice                  string `json:"TotalPrice"`
		Customers                   []struct {
			CustomerLName       string `json:"CustomerLName"`
			CustomerPhoneMobile string `json:"CustomerPhoneMobile"`
			CustomerNote        string `json:"CustomerNote"`
			CustomerArrivalTime string `json:"CustomerArrivalTime"`
			CustomerEmail       string `json:"CustomerEmail"`
			CustomerFName       string `json:"CustomerFName"`
		} `json:"Customers"`
		OrderSource string `json:"OrderSource,omitempty"`
	} `json:"Bookings"`
	StartDate string `json:"start_date"`
}

BookingListRes for BookingList response

type Channel

type Channel struct {
	Status   string `json:"status"`
	Currency string `json:"currency"`
}

Channel struct

type ChannelListRes

type ChannelListRes struct {
	Success  bool `json:"Success"`
	Channels struct {
		Koh struct {
			IsBeta          string `json:"isBeta"`
			IsCalendarBased string `json:"isCalendarBased"`
			SignupLink      string `json:"signupLink"`
			IsLockedLogin   string `json:"isLockedLogin"`
			IsLive          string `json:"isLive"`
			Name            string `json:"name"`
			RoomInput       []struct {
				Type   string `json:"type"`
				Rs     int    `json:"rs"`
				Name   string `json:"name"`
				Length int    `json:"length"`
			} `json:"RoomInput"`
			PropertyInput []struct {
				Label  string `json:"label"`
				Name   string `json:"name"`
				Stored int    `json:"stored"`
			} `json:"PropertyInput"`
			APICancellation string `json:"api_cancellation"`
			Hidden          int    `json:"hidden"`
		} `json:"koh"`
	} `json:"Channels"`
}

ChannelListRes for all channel struct

type ErrResponse

type ErrResponse struct {
	ErrorTicket string `json:"ErrorTicket"`
	ErrorMsg    string `json:"ErrorMsg"`
	ErrorID     int    `json:"ErrorId"`
}

ErrResponse error format

{
  "Errors": [
      {
          "ErrorTicket": "D13BAC04-1234-5678-804B-F5140B37646E",
          "ErrorMsg": "No such booking id",
          "ErrorId": "30"
      }
  ]
}

type MyAllocator

type MyAllocator struct {
	AuthVendorID       string `json:"Auth/VendorId"`
	AuthVendorPassword string `json:"Auth/VendorPassword"`
	Debug              bool
}

MyAllocator struct

func New

func New(vendorID, vendorPassword string) (*MyAllocator, error)

New MyAllocator object

func (*MyAllocator) ARIUpdate

func (m *MyAllocator) ARIUpdate(req *ARIRequest) (*ARIUpdateResponse, error)

ARIUpdate for an allocation sets the number of rooms or beds

func (*MyAllocator) BookingCancel

func (m *MyAllocator) BookingCancel(req *BookingCancelReq) (*BookingCancelResp, error)

BookingCancel allows you to cancel a booking both in myallocator and the channel. Only very few channels support this.

func (*MyAllocator) BookingList

func (m *MyAllocator) BookingList(req *BookingListReq) (*BookingListRes, error)

BookingList query for bookings made to a specific property by booking date, modification date or arrival date.

func (*MyAllocator) ChannelList

func (m *MyAllocator) ChannelList() (*ChannelListRes, error)

ChannelList dumps information about all known channels, their status, and supported fields. https://myallocator.github.io/apidocs/#api-3_API_Methods-ChannelList

func (*MyAllocator) PropertyChannelList

func (m *MyAllocator) PropertyChannelList(req *PropertyChannelListReq) (*PropertyChannelListRes, error)

PropertyChannelList Lists the channel details associated with a property. Formerly (v1) GetProperties

func (*MyAllocator) RoomAvailabilityList

func (m *MyAllocator) RoomAvailabilityList(req *RoomAvailabilityListReq) (*RoomAvailabilityListRes, error)

RoomAvailabilityList can be used to query for all data that we hold for a specific property and date range. The date range can only be 31 days as the maximum. You can query multiple times if you need a longer date range.

func (*MyAllocator) SetDebug

func (m *MyAllocator) SetDebug(enable bool) *MyAllocator

SetDebug to set debug mode

func (*MyAllocator) UpdateUserToken

UpdateUserToken get user token from UpdateUserToken API

func (*MyAllocator) UpdateVendor

func (m *MyAllocator) UpdateVendor(id, password string) *MyAllocator

UpdateVendor for update vendor user id and password

func (*MyAllocator) VendorSet

func (m *MyAllocator) VendorSet(req *VendorSetRequest) (*VendorSetResponse, error)

VendorSet Use this call if you're using booking callbacks to set the callback URL and password.

type PropertyChannelListReq

type PropertyChannelListReq struct {
	AuthUserToken      string `json:"Auth/UserToken"`
	AuthPropertyID     string `json:"Auth/PropertyId"`
	AuthVendorID       string `json:"Auth/VendorId"`
	AuthVendorPassword string `json:"Auth/VendorPassword"`
}

PropertyChannelListReq Lists the channel details associated with a property. Formerly (v1) GetProperties https://myallocator.github.io/apidocs/#api-3_API_Methods-PropertyChannelList

type PropertyChannelListRes

type PropertyChannelListRes struct {
	Properties []struct {
		PropertyID int `json:"PropertyId"`
		Channels   struct {
			Koh    Channel `json:"koh"`
			Asyo   Channel `json:"asyo"`
			Vjo    Channel `json:"vjo"`
			Bb     Channel `json:"bb"`
			Mal    Channel `json:"mal"`
			Outp   Channel `json:"outp"`
			Trav   Channel `json:"trav"`
			Mcs    Channel `json:"mcs"`
			Ago    Channel `json:"ago"`
			Hcu2   Channel `json:"hcu2"`
			Buen   Channel `json:"buen"`
			Myb    Channel `json:"myb"`
			Bkb    Channel `json:"bkb"`
			Ptch   Channel `json:"ptch"`
			Bp     Channel `json:"bp"`
			Lmin   Channel `json:"lmin"`
			G2I    Channel `json:"g2i"`
			Htrv   Channel `json:"htrv"`
			Clt    Channel `json:"clt"`
			Han    Channel `json:"han"`
			Yoho   Channel `json:"yoho"`
			Hde    Channel `json:"hde"`
			Wanu   Channel `json:"wanu"`
			Hd     Channel `json:"hd"`
			Orb    Channel `json:"orb"`
			Rrep   Channel `json:"rrep"`
			Loc    Channel `json:"loc"`
			Air    Channel `json:"air"`
			Deco   Channel `json:"deco"`
			Btob   Channel `json:"btob"`
			Enz    Channel `json:"enz"`
			Tpvl   Channel `json:"tpvl"`
			Hbe    Channel `json:"hbe"`
			Saas   Channel `json:"saas"`
			Liko   Channel `json:"liko"`
			Fk     Channel `json:"fk"`
			Hhb    Channel `json:"hhb"`
			Buun   Channel `json:"buun"`
			Ost    Channel `json:"ost"`
			Hc     Channel `json:"hc"`
			Gom    Channel `json:"gom"`
			Vhh    Channel `json:"vhh"`
			Prsc   Channel `json:"prsc"`
			Eb     Channel `json:"eb"`
			NineFl Channel `json:"9fl"`
			Mrbb   Channel `json:"mrbb"`
			Pool   Channel `json:"pool"`
			Bole   Channel `json:"bole"`
			Whoo   Channel `json:"whoo"`
			Eget   Channel `json:"eget"`
			Hotu   Channel `json:"hotu"`
			Inst   Channel `json:"inst"`
			Hs     Channel `json:"hs"`
			Grup   Channel `json:"grup"`
			Xmlt   Channel `json:"xmlt"`
			Vaca   Channel `json:"vaca"`
			Net    Channel `json:"net"`
			Tmd    Channel `json:"tmd"`
			Loop   Channel `json:"loop"`
			Bon    Channel `json:"bon"`
			Hoga   Channel `json:"hoga"`
			Ct     Channel `json:"ct"`
			Kch    Channel `json:"kch"`
			Art    Channel `json:"art"`
			Tlok   Channel `json:"tlok"`
			Gr     Channel `json:"gr"`
			Trpz   Channel `json:"trpz"`
			Hb2    Channel `json:"hb2"`
			Eba    Channel `json:"eba"`
			Hort   Channel `json:"hort"`
			Rep    Channel `json:"rep"`
			Bnw    Channel `json:"bnw"`
			Vcay   Channel `json:"vcay"`
			Cwd    Channel `json:"cwd"`
			Hrs    Channel `json:"hrs"`
			Tri    Channel `json:"tri"`
			Apal   Channel `json:"apal"`
			Boo    Channel `json:"boo"`
			Snrg   Channel `json:"snrg"`
			Lako   Channel `json:"lako"`
			Toqt   Channel `json:"toqt"`
			Chot   Channel `json:"chot"`
			Pre    Channel `json:"pre"`
			Cozy   Channel `json:"cozy"`
			Advt   Channel `json:"advt"`
			Wim    Channel `json:"wim"`
			Adve   Channel `json:"adve"`
			Tob    Channel `json:"tob"`
			Ho     Channel `json:"ho"`
			Hopa   Channel `json:"hopa"`
			Flh    Channel `json:"flh"`
			Hipc   Channel `json:"hipc"`
			Hoca   Channel `json:"hoca"`
			Rtel   Channel `json:"rtel"`
			Mmt    Channel `json:"mmt"`
			Enbc   Channel `json:"enbc"`
			Lr     Channel `json:"lr"`
			Bnb    Channel `json:"bnb"`
			Rec    Channel `json:"rec"`
			H2H    Channel `json:"h2h"`
			Hand   Channel `json:"hand"`
			Hmi    Channel `json:"hmi"`
			Bnb2   Channel `json:"bnb2"`
			Sbkr   Channel `json:"sbkr"`
			Rfc    Channel `json:"rfc"`
			Pand   Channel `json:"pand"`
			Kqbe   Channel `json:"kqbe"`
			Bud    Channel `json:"bud"`
			Ini    Channel `json:"ini"`
			Adv    Channel `json:"adv"`
			Cs     Channel `json:"cs"`
			Ysh    Channel `json:"ysh"`
			Etb    Channel `json:"etb"`
			Exp    Channel `json:"exp"`
			Evry   Channel `json:"evry"`
			Wix    Channel `json:"wix"`
			Luna   Channel `json:"luna"`
			Rsrv   Channel `json:"rsrv"`
			Vrbo   Channel `json:"vrbo"`
			Bd     Channel `json:"bd"`
			Bh     Channel `json:"bh"`
			All    Channel `json:"all"`
			R2N    Channel `json:"r2n"`
			Hw     Channel `json:"hw"`
			Bal    Channel `json:"bal"`
			Bv     Channel `json:"bv"`
			Fam    Channel `json:"fam"`
			Hr     Channel `json:"hr"`
			Ote    Channel `json:"ote"`
			Tavr   Channel `json:"tavr"`
			Mega   Channel `json:"mega"`
			Bdrm   Channel `json:"bdrm"`
			Odi    Channel `json:"odi"`
			Iwb    Channel `json:"iwb"`
			Ddhm   Channel `json:"ddhm"`
			Ht     Channel `json:"ht"`
			Skd    Channel `json:"skd"`
			Hcu    Channel `json:"hcu"`
			Hola   Channel `json:"hola"`
			Sawa   Channel `json:"sawa"`
			Tom    Channel `json:"tom"`
			Esc    Channel `json:"esc"`
			Cb     Channel `json:"cb"`
			Ohma   Channel `json:"ohma"`
			Ya     Channel `json:"ya"`
			Sole   Channel `json:"sole"`
			Aveo   Channel `json:"aveo"`
			Coco   Channel `json:"coco"`
			Iper   Channel `json:"iper"`
			Bbit   Channel `json:"bbit"`
			Adsh   Channel `json:"adsh"`
			Ktel   Channel `json:"ktel"`
			Akt    Channel `json:"akt"`
			Lvur   Channel `json:"lvur"`
			Nom    Channel `json:"nom"`
			Hi     Channel `json:"hi"`
			Vive   Channel `json:"vive"`
			Lsbv   Channel `json:"lsbv"`
			Stya   Channel `json:"stya"`
			Wpk    Channel `json:"wpk"`
			Sur    Channel `json:"sur"`
			Zldv   Channel `json:"zldv"`
			Kni    Channel `json:"kni"`
			Gta    Channel `json:"gta"`
			Max    Channel `json:"max"`
			Goi    Channel `json:"goi"`
			Hb     Channel `json:"hb"`
			Ctr    Channel `json:"ctr"`
			Hom    Channel `json:"hom"`
			Bbnl   Channel `json:"bbnl"`
			Lota   Channel `json:"lota"`
			Lmg    Channel `json:"lmg"`
			Ta     Channel `json:"ta"`
			Bool   Channel `json:"bool"`
			Trab   Channel `json:"trab"`
			Ibc    Channel `json:"ibc"`
			Oa     Channel `json:"oa"`
			Hotq   Channel `json:"hotq"`
			Pzg    Channel `json:"pzg"`
			Hou    Channel `json:"hou"`
			Hw2    Channel `json:"hw2"`
		} `json:"Channels"`
	} `json:"Properties"`
	Success bool `json:"Success"`
}

PropertyChannelListRes for PropertyChannelList response missing some field

type RoomAvailabilityListReq

type RoomAvailabilityListReq struct {
	AuthVendorID       string `json:"Auth/VendorId"`
	AuthVendorPassword string `json:"Auth/VendorPassword"`
	AuthUserToken      string `json:"Auth/UserToken"`
	AuthPropertyID     string `json:"Auth/PropertyId"`
	StartDate          string `json:"StartDate"`
	EndDate            string `json:"EndDate"`
}

RoomAvailabilityListReq can be used to query for all data that we hold for a specific property and date range. https://myallocator.github.io/apidocs/#api-3_API_Methods-RoomAvailabilityList

type RoomAvailabilityListRes

type RoomAvailabilityListRes struct {
	Success bool `json:"Success"`
	Rooms   []struct {
		RatePlanID int  `json:"RatePlanId"`
		PropertyID int  `json:"PropertyId"`
		IsPrivate  bool `json:"isPrivate"`
		RoomID     int  `json:"RoomId"`
		Dates      []struct {
			Units              int    `json:"Units"`
			Date               string `json:"Date"`
			ClosedForDeparture int    `json:"ClosedForDeparture"`
			ClosedForArrival   int    `json:"ClosedForArrival"`
			Price              string `json:"Price"`
			MinStay            int    `json:"MinStay"`
			MaxStay            int    `json:"MaxStay"`
			Closed             int    `json:"Closed"`
		} `json:"Dates"`
		RoomName string `json:"RoomName"`
	} `json:"Rooms"`
}

RoomAvailabilityListRes for RoomAvailabilityList response

type VendorReq

type VendorReq struct {
	AuthVendorID       string `json:"Auth/VendorId"`
	AuthVendorPassword string `json:"Auth/VendorPassword"`
}

VendorReq just for vendor id and password

type VendorSetRequest

type VendorSetRequest struct {
	AuthVendorID          string `json:"Auth/VendorId"`
	AuthVendorPassword    string `json:"Auth/VendorPassword"`
	CallbackURL           string `json:"Callback/URL"`
	CallbackPassword      string `json:"Callback/Password"`
	CallbackNotifyBooking bool   `json:"Callback/NotifyBooking"`
}

VendorSetRequest Use this call if you're using booking callbacks to set the callback URL and password. See https://myallocator.github.io/apidocs/#api-3_API_Methods-VendorSet

type VendorSetResponse

type VendorSetResponse struct {
	Success               bool   `json:"Success"`
	CallbackPassword      string `json:"Callback/Password"`
	CallbackNotifyBooking bool   `json:"Callback/NotifyBooking"`
	CallbackURL           string `json:"Callback/URL"`
}

VendorSetResponse for vendor set response

Jump to

Keyboard shortcuts

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