Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

define a new API for creating reservations #1035

Merged
merged 4 commits into from
Dec 2, 2021
Merged

Conversation

cbellone
Copy link
Member

@cbellone cbellone commented Dec 1, 2021

Create Reservation

POST /api/v1/admin/event/{slug}/reservation

Sample Body (Reference)

{
  "tickets": [
    {
      "ticketCategoryId": 53,
      "quantity": "1",
      "metadata": [{
        "attributeForTicket1": "value"
      }]
    },
    {
      "ticketCategoryId": 56,
      "quantity": "2",
      "metadata": [{
        "attributeForTicket1": "value1"
      }, {
        "attributeForTicket2": "value2"
      }]
    }
  ],
  "additionalServices": [
    {
      "additionalServiceId": 1,
      "quantity": 1
    }
  ],
  "promoCode": null,
  "user": {
    "username": "test@example.org",
    "firstName": "Test",
    "lastName": "McTest",
    "email": "test@example.org",
    "id": "external-id"
  }
}

Response

  • HTTP 201
    {
      "success": true,
      "id": "reservation-id",
      "href": "public-url-for-reservation",
      "errors": null
    }
  • HTTP 400 Error descriptor
  • HTTP 500 Error descriptor

JSON Reference

Create Reservation Request

Name Description Mandatory
reservation Tickets to reserve *
reservation.*.ticketCategoryId Category ID *
reservation.*.quantity number of tickets for the given category ID *
additionalService additional items to reserve
additionalService.*.additionalServiceId additional service ID *
additionalService.*.quantity number of additional services items *
promoCode promoCode to apply
user authenticated user who is performing the reservation
user.username username. Depending on the Authentication system in use, can be the user email *
user.firstName First name *
user.lastName Last name *
user.email Email *
id External ID, this attribute is currently ignored

@cbellone cbellone requested a review from syjer December 1, 2021 18:10
@cbellone cbellone merged commit a66627e into master Dec 2, 2021
@cbellone cbellone added this to the 2.0-M4 milestone Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants