PUT
/
api
/
external
/
v2
/
customer_invoices
/
{id}
/
update_imported
Update an Imported customer invoice
curl --request PUT \
  --url https://app.pennylane.com/api/external/v2/customer_invoices/{id}/update_imported \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "date": "2023-08-30",
  "deadline": "2023-08-30",
  "customer_id": 42,
  "invoice_number": "F20230001",
  "currency": "EUR",
  "currency_amount_before_tax": "100.00",
  "currency_amount": "120.00",
  "amount": "120.00",
  "currency_tax": "20.00",
  "tax": "20.00",
  "transaction_reference": {
    "banking_provider": "bank",
    "provider_field_name": "label",
    "provider_field_value": "invoice_number"
  },
  "invoice_lines": {
    "create": [
      {
        "currency_amount": "120.00",
        "amount": "120.00",
        "currency_tax": "20.00",
        "tax": "20.00",
        "label": "Demo label",
        "quantity": 12,
        "ledger_account_id": 1255,
        "raw_currency_unit_price": "33.333334",
        "unit": "piece",
        "vat_rate": "FR_200",
        "description": "<string>",
        "product_id": 42,
        "imputation_dates": {
          "start_date": "2020-06-30",
          "end_date": "2021-06-30"
        }
      }
    ],
    "update": [
      {
        "id": 42,
        "currency_amount": "120.00",
        "amount": "120.00",
        "currency_tax": "20.00",
        "tax": "20.00",
        "label": "Demo label",
        "quantity": 12,
        "ledger_account_id": 1255,
        "raw_currency_unit_price": "33.333334",
        "unit": "piece",
        "vat_rate": "FR_200",
        "description": "<string>",
        "product_id": 42,
        "imputation_dates": {
          "start_date": "2020-06-30",
          "end_date": "2021-06-30"
        }
      }
    ],
    "delete": [
      {
        "id": 42
      }
    ]
  },
  "external_reference": "FR123"
}'
{
  "id": 42,
  "label": "Invoice label",
  "invoice_number": "F20230001",
  "currency": "EUR",
  "amount": "230.32",
  "currency_amount": "230.32",
  "currency_amount_before_tax": "196.32",
  "exchange_rate": "1.0",
  "date": "2023-08-30",
  "deadline": "2020-09-02",
  "currency_tax": "34.0",
  "tax": "34.0",
  "language": "fr_FR",
  "paid": false,
  "status": "archived",
  "discount": {
    "type": "absolute",
    "value": "25"
  },
  "ledger_entry": {
    "id": 42002
  },
  "public_file_url": "https://app.pennylane.com/public/invoice/pdf?encrypted_id=bzjoVJe...3D%3D",
  "filename": "my_file.pdf",
  "remaining_amount_with_tax": "20.0",
  "remaining_amount_without_tax": "16.0",
  "draft": false,
  "special_mention": "Additional details",
  "customer": {
    "id": 42,
    "url": "https://app.pennylane.com/api/external/v2/customers/42"
  },
  "invoice_line_sections": {
    "url": "https://app.pennylane.com/api/external/v2/customer_invoices/42/invoice_line_sections"
  },
  "invoice_lines": {
    "url": "https://app.pennylane.com/api/external/v2/customer_invoices/42/invoice_lines"
  },
  "custom_header_fields": {
    "url": "https://app.pennylane.com/api/external/v2/customer_invoices/42/custom_header_fields"
  },
  "categories": {
    "url": "https://app.pennylane.com/api/external/v2/customer_invoices/42/categories"
  },
  "pdf_invoice_free_text": "Thanks for paying this invoice",
  "pdf_invoice_subject": "Invoice subject",
  "pdf_description": "Invoice description",
  "billing_subscription": {
    "id": 123
  },
  "credited_invoice": {
    "id": 40,
    "url": "https://app.pennylane.com/api/external/v2/customer_invoices/40"
  },
  "customer_invoice_template": {
    "id": 123
  },
  "transaction_reference": {
    "banking_provider": "bank",
    "provider_field_name": "label",
    "provider_field_value": "invoice_number"
  },
  "payments": {
    "url": "https://app.pennylane.com/api/external/v2/customer_invoices/42/payments"
  },
  "matched_transactions": {
    "url": "https://app.pennylane.com/api/external/v2/customer_invoices/42/matched_transactions"
  },
  "appendices": {
    "url": "https://app.pennylane.com/api/external/v2/customer_invoices/42/appendices"
  },
  "quote": {
    "id": 42
  },
  "external_reference": "FR123",
  "archived_at": "2023-08-30T10:08:08.146343Z",
  "created_at": "2023-08-30T10:08:08.146343Z",
  "updated_at": "2023-08-30T10:08:08.146343Z"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

id
integer
required

The ID of the imported customer invoice

Body

application/json
date
string<date>

Invoice date (ISO 8601)

Example:

"2023-08-30"

deadline
string<date>

Invoice payment deadline (ISO 8601)

Example:

"2023-08-30"

customer_id
integer

Customer identifier

Example:

42

invoice_number
string

Invoice number

Example:

"F20230001"

currency
enum<string>
default:EUR
Available options:
EUR,
USD,
GBP,
AED,
AFN,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BRL,
BSD,
BTN,
BWP,
BYN,
BYR,
BZD,
CAD,
CDF,
CHF,
CLF,
CLP,
CNY,
COP,
CRC,
CUC,
CUP,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
ERN,
ETB,
FJD,
FKP,
GEL,
GGP,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
IMP,
INR,
IQD,
IRR,
ISK,
JEP,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KPW,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LTL,
LVL,
LYD,
MAD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRO,
MUR,
MVR,
MWK,
MXN,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SDG,
SEK,
SGD,
SHP,
SLL,
SOS,
SRD,
STD,
SVC,
SYP,
SZL,
THB,
TJS,
TMT,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
UYU,
UZS,
VEF,
VND,
VUV,
WST,
XAF,
XCD,
XDR,
XOF,
XPF,
YER,
ZAR,
ZMK,
ZMW,
ZWL
currency_amount_before_tax
string

Invoice currency amount before tax (total value before tax of the invoice in the currency of the invoice)

Example:

"100.00"

currency_amount
string

Invoice currency amount (total value of the invoice in the currency of the invoice)

Example:

"120.00"

amount
string

Invoice amount in euros (total value of the invoice in euros). If the currency is euro, currency_amount and amount are identical.

Example:

"120.00"

currency_tax
string

Invoice taxable amount (in invoice currency)

Example:

"20.00"

tax
string

Invoice taxable amount (in euros). If the currency is euro, currency_tax and tax are identical.

Example:

"20.00"

transaction_reference
object | null

Schema for creating/updating a transaction reference

invoice_lines
object

Add, update, delete invoice lines.

external_reference
string

The unique external reference that was assigned during creation either by you or Pennylane.

Example:

"FR123"

Response

The imported customer invoice

id
integer
required

Invoice identifier

Example:

42

label
string | null
required
Example:

"Invoice label"

invoice_number
string
required
Example:

"F20230001"

currency
enum<string>
default:EUR
required
Available options:
EUR,
USD,
GBP,
AED,
AFN,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BRL,
BSD,
BTN,
BWP,
BYN,
BYR,
BZD,
CAD,
CDF,
CHF,
CLF,
CLP,
CNY,
COP,
CRC,
CUC,
CUP,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
ERN,
ETB,
FJD,
FKP,
GEL,
GGP,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
IMP,
INR,
IQD,
IRR,
ISK,
JEP,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KPW,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LTL,
LVL,
LYD,
MAD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRO,
MUR,
MVR,
MWK,
MXN,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SDG,
SEK,
SGD,
SHP,
SLL,
SOS,
SRD,
STD,
SVC,
SYP,
SZL,
THB,
TJS,
TMT,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
UYU,
UZS,
VEF,
VND,
VUV,
WST,
XAF,
XCD,
XDR,
XOF,
XPF,
YER,
ZAR,
ZMK,
ZMW,
ZWL
amount
string
required

Invoice amount (total value of the invoice in euros. If the currency is euro, currency_amount and amount are identical)

Example:

"230.32"

currency_amount
string
required

Invoice currency amount (total value of the invoice in the currency of the invoice)

Example:

"230.32"

currency_amount_before_tax
string
required

Invoice currency amount before tax (total value before tax of the invoice in the currency of the invoice)

Example:

"196.32"

exchange_rate
string
required

Invoice exchange rate (used to convert the invoice to euros. If the invoice currency is euro it will be 1.0)

Example:

"1.0"

date
string<date> | null
required

Invoice issue date (ISO 8601)

Example:

"2023-08-30"

deadline
string | null
required

Invoice payment deadline (ISO 8601)

Example:

"2020-09-02"

currency_tax
string
required

Invoice taxable amount (in euros. If the currency is euro, currency_amount and amount are identical)

Example:

"34.0"

tax
string
required

Invoice taxable amount (in invoice currency)

Example:

"34.0"

language
enum<string>
default:fr_FR
required
Available options:
fr_FR,
en_GB
paid
boolean
required

Invoice paid status (set to True if the invoice is paid)

Example:

false

status
enum<string>
required
Available options:
archived,
incomplete,
cancelled,
paid,
partially_cancelled,
upcoming,
late,
draft,
credit_note
discount
object
required
ledger_entry
object
required
public_file_url
string | null
required

Public URL of the invoice file. The URL will expire after 30 minutes.

Example:

"https://app.pennylane.com/public/invoice/pdf?encrypted_id=bzjoVJe...3D%3D"

filename
string | null
required

Name of the file attached to the invoice

Example:

"my_file.pdf"

remaining_amount_with_tax
string | null
required

The remaining amount with VAT to pay for the invoice to be considered paid

Example:

"20.0"

remaining_amount_without_tax
string | null
required

The remaining amount without VAT to pay for the invoice to be considered paid

Example:

"16.0"

draft
boolean
required

Indicates if the invoice is in draft (has not been finalized)

Example:

false

special_mention
string | null
required

Additional details

Example:

"Additional details"

customer
object | null
required
invoice_line_sections
object
required
invoice_lines
object
required
custom_header_fields
object
required
categories
object
required
pdf_invoice_free_text
string
required
Example:

"Thanks for paying this invoice"

pdf_invoice_subject
string
required
Example:

"Invoice subject"

pdf_description
string | null
required
Example:

"Invoice description"

billing_subscription
object | null
required
credited_invoice
object | null
required

The credited invoice if the invoice is a credit note.

customer_invoice_template
object | null
required
transaction_reference
object | null
required

This reconciles the invoice with a transaction. See documentation about automatic payment matching.

payments
object
required
matched_transactions
object
required
appendices
object
required
quote
object | null
required

The quote at the origin of the invoice

external_reference
string
required

The unique external reference that was assigned during creation either by you or Pennylane. (Same attribute as external_id in the API v1)

Example:

"FR123"

archived_at
string<date-time> | null
required

The time the invoice has been archived

Example:

"2023-08-30T10:08:08.146343Z"

created_at
string<date-time>
required

The time the invoice has been created

Example:

"2023-08-30T10:08:08.146343Z"

updated_at
string<date-time>
required

The last time the invoice has been updated

Example:

"2023-08-30T10:08:08.146343Z"