Skip to main content
POST
/
credit-notes
/
complete
Import a complete credit note
curl --request POST \
  --url https://api.leanpay.fr/v1/public/credit-notes/complete \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "reference": "<string>",
  "amount": 1,
  "issueDate": "2023-12-25",
  "currency": "<string>",
  "externalId": "<string>",
  "client": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "dueDate": "2023-12-25",
  "defaultCurrencyAmount": 1,
  "paybacks": [
    {
      "date": "2023-12-25",
      "amount": 1,
      "externalId": "<string>"
    }
  ],
  "invoiceLinks": [
    {
      "date": "2023-12-25",
      "invoice": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      },
      "amount": 1,
      "externalId": "<string>"
    }
  ]
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "tenantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "clientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "externalId": "<string>",
  "reference": "<string>",
  "amount": 123,
  "remainingAmount": 123,
  "paybackAmount": 123,
  "deductedAmount": 123,
  "issueDate": "2023-11-07T05:31:56Z",
  "paybacks": [
    {
      "date": "2023-11-07T05:31:56Z",
      "amount": 1,
      "defaultCurrencyAmount": 1,
      "externalId": "<string>"
    }
  ],
  "invoiceLinks": [
    {
      "date": "2023-11-07T05:31:56Z",
      "amount": 1,
      "defaultCurrencyAmount": 1,
      "externalId": "<string>",
      "invoice": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "externalId": "<string>"
      }
    }
  ],
  "status": "available",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Body

application/json

Complete credit note object to import

reference
string
required
Maximum string length: 80
amount
integer
required
Required range: x >= 0
issueDate
string<date>
required
currency
string
required
externalId
string | null
Maximum string length: 80
client
object
dueDate
string<date>
defaultCurrencyAmount
number
Required range: x >= 0
paybacks
object[]

Response

Returns the imported credit note

id
string<uuid>
tenantId
string<uuid>
clientId
string<uuid>
externalId
string | null
reference
string
amount
integer
remainingAmount
integer
paybackAmount
integer
deductedAmount
integer
issueDate
string<date-time>
paybacks
object[]
status
enum<string>

Credit note status

Available options:
available,
deducted,
disputed,
recovery
createdAt
string<date-time>
updatedAt
string<date-time>