ibelsaDocumentation
ibelsaAPI
Guide for invoice management
---
created: 2021-04-01T00:00
updated: 2024-04-25T14:07
author: ibelsa API team
title: Guide for invoice management
---
# Guide for invoice management
ibelsa API allows to close invoices, to split invoicesand to add and remove optional products
to or from a reservation.
Closing an invoice leads to a production of an invoicedocument (pdf). This document can
either be send via ibelsa to the invoice recipientor can be obtained over the ibelsa API.
## Getting the data
### Get invoice recipient and not yet paid amount
_`Endpoint: GET /api/get/roomreservation/cost/{entity_id}`_
* _entity_id is the internal id of the room reservation_
Doc: [Reservation Cost](/api/doc#get--api-get-roomreservation-cost-{entity_id})
This endpoint provides you with the following information:
* All invoice items of this room reservation **not yetpaid**.
* Among other things the total amount of the invoice
* All invoice templates as a list of id and name. Mandatoryto close an invoice
* All payment methods as a list of id and name. Mandatoryto close an invoice
### Get all payment methods and invoice templates
_`Endpoint: GET /api/get/hotel/payment`_
Doc: [Get payment methods](/api/doc#get--api-get-hotel-payment)
This endpoint provides you with the following information:
* All invoice templates as a list of id and name.
* All payment methods as a list of id and name.
## Closing the invoice
### Set reservation as paid (write access required)
_`Endpoint: GET /api/set/roomreservation/paid/{entity_id}/{template_id}/{payment_method_id}/{send_invoice}/{amount}`_
* entity_id is the internal id of the room reservation
* template_id is the internal id of the invoice template (see Getting the data above)
* payment_method_id is the internal id of the paymentmethod (see Getting the data above)
* send_invoice
* yes = ibelsa will send the invoice document to theinvoice recipient
* no = ibelsa only produces the document
* amount must be the total amount of the invoice(see Getting the data above)
Doc: [Set roomreservation paid](/api/doc#get--api-set-roomreservation-paid-{entity_id}-{template_id}-{payment_method_id}-{send_invoice}-{amount})
## Pay parts of an invoice, split the invoice
### Pay parts of the invoice of a reservation (write access required)
_`Endpoint: POST /api/set/roomreservation/paidpartial`_
Doc: [Set parts of roomreservation paid](/api/doc#post--api-set-roomreservation-paidpartial)
Within this POST Request you define all invoice items (see Getting the data above) you want to pay.
Example:
```JSON
{
"entity_id": 3665,
"template_id": 1,
"payment_method_id": 6,
"send_invoice": "yes",
"invoicitem_ids": [77417,77418]
}
```
* entity_id is the internal id of the room reservation
* template_id is the internal id of the invoice template(see Getting the data above)
* payment_method_id is the internal id of the paymentmethod(see Getting the data above)
* send_invoice
* yes = ibelsa will send the invoice document to theinvoice recipient
* no = ibelsa only produces the document
* invoiceitem_ids, list of internal ids of invoice items(see Getting the data above)
The invoice with the defined invoice items will beclosed and the invoice document (pdf) will
be produced. The flag “send_invoce” says if the documentwill be send to the invoice
recipient or not.
## Split invoice of a reservation
### Create a new invoice with defined invoiceitems (writeaccess required)
_`Endpoint: POST /api/set/roomreservation/splitinvoice`_
Doc: [Split Roomreservation Invoice](/api/doc#post--api-set-roomreservation-splitinvoice)
Within this POST Request you define all invoice items(see Getting the data above)you want to
add to a new invoice.\
Example:
```JSON
{
"entity_id": 3665,
"invoicitem_ids": [77417,77418]
}
```
* entity_id is the internal id of the room reservation
* invoiceitem_ids, list of internal ids of invoice items(see Getting the data above)
Only invoice items not belonging to a closed invoicemay be used. The resulting open
invoice belongs to the roomreservation.
## Getting optional package products
### Get all optional package products
_`Endpoint: GET /api/get/products/optional/{rate_id}`_
Doc: [Get optional package products](/api/doc#get--api-get-products-optional-{rate_id})
* rate_id, the internal id of the rate used in the reservation
This endpoint provides you with a list of all optionalproducts of the used rate.
## Getting available products
### Get available products. These products must be explicitly marked for the API.
_`Endpoint: GET /api/get/products/available`_
Doc: [Get available products](/api/doc#get--api-get-products-available)
This endpoint provides you with a list of all optionalproducts of the used rate.
## Add products to a reservation
### Add products to reservation (write access required)
_`Endpoint: POST /api/set/add/products`_
Doc: [Add products](/api/doc#post--api-set-add-products)
Example:
```JSON
{
"room_reservation_id": 2235,
"products": [
{
"id": 94,
"quantity": 3
},
{
"id": 97,
"quantity": 1
}
]
}
```
## Remove products from a reservation
### Remove optional products from reservation (write access required)
_`Endpoint: POST /api/set/remove/products`_
Doc: ["Remove products"](/api/doc#post--api-set-remove-products)
Example:
```JSON
{
"room_reservation_id": 2235,
"optional_products": [
{
"id": 94,
"quantity": 3
},
]
}
```
Author:
Created:
Updated:
This page was generated from a Markdown file.
Would you like to view the content in your favourite Markdown reader? Raw Markdown
Would you like to view the content in your favourite Markdown reader? Raw Markdown