Import Reservation

Import Reservation

To post reservation orders into Microsoft Business Central the URL POST http://<serer name>:<odata port>/<service instance name>/api/BEterna/Import/v2.0/companies(<company system id>)/webshopReservations?$expand=webshopReservationLines can be used. It must be called with a JSON structure to create an order (webshopChannelCode is mandatory):

{
    "channel": "123",
    "subclient": "",
    "customerIP": "",
    "language": "DEU",
    "testReservation": "0",
    "registeredCustomer": "1",
    "reservationOrderId": "W150127_220",
    "orderType": "3",
    "orderDate": "2022-06-07 08:10:13",
    "subtotal": "300",
    "tax": "5700",
    "totalAmount": "300",
    "currency": "EUR",
    "customerComment": "KundenKommentat",
    "customerNo": "10000",
    "contactNo": "KT000043",
    "salutation": "Mr",
    "title": "Dr",
    "name": "Max Mustermann",
    "name2": "",
    "street": "Bornaer straße",
    "housenumber": "17",
    "addressSecondLine": "Hinterhaus",
    "zip": "99999",
    "city": "Musterhausen",
    "country": "CH",
    "state": "",
    "email": "Max_Mustermann@bedav.de",
    "phone": "00021654",
    "webshopReservationLines": [
        {
            "id": 10000,
            "type": "1",
            "itemNumber": "1000",
            "variant": "1",
            "singlePrice": "100",
            "amount": "3",
            "reservationLocation": "HAUPT"
        }
    ]
}

If a field is empty it can be left out in the JSON structure. The Reservation Header fields have the following meaning:

field data type content
webshopChannelCode Text[30] Webshop Channel Code
subclient Text[30] the subclient who placed the reservation
customerIP Text[30] IP address of the customer
language Text[3] language code of the customer
testReservation Text[30] 0 or 1
registeredCustomer Text[30] 1 if the customer is registered and must exist, 0 if it is a guest order
reservationOrderId Text[30] distinct ID of the reservation order
orderType Text[30] type of the order
orderDate Text[30] order date and time in the form 2022-05-01 10:00:00
subtotal Text[30] subtotal of the reservation
tax Text[30] tax of the reservation
totalAmount Text[30] totalAmount of the reservation
currency Text[30] the ISO3 currency code of the order
customerComment Text[80] special customer comment for the reservation
customerNo Text[20] customer no. of the reservation, must be filled, even if the customer is new
contactNo Text[20] contact no. of the order, must be filled and exist
salutation Text[30] salutation of the customer
title Text[30] title value
name Text[100] the name of the contact
name2 Text[50] the second name of the contact
street Text[50] the street of the contact
housenumber Text[50] the house number of the contact
addressSecondLine Text[50] the second address
zip Text[20] the zip code value
city Text[30] the city of the contact
county Text[30] the county of the contact
state Text[30] state code of the contact
email Text[80] the e-mail of contact
phone Text[30] the phone number of contact

There can be one or more Reservation Lines. They are transferred using a JSON array. The following fields can be defined for a single order line:

field data type content
id Integer distinct identifier of the line in the reservation, must be distinct per order
type Text[30] must be one of the following values: 1 item line, 2 voucher sale, 3 discount, 4 shipping costs, 5 voucher cashing in, 6 payment costs, which values are possible depends on the setup of the webshop channel
itemNumber Text[30] the item number for item lines, must be empty otherwise
variant Text[30] optionally the item variant code for item lines, must be empty otherwise
singlePrice Text[30] the single price for item lines
amount Text[30] the quantity of the line for item lines, otherwise ist must always be 1
reservationLocation Text[30] Reservation/Request Location value

In this article