@orvello/sdk 0.7.4 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/contract.js CHANGED
@@ -2242,7 +2242,21 @@ var apiRoutes_bookkeeping = {
2242
2242
  meta: {
2243
2243
  tags: ["bookkeeping", "payments-external"],
2244
2244
  summary: "Settle invoice via external API",
2245
- description: "One-shot settlement for shop/payment-provider flows: creates payment, allocates it to the invoice, and can auto-close shortfall as discount so no manual allocation step remains.",
2245
+ description: "One-shot settlement for shop/payment-provider flows. Preferred contract: grossAmount (customer payment, settles the invoice), feeAmount + feeProvider + feeReference (provider fee, booked as expense, never as customer discount), paidAt (actual payment time) and, for a payment currency other than the invoice currency, originalAmount/originalCurrency (documented gross in invoice currency; realized FX difference is recorded). Legacy contract (payoutAmount + bookedAt, optional closeGapStrategy=discount) keeps working unchanged; existing discounts are not reinterpreted. A changed fee for an already used reference is rejected with 409: use /settle-invoice/fee-correction.",
2246
+ bodyContentType: "application/json",
2247
+ validated: { "params": false, "query": false, "body": true }
2248
+ },
2249
+ types: null
2250
+ },
2251
+ // Contract source: explicit
2252
+ "bookkeeping_payments_settlement_fee_correction_external": {
2253
+ method: "POST",
2254
+ path: "/bookkeeping/payments/external/settle-invoice/fee-correction",
2255
+ auth: { "type": "unified_bearer", "allowUserSession": false, "allowOAuth2": true, "allowApiKey": true, "requireRole": "editor", "scopes": ["payments:write", "invoices:write"] },
2256
+ meta: {
2257
+ tags: ["bookkeeping", "payments-external"],
2258
+ summary: "Correct the provider fee of an external settlement",
2259
+ description: "Later provider fee change (e.g. fee refund) on a settlement made with grossAmount/feeAmount. The original payment stays unchanged; the difference is booked on correctedAt as its own account movement with a signed fee receipt. Idempotent per correctionRef. Legacy net-payout settlements are refused (422): their fee was never documented.",
2246
2260
  bodyContentType: "application/json",
2247
2261
  validated: { "params": false, "query": false, "body": true }
2248
2262
  },
@@ -4415,7 +4429,7 @@ var apiRoutes_invoices_external = {
4415
4429
  meta: {
4416
4430
  tags: ["invoices-external"],
4417
4431
  summary: "Update invoice status (external API)",
4418
- description: "Changes invoice status (e.g., mark as paid). State machine rules are enforced server-side. GoBD-safe: issued invoices cannot be cancelled directly; use credit note/cancellation endpoints instead.",
4432
+ description: 'Changes invoice status (e.g., mark as paid). State machine rules are enforced server-side. GoBD-safe: issued invoices cannot be cancelled directly; use credit note/cancellation endpoints instead. A paid status set here is stored with paidSource "external"; the optional source (api, sync, webhook) is kept in the audit log only.',
4419
4433
  validated: { "params": true, "query": false, "body": true }
4420
4434
  },
4421
4435
  types: null
@@ -4441,7 +4455,7 @@ var apiRoutes_invoices_external = {
4441
4455
  meta: {
4442
4456
  tags: ["invoices-external"],
4443
4457
  summary: "Issue credit note (external API)",
4444
- description: "Issues a GoBD-compliant credit note or cancellation invoice. Generates PDF and creates an immutable document. Returns the new correction invoice.",
4458
+ description: "Issues a GoBD-compliant credit note or cancellation invoice. Generates PDF and creates an immutable document. Returns the new correction invoice. Optional idempotencyKey (max 200, e.g. the refund id): a retry with the same key on the same invoice returns the correction already issued (201, replayed: true) instead of booking a second one; the same key with a different body returns 409 IDEMPOTENCY_CONFLICT. Keys do not expire.",
4445
4459
  validated: { "params": true, "query": false, "body": true }
4446
4460
  },
4447
4461
  types: null
@@ -5282,6 +5296,19 @@ var apiRoutes_managing_companies = {
5282
5296
  types: null
5283
5297
  },
5284
5298
  // Contract source: explicit
5299
+ "managing_companies_transfer_owner": {
5300
+ method: "PUT",
5301
+ path: "/managing-companies/:id/owner",
5302
+ auth: { "type": "frontend_permission_http", "permission": "bookkeeping_access" },
5303
+ meta: {
5304
+ tags: ["managing-companies"],
5305
+ summary: "Besitz einer Firma uebergeben",
5306
+ description: "Uebergibt den Besitz einer Managing Company an einen anderen Admin. Die Firma zaehlt nur gegen den Plan ihres Besitzers (Firmenzahl, Rechnungen je Monat, Speicher). Nur der jetzige Besitzer (oder ein Plattform-Admin) darf uebergeben; der neue Besitzer muss unbefristeter Admin sein und Platz in seinem Plan haben (sonst 403 PLAN_LIMIT_REACHED). Fehler: 403 COMPANY_OWNERSHIP_FORBIDDEN, 404 COMPANY_NOT_FOUND, 422 COMPANY_OWNER_MUST_BE_ADMIN. Erfordert `bookkeeping_access`.",
5307
+ validated: { "params": true, "query": false, "body": true }
5308
+ },
5309
+ types: null
5310
+ },
5311
+ // Contract source: explicit
5285
5312
  "managing_companies_delete": {
5286
5313
  method: "DELETE",
5287
5314
  path: "/managing-companies/:id",