Payments

Payments represents payments associated with an invoice.

The Payment object

Properties

  • idstring

    Unique identifier for the object.

  • amountnumber

    The amount of the payment.

  • datedate

    The date of the payment.

  • descriptionstring

    The description of the payment.

payment object

{
  "id": "671f9620186d40de4869f0ca",
  "amount": 169.4,
  "date": "2024-10-27T23:00:00.000Z",
  "description": null
}

POST/v2/invoices/:id/payments

Add a payment

This endpoint allows you to add a payment on the invoice

Parameters

  • descriptionstring,null

    The description of the payment.

  • amountnumber Required

    The amount of the payment.

  • datestring Required

    The date of the payment.

  • isFullyPaidboolean

    True if the invoice is fully paid.

Request

POST
/v2/invoices/:id/payments/
curl https://api.lsp.expert/v2/invoices/671f905a186d40de4869e273/jobs/6703a087b041fd94bf3a31cb \
  -u {key}: \
  -d amount=169.4 \
  -d isFullyPaid=true \
  -d date=2024-10-27T23:00:00.000Z

Response

{
  "id": "671f905a186d40de4869e273",
  "isPartiallyPaid": false,
  "paymentDate": "2024-10-27T23:00:00.000Z",
  "payments": [
    {
      "date": "2024-10-27T23:00:00.000Z",
      "amount": 169.4,
      "description": null,
      "id": "671f9620186d40de4869f0ca"
    }
  ],
  // ...
}


DELETE/v2/invoices/:id/payments/:payment-id

Delete a payment

This endpoint allows you to delete a payment on the invoice

Parameters

Request

DELETE
/v2/invoices/:id/payments/:payment-id
curl -X DELETE https://api.lsp.expert/v2/invoices/671f905a186d40de4869e273/payments/671f9620186d40de4869f0ca \
  -u {key}: \

Response

{
  "id": "671f905a186d40de4869e273",
  "isPartiallyPaid": false,
  "payments": [],
  // ...
}