Skip to content

Commit de128b9

Browse files
authored
TNR-2190: Fix validation issue with adding reservation guests (#34)
* TNR-2190: Fix validation issue with adding reservation guests Also sneak in `initial_payment_amount` because I already had it there. * Update vacasa/connect/connect.py Co-Authored-By: bijan-vacasa <33635269+bijan-vacasa@users.noreply.github.com>
1 parent 6d2a4b2 commit de128b9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

vacasa/connect/connect.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ def create_reservation(self,
664664
trip_protection: Optional[bool] = None,
665665
source: Optional[str] = None,
666666
discount_id: Optional[int] = None,
667+
initial_payment_amount: [float] = None
667668
) -> dict:
668669
""" Reserve a given unit
669670
@@ -695,6 +696,8 @@ def create_reservation(self,
695696
cvv: Card verification value on credit card
696697
source: A Vacasa-issued code identifying the source of this request
697698
discount_id: Must match value from `quote_id`
699+
initial_payment_amount: if included, only process this amount initially, the remaining balance will be
700+
charged according to payment plan logic (i.e. 30 days before check-in)
698701
699702
Returns: dict
700703
@@ -736,6 +739,9 @@ def create_reservation(self,
736739
if discount_id:
737740
payload['discount_id'] = discount_id
738741

742+
if initial_payment_amount:
743+
payload['initial_payment_amount'] = initial_payment_amount
744+
739745
return self._post(url, json={'data': {'attributes': payload}}, headers=headers).json()
740746

741747
def create_cancelled_reservation(self,
@@ -890,7 +896,8 @@ def add_reservation_guests(self,
890896
'email': email
891897
}
892898

893-
return self._post(url, json={'data': {'attributes': payload}}, headers=headers).json()
899+
return self._post(url, json={'data': {'attributes': payload,
900+
'type': 'reservation-guest'}}, headers=headers).json()
894901

895902

896903
def _handle_http_exceptions(response):

0 commit comments

Comments
 (0)