End a recurring plan
End the plan: no more invoices, ever (an ended plan is terminal). One revision; a repeat on an ended plan is duplicate-ok.
End the plan: no more invoices, ever (an ended plan is terminal). One revision; a repeat on an ended plan is duplicate-ok.
End the plan: no more invoices, ever (an ended plan is terminal). One revision; a repeat on an ended plan is duplicate-ok.
x-api-key<token>A per-user API key. x-api-key takes precedence over every session cookie when both are sent. Omit this header to use a session, including for signed-act presence.
entityId*stringuuidplanId*stringuuidapplication/jsonexpectedSeq*integerThe head seq the caller believes it is appending after; the server writes expectedSeq + 1.
0 <= valueThe plan as it now reads.
application/jsonacts*array<>Exactly the verbs this caller may take on the plan now: an active plan edit, pause, end; a paused one edit, resume, end; an ended one none; and none for a firm hat its client has not granted documents.issue, or for a support operator, who never writes.
cadence*Every every units on anchorDay: the ISO weekday 1–7 for week; the month day 1–31 otherwise, a day a month lacks falling on its last. A year runs in the month the plan starts.
createdAt*stringdate-timeendsOn*|dateentityId*stringuuidfindings*array<>What will stop a run short: no_recipient, a send-mode plan whose customer has no Peppol endpoint, whose invoices stop at Not sent (ready).
id*stringuuidinvoiceCount*integerThe invoices this plan has made.
0 <= valuemaxRuns*|1 <= value <= 999mode*stringdraft: each run leaves a draft for a person to send. send: the run finalizes it.
"draft""send"name*stringnextAmount*Each invoice's amount, VAT included: the template's total.
nextRuns*array<>The next two run dates while the plan is active, cut at endsOn and at the invoices maxRuns leaves; none while paused or ended.
items <= 2partyId*stringThe customer: the live party the plan's runs bill, followed through a merge.
uuidpartyName*stringrevision*runsLeft*|The invoices maxRuns still leaves the plan; null when it has no maxRuns.
0 <= valueseq*integerThe plan's version, which an edit or an act carries back as expectedSeq. A run's step of the next run date never moves it.
1 <= valuestartsOn*stringdatestatus*string"active""paused""ended"template*The template each run copies, with every amount the draft's own arithmetic gives it, as decimal strings at the currency's scale: each line's net, the VAT per rate, and the totals, so the section adds up to the invoice's amount.
curl -X POST 'https://api.amanucci.com/v1/entities/497f6eca-6276-4993-bfeb-53cbbbba6f08/recurring-plans/497f6eca-6276-4993-bfeb-53cbbbba6f08/end' \
-H 'Content-Type: application/json' \
-d '{
"expectedSeq": 0
}'{
"acts": [
"edit"
],
"cadence": {
"anchorDay": 1,
"every": 1,
"unit": "week"
},
"createdAt": "2019-08-24T14:15:22Z",
"endsOn": "2019-08-24",
"entityId": "156e622c-6cdf-4c27-9bc9-2f2db69919f5",
"findings": [
{
"code": "no_recipient"
}
],
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"invoiceCount": 0,
"maxRuns": 1,
"mode": "draft",
"name": "string",
"nextAmount": {
"amount": "string",
"currency": "string"
},
"nextRuns": [
"2019-08-24"
],
"partyId": "950a3d1f-4657-4e7b-87db-3ff5fa95b5c0",
"partyName": "string",
"revision": {
"actor": {
"display": "string",
"id": "string",
"kind": "human"
},
"at": "2019-08-24T14:15:22Z",
"seq": 1,
"yours": true
},
"runsLeft": 0,
"seq": 1,
"startsOn": "2019-08-24",
"status": "active",
"template": {
"buyerReference": "string",
"currency": "str",
"deliverToCountry": "string",
"paymentTermDays": 0,
"supplyKind": "goods_dispatched",
"vatExemptionCode": "string",
"vatExemptionReason": "string",
"lineExtensionAmount": "string",
"lines": [
{
"description": "string",
"lineNo": 0,
"netAmount": "string",
"quantity": "string",
"unitPrice": "string",
"vatCategory": "string",
"vatRate": "string"
}
],
"taxAmount": "string",
"taxInclusiveAmount": "string",
"vatLines": [
{
"category": "string",
"rate": "string",
"taxableAmount": "string",
"taxAmount": "string"
}
]
}
}