Migration to V2

Mapping

Category v1 v2
Reservations /v1/reservation /v2/reservation
/v2/reservation/{reservationId}/distribution

Reservations

Endpoint /v1/reservation is deprecated. It's highly recommended to use V2, because of better performance.

Differences

/v1/reservation
  • returns a collection of ReservationItems
  • ReservationItem contains Reservation, Placement and Period
  • Period contains goal (quantity), price, discountedPrice and totalPrice per day
/v2/reservation
  • returns a collection of Reservations
  • Reservation contains Placement
/v2/reservation/{reservationId}/distribution
  • returns a collection of Distribution
  • Distribution contains goal, discountedPrice and totalPrice aggregated per month
  • Distribution data is updating after a reservation changed (it may take an hour occasionally)

Structure example

/v1/reservation
[
    {
        "reservation": {
            "id": 1,
            "···"
        },
        "placement": {
            "id": 2,
            "···"
        },
        "periods": [
            {
                "startDate": {
                    "date": "2050-01-02 00:00:00"
                },
                "quantity": 2,
                "price":  "10.0",
                "discountedPrice": "10.0",
                "totalPrice": "10.0",
                "···"
            }
        ]
    },
    {
        "reservation": {
            "id": 1,
            "···"
        },
        "placement": {
            "id": 2,
            "···"
        },
        "periods": [
            {
                "startDate": {
                    "date": "2050-01-03 00:00:00"
                },
                "quantity": 2,
                "price":  "10.0",
                "discountedPrice": "10.0",
                "totalPrice": "10.0",
                "···"
            }
        ]
    },
    "···"
]
/v2/reservation
[
    {
        "id": 1,
        "placement": {
            "id": 2,
            "···"
        },
        "···"
    }
]
/v2/reservation/1/distribution
[
    {
        "startDate": {
            "date": "2050-01-02 00:00:00"
        },
        "endDate": {
            "date": "2050-01-03 00:00:00"
        },
        "goal": 4,
        "discountedPrice": 20.0,
        "totalPrice": 20.0
    }
]