Skip to main content
POST
/
invoices
/
complete
Import a complete invoice
curl --request POST \
  --url https://api.leanpay.fr/v1/public/invoices/complete \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "reference": "<string>",
  "amount": 1,
  "issueDate": "2023-12-25",
  "dueDates": [
    {
      "dueDate": "2023-12-25",
      "currency": "<string>",
      "amount": 1,
      "defaultCurrencyAmount": 1
    }
  ],
  "externalId": "<string>",
  "client": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "dueDate": "2023-12-25",
  "payments": [
    {
      "date": "2023-12-25",
      "amount": 1,
      "externalId": "<string>"
    }
  ],
  "creditNoteLinks": [
    {
      "date": "2023-12-25",
      "creditNote": {
        "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,
  "paidAmount": 123,
  "offsetAmount": 123,
  "sentDate": "2023-11-07T05:31:56Z",
  "issueDate": "2023-11-07T05:31:56Z",
  "dueDate": "2023-11-07T05:31:56Z",
  "status": "due",
  "upcomingPaymentDate": "2023-11-07T05:31:56Z",
  "dueDates": [
    {
      "dueDate": "2023-11-07T05:31:56Z",
      "currency": "<string>",
      "amount": 1,
      "defaultCurrencyAmount": 1
    }
  ],
  "payments": [
    {
      "date": "2023-11-07T05:31:56Z",
      "amount": 1,
      "defaultCurrencyAmount": 1,
      "externalId": "<string>"
    }
  ],
  "creditNoteLinks": [
    {
      "date": "2023-11-07T05:31:56Z",
      "amount": 1,
      "defaultCurrencyAmount": 1,
      "externalId": "<string>",
      "creditNote": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "externalId": "<string>"
      }
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Body

application/json

Complete invoice object to import

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

Response

Returns the imported invoice

id
string<uuid>
tenantId
string<uuid>
clientId
string<uuid>
externalId
string | null
reference
string
amount
integer
remainingAmount
integer
paidAmount
integer
offsetAmount
integer
sentDate
string<date-time>
deprecated

use issueDate instead

issueDate
string<date-time>
dueDate
string<date-time>
status
enum<string>

Invoice status

Available options:
due,
overdue,
paid,
disputed,
offset,
payment_in_progress,
upcoming_payment,
recovery
upcomingPaymentDate
string<date-time> | null
dueDates
object[]
payments
object[]
createdAt
string<date-time>
updatedAt
string<date-time>