Lightspeed Restaurant K Series API
1.0.0

Lightspeed Restaurant offers a REST API in order to communicate with the data in the system. These APIs are built using the RESTful standards and adhere to the basic verb interactions as defined by the REST standard.

These services are in continuous development and subject to change. Find our versioning policy here.

This is the documentation for version 1.0.0 of the API. Last update on May 1, 2024.

Base URL
https://api.trial.lsk.lightspeed.app

Update a webhook

POST /o/wh/1/webhook

Updates an existing webhook entry.

Important Note: if provideAccount, expandTransactions, or expandPayments are excluded from the update request, they will be reset to their default values.

application/json

Body Required

  • endpointId string Required

    The unique endpoint ID, for example the integration name. Case sensitive.

  • url string Required

    The URL which this endpoint points to.

  • If basic auth should be used, defaults to false.

    Default value is false.

  • username string

    The username for basic auth.

  • password string

    The password for basic auth.

  • Whether or not to include account info in the notification.

    Default value is false.

  • Whether or not to include transaction lines in the notification.

    Default value is false.

  • Whether or not to include payment lines in the notification.

    Default value is false.

  • subscribeTo array[object]

    Event to listen to by resource

    Hide subscribeTo attributes Show subscribeTo attributes object
    • name string

      Events to subscribe to. Order: DELIVERED can be added here.

      The following are always sent:

      • Account: CLOSED and CHECK_WAS_UPDATED.
      • Order: FAILURE, READY_FOR_PICKUP and CANCELLED.
      • Payment: SUCCESS and FAILURE.
    • resource string

      Values are order or payment.

Responses

  • 200 application/json

    Webhook

    Hide response attributes Show response attributes object
    • endpointId string Required

      The unique endpoint ID, for example the integration name. Case sensitive.

    • url string Required

      The URL which this endpoint points to.

    • If basic auth should be used, defaults to false.

      Default value is false.

    • username string

      The username for basic auth.

    • password string

      The password for basic auth.

    • Whether or not to include account info in the notification.

      Default value is false.

    • Whether or not to include transaction lines in the notification.

      Default value is false.

    • Whether or not to include payment lines in the notification.

      Default value is false.

    • subscribeTo array[object]

      Event to listen to by resource

      Hide subscribeTo attributes Show subscribeTo attributes object
      • name string

        Events to subscribe to. Order: DELIVERED can be added here.

        The following are always sent:

        • Account: CLOSED and CHECK_WAS_UPDATED.
        • Order: FAILURE, READY_FOR_PICKUP and CANCELLED.
        • Payment: SUCCESS and FAILURE.
      • resource string

        Values are order or payment.

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • timestamp string(date-time)

      The date and time at which the error occurred.

    • status integer

      The HTTP status code of the error response.

    • error string

      A brief title of the error status.

    • message string

      A message describing the nature of the error in detail.

    • errors array[object]

      An array of error details, outlining specific issues with the request.

      Hide errors attributes Show errors attributes object
      • codes array[string]

        A set of code strings that correspond to the validation error.

      • arguments array[object]
        Hide arguments attributes Show arguments attributes object
        • codes array[string]

          Argument codes that are related to the field in validation.

        • The default message associated with the failed validation.

        • code string

          A single code that represents the specific validation rule that was not satisfied.

      • The default error message provided when the associated field fails validation.

      • The name of the object that failed validation.

      • field string

        The name of the field that failed validation.

      • Indicates whether the error was a result of a binding failure.

      • code string

        A code representing the specific type of validation error.

    • path string

      The path of the failed request.

POST /o/wh/1/webhook
curl \
 -X POST https://api.trial.lsk.lightspeed.app/o/wh/1/webhook \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"endpointId":"MY-AWESOME-ENDPOINT-ID","url":"https://webhook.site/1dc40b86-3d0d","withBasicAuth":true,"username":"username","password":"password","provideAccount":true,"expandTransactions":true,"expandPayments":true,"subscribeTo":[{"name":"DELIVERED","resource":"order"}]}'
Request example
{
  "endpointId": "MY-AWESOME-ENDPOINT-ID",
  "url": "https://webhook.site/1dc40b86-3d0d",
  "withBasicAuth": true,
  "username": "username",
  "password": "password",
  "provideAccount": true,
  "expandTransactions": true,
  "expandPayments": true,
  "subscribeTo": [
    {
      "name": "DELIVERED",
      "resource": "order"
    }
  ]
}
Response examples (200)
{
  "endpointId": "MY-AWESOME-ENDPOINT-ID",
  "url": "https://webhook.site/1dc40b86-3d0d",
  "withBasicAuth": true,
  "username": "username",
  "password": "password",
  "provideAccount": true,
  "expandTransactions": true,
  "expandPayments": true,
  "subscribeTo": [
    {
      "name": "DELIVERED",
      "resource": "order"
    }
  ]
}
Response examples (400)
{
  "timestamp": "2023-11-07T19:15:05.043+0000",
  "status": 400,
  "error": "Bad Request",
  "message": "Validation failed for object='webhookEndpointDto'. Error count: 1",
  "errors": [
    {
      "codes": [
        "NotNull.webhookEndpointDto.endpointId",
        "NotNull.endpointId",
        "NotNull.java.lang.String",
        "NotNull"
      ],
      "arguments": [
        {
          "codes": [
            "webhookEndpointDto.endpointId",
            "endpointId"
          ],
          "defaultMessage": "endpointId",
          "code": "endpointId"
        }
      ],
      "defaultMessage": "must not be null",
      "objectName": "webhookEndpointDto",
      "field": "endpointId",
      "bindingFailure": false,
      "code": "NotNull"
    }
  ],
  "path": "/o/wh/1/webhook"
}