Payment/Invoice items in getBookings API

Develper issues when using the Beds24 APi.
Post Reply
kingszg
Posts: 21
Joined: Sat Sep 21, 2019 7:38 am

Hello,
Can you shed some light on the type and type2 fields of invoice items retrieved with the getBookings API methods?

Code: Select all

            "invoiceId":"22745722",
            "description":"Some description",
            "status":"",
            "qty":"1",
            "price":"48.00",
            "vatRate":"13.00",
            "type":"1",
            "type2":"0",
            "invoiceeId":""
Somehow a type of 200 seems to indicate a payment. Is there any more meaning to these fields?

And in a related question, is it possible to expose pending payments through the API? ... or create them that way?

Thanks
kingszg
Posts: 21
Joined: Sat Sep 21, 2019 7:38 am

Hello - any input on this from the beds24 team?
kingszg
Posts: 21
Joined: Sat Sep 21, 2019 7:38 am

thanks for letting me know your thoughts on this.
lea_5886
Posts: 3
Joined: Mon Apr 06, 2020 4:55 pm

in reference to:
https://www.beds24.com/api/json/setBooking
and https://www.beds24.com/api/json/getBookings

I am also looking for information on this exact same subject. It appears this invoice array holds a number of invoice structures, one for each charge and payment item on the bookings "Charges & Payments" tab page.

By throwing things at the API / test booking in Beds24 and watching what it returns, I have been able to figure out a few things. However throwing things at the API and observing the returns is a less then ideal approach to interacting / understanding the API. Any sort of documentation on this invoice structure and specifically the fields of type, type2, and qty would be extremely helpful.



edit: (note my post below this one about not using type2!)
edit2: (note my other post below about the meanings of type)

the small text below probably should be ignored in light of my additional posts about type2, type, and qty


What I have found so far:
Room rate: type=1, type2=0
{
"invoiceId": "01234567",
"description": "Aspen Cottage Wednesday, 1 July, 2020 - Friday, 3 July, 2020",
"status": "",
"qty": "1",
"price": "420.00",
"vatRate": "0.00",
"type": "1",
"type2": "0",
"invoiceeId": ""
}


Upsell* items: type=3, type2=1
*it seems in Beds24 upsell items are how additional sales tax & room tax are added
{
"invoiceId": "7654321",
"description": "WI sales tax + Door county room tax 11%",
"status": "",
"qty": "1",
"price": "46.20",
"vatRate": "0.00",
"type": "3",
"type2": "1",
"invoiceeId": ""
}


Payment: type=200, type2=0
{
"invoiceId": "01230123",
"description": "test payment",
"status": "test",
"qty": "-1",
"price": "10.00",
"vatRate": "0.00",
"type": "200",
"type2": "0",
"invoiceeId": ""
}
note the rather odd return of "-1" for the field qty. That has left me baffled.




also, in the setBooking / getBooking structure, there are fields like custom1, custom2, and etc that appear ideal for sticking an extra tag or id in to assist with syncing bookings between systems. Is there the same sort of field or fields in the invoice structure that can be used for that?
Last edited by lea_5886 on Fri Apr 10, 2020 9:21 am, edited 6 times in total.
lea_5886
Posts: 3
Joined: Mon Apr 06, 2020 4:55 pm

I received an interesting response!
Payments are a positive value with a minus quantity.

Type values less than 200 is a charge and type 200 or greater is a payment.

The type2 values are really for internal use and indicate an index to the source of the charge.
That answers some of my questions.

And appears to make it clear we should not be messing with the type2 value ourselves.

Happy day,
Layla
lea_5886
Posts: 3
Joined: Mon Apr 06, 2020 4:55 pm

I think figured out part of the meaning of type field.

type < 200 = invoice item
type >= 200 = payment


in addition, I am going to speculate:


When type is < 200 It loosely corresponds to the Booking Engine -> Upsell Items page. Initial Numerical value of type = primary key of item defined on Booking Engine -> Upsell Items page when created from beds24. ?Not necessary when created with setBooking?

type2 is used to designate source of charge, with ?type2="1" being obligatory tax item?. It is possible this is related to the items in the associated drop down menu box on the Booking Engine -> Upsell Items page.

?It seems the numbering of the type field determines the order items are displayed on the booking -> charges & payments page.?

?altering the type field in the invoice array is acceptable, as it only only effect order rather then function provided it remains less then 200 for invoice items, or >= 200 for payment items?

?In order to get additional taxable items on the invoice, they need to be added with a type number less then the obligatory tax type number, to achieve this one will likely have to alter the type field on the obligatory tax item.?

?In order to get additional non-taxable items on the invoice, they need to be added after the obligatory tax type id number?

?When type is >= 200 it is a payment, and once again the value of type determines the order payment is displayed, 200, 201, etc.?
markkinchin
Site Admin
Posts: 918
Joined: Fri Mar 02, 2012 1:43 pm

The type and type2 values are used for the standard and custom reports within Beds24 to identify where the items originated.
Post Reply