Correct an approved bill

Applies a correction previewed with bill.correct.preview the way saving the bill in the app does: the bill is updated and its journal re-posted on the same dates, or on the new date_of_document (at the rate of its date when the bill takes its missing exchange rate, or of its new date for a foreign-currency bill); payments and vendor credits stay on the bill. A removed line ({id, remove: true}) leaves the bill, its totals drop by the line's own, and on a bill with payments or vendor credits the open amount drops by as much and a bill they now cover is paid (unpaid_amount and status move). Include the preview's confirmation_token with the same body and Idempotency-Key; If-Match is required. A bill that changed since the preview, a commit that differs from its preview in missing_exchange_rate, date_of_document, due_date or the payment term, or a rate that differs from the one the preview showed is refused with 412; a token that does not belong to this request is refused with bill_correct_token_invalid; the preview's refusals (bill_correct_below_paid, bill_correct_keep_a_line, bill_correct_total_not_positive, bill_totals_mismatch and the others) apply again under the locks. The bill and every line are compared after the save: if any field differs from what the preview showed, the commit is refused with bill_correct_unplanned_change and nothing is saved. Requires the bills:action OAuth scope.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
Body Params

Confirmed values used to correct an approved bill, including the confirmation token returned by bill.correct.preview.

uuid

The supplier the bill belongs to (from the vendors list).

string
length ≤ 255

The supplier's own invoice number.

string | null
string
enum

Only for a foreign-currency bill with no exchange rate Cybooks can post with (the bill's exchange_rate is null, or exactly 1 with neither is_custom true nor source ecb): document_date gives it the rate of its date, as saving it in the app does (ECB), and re-posts its journal at that rate. Left out, such a bill is refused with bill_correct_exchange_rate_unusable. Refused on a bill that has a rate (bill_correct_exchange_rate_present), on one with payments or vendor credits (bill_correct_exchange_rate_paid), on one with a line that made a fixed asset or is in an IP Box capitalization (bill_correct_fixed_asset_line, bill_correct_ip_box_capitalized) and when there is no rate for its date (bill_correct_exchange_rate_unavailable).

Allowed:
date

The bill's new date (YYYY-MM-DD). The bill's journal is re-posted on it, as saving the bill in the app does; payments and vendor credits keep their own dates. A foreign-currency bill takes the ECB rate of the new date, as the app gives it (refused with bill_correct_exchange_rate_paid on one with payments or vendor credits). Both the old and the new date must be in an open period no filed VAT return covers (bill_correct_period_locked, bill_correct_vat_filed). Refused on a bill a fixed asset was made from (bill_correct_fixed_asset_line), with a line in an IP Box capitalization (bill_correct_ip_box_capitalized), with an import VAT line (bill_correct_import_vat), that receives stock (bill_correct_stock_line) or with a customs record or a landed cost applied from it (bill_correct_landed_cost), and on a foreign-currency bill whose service period ends before the new date (bill_correct_accrual_exchange_rate). Refused while Pay bills holds the bill and the new date changes what an approval policy may ask again on, the due date its payment term gives or a foreign-currency bill's amount at the new rate (bill_in_bank_file, bill_paid_already). Not with missing_exchange_rate.

date | null

The bill's new due date (YYYY-MM-DD), on or after its date; null clears it. Left out with a new date_of_document, a bill with a payment term (net15, net30, net45, end_of_month, due_next_month, due_on_receipt) takes the due date the term gives the new date, as the bill page does, and any other bill keeps its due date. A due date the term would not give makes the term custom, as the bill page does. Refused while Pay bills holds the bill and an approval policy may send it back for approval (bill_in_bank_file, bill_paid_already).

string
required
length ≤ 8192
line_items
array of objects
length between 1 and 500

The lines to correct; a line not listed keeps its account, tax rule and description.

line_items
Headers
string
required
length ≤ 191

Required unique key whose request hash and terminal response are stored durably for 24 hours.

string

Required. ETag from the latest representation; a stale value returns 412 precondition_failed. Send this header, not the standard If-Match: some HTTP intermediaries evaluate a standard If-Match themselves and can answer 412 even though the change was applied. Never send both; both with different ETags returns 400 conflicting_precondition_headers.

string
deprecated

Accepted with the same value and meaning as Cybooks-If-Match, but do not send it: an intermediary can answer 412 to it after the change was applied. Send Cybooks-If-Match instead.

Responses

Language
Credentials
OAuth2
Missing 1 required scope
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
*/*