Bỏ qua để đến nội dung

Add Payment

API cho đối tácAdd-on
POST
/properties/{tenant_id}/bookings/{booking_id}/payments

Add one or more payments to an existing booking without changing its status. Use this endpoint to record payments for bookings that are already confirmed or in progress.

Scope Required: bookings:write

URL Parameters:

  • booking_id (required): The booking code to add payments (must exist and not be cancelled)

Body Parameters:

  • payments (required): Array of payment records, at least one payment is required
  • payments[].amount (required): Payment amount (numeric, min: 0)
  • payments[].method (optional): Payment method (one of system payment method (cash, bank_transfer, debt, atm_transfer, credit_card, apple_pay, pos, wechat_pay..v.v))
  • payments[].paid_at (optional): Payment date (format: Y-m-d H:i:s)
  • payments[].notes (optional): Payment notes (max: 500 characters)

Important Notes:

  • At least one payment is required
  • Booking status will NOT be changed
  • Cancelled bookings cannot receive payments
  • Payments are added to existing payments (not replaced)
  • If booking_id refers to a booking that has since been merged into a group booking (a “đơn đoàn” — status Merged), the payment is redirected to its master booking instead, because payments always live on the master after a merge. The data in the response then describes the MASTER booking, whose id may differ from the booking_id you sent — this is intentional (see BookingService::addPayment()), not a bug.
tenant_id
required
string
booking_id
required
string
AddPaymentRequest
object
booking_id
required
string
payments
required
Array<object>
>= 1 items
object
amount
required
number
method
string | null
paid_at
string | null format: date-time
Example
2025-11-19 16:54:00
notes
string | null
<= 500 characters
object

Validation error

object
message
required

Errors overview.

string
errors
required

A detailed description of each field that failed validation.

object
key
additional properties
Array<string>
Bài này có giúp được bạn không?