# Add Payment To Booking

<mark style="color:green;">`POST`</mark> `[PlatformAddress]/api/1.0/venue?action=addPaymentToBooking`

Add a payment to a booking. This will also generate an invoice to apply the payment to.

#### Request Body

| Name      | Type    | Description                                                     |
| --------- | ------- | --------------------------------------------------------------- |
| venueId   | integer | The unique id of the venue to which the booking belongs         |
| bookingId | integer | The unique id of the booking to which the payment will be added |
| payment   | object  | The payment details to add to the booking                       |

{% tabs %}
{% tab title="200 " %}

```
{
  "Success": true,
  "invoiceId": 1736,
  "paymentId": 758
}
```

{% endtab %}
{% endtabs %}

### Example Request

`Add payment to booking`

```javascript
{
  "venueId": 2,
  "bookingId": 2,
  "payment": {
    "paidDate": "2015-01-22 00:00:00",
    "amountPaid": 100,
    "paymentMethod": 6,
    "receiptNum": 12345,
    "notes": "Note for payment"
  }
}
```

### Payment Details

| Property      | Description                                 | Type             |
| ------------- | ------------------------------------------- | ---------------- |
| paidDate      | The date & time of the payment              | Timestamp in UTC |
| amountPaid    | The payment amount                          | number           |
| paymentMethod | [The payment method](#payment-methods)      |                  |
| receiptNum    | A receipt number of the payment transaction | string           |
| notes         | Additional notes about the payment          | string           |

### Payment methods

| #  | Description         |
| -- | ------------------- |
| 0  | Unknown             |
| 1  | Credit Card         |
| 2  | BPay                |
| 3  | Direct Deposit      |
| 4  | PayPal              |
| 5  | Cheque              |
| 6  | Cash                |
| 7  | Custom Gateway      |
| 8  | Accounts Receivable |
| 9  | EFTPOS              |
| 10 | WriteOff            |
| 11 | Point of Sale       |
| 12 | Wire Transfer       |

### Returns

| Property  | Description                                                 |
| --------- | ----------------------------------------------------------- |
| success   | Whether or not the payment was added to the booking         |
| invoiceId | The unique id of the invoice to which the payment was added |
| paymentId | The unique identifier of the payment made                   |

### Throws

| Code                 | Description                     |
| -------------------- | ------------------------------- |
| Specific Code: 24136 | The payment details are invalid |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.ivvy.com/venues/getoraddbookingdata/add-payment-to-booking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
