Apply a Payment

POST /o/op/1/pay

Add a payment to an existing receipt.

application/json

Body Required

  • iKaccountId integer(int64) Deprecated
  • iKaccountIdentifier string

    The ID of the account to apply this payment to.

  • thirdPartyPaymentReference string Required

    A unique external reference provided for this order. This value will be sent back in the webhook.

    Minimum length is 1, maximum length is 50.

  • endpointId string Required

    Endpoint ID for a unique webhook that has been created using the webhook endpoint.

  • businessLocationId integer(int64) Required

    The unique identifier for the business location.

  • taskTtlInMs integer(int32)

    Maximum time to attempt delivery of this payment to the POS. In milliseconds. The minimum value is 60000ms (1 minute).

  • staffId integer(int64)

    The ID of the employee responsible for this payment.

  • deviceId integer(int64)

    POS device to specifically receive this payment. If left null then all POS devices may receive the payment but only one will process it.

  • paymentMethod string

    Payment method code as configured by the merchant.

  • paymentAmount number Required

    The total amount of the payment without tips.

  • tipAmount number

    The tip amount, if any.

  • targetPrinterProfileId integer(int64)

    The printer profile id to use for printing the receipt for this payment. If not provided, the default active printer profile for the business location will be used.

Responses

  • 200 application/json

    accepted

    Hide response attribute Show response attribute object
    • status string

      The response.

  • 400 */*

    Bad Request

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

      The date and time at which the error occurred, in UTC.

    • status integer

      The HTTP status code indicating the type of error.

    • error string

      A short description of the HTTP status code meaning.

    • message string

      A detailed message describing the error, including any specific details about the request that led to the error.

    • path string

      The request path where the error occurred.

POST /o/op/1/pay
curl \
 --request POST 'https://api.trial.lsk.lightspeed.app/o/op/1/pay' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"iKaccountId":0,"iKaccountIdentifier":"A1234.56","thirdPartyPaymentReference":"12345678901234","endpointId":"MY-AWESOME-ENDPOINT-ID","businessLocationId":45454565682155,"taskTtlInMs":60000,"staffId":42,"deviceId":12345678980,"paymentMethod":"OOPAYMENT","paymentAmount":20.06,"tipAmount":2.5,"targetPrinterProfileId":1773881235}'
Request examples
{
  "iKaccountId": 0,
  "iKaccountIdentifier": "A1234.56",
  "thirdPartyPaymentReference": "12345678901234",
  "endpointId": "MY-AWESOME-ENDPOINT-ID",
  "businessLocationId": 45454565682155,
  "taskTtlInMs": 60000,
  "staffId": 42,
  "deviceId": 12345678980,
  "paymentMethod": "OOPAYMENT",
  "paymentAmount": 20.06,
  "tipAmount": 2.5,
  "targetPrinterProfileId": 1773881235
}
Response examples (200)
{
  "status": "ok"
}
Response examples (400)
{
  "timestamp": "2023-11-07T23:00:20.075+0000",
  "status": 400,
  "error": "Bad Request",
  "message": "reference has already been used 12345678901234",
  "path": "/o/op/1/pay"
}