@orvello/sdk 0.7.4 → 0.7.5
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/CONTRACT_SHA256 +1 -1
- package/dist/contract.cjs +15 -1
- package/dist/contract.cjs.map +1 -1
- package/dist/contract.d.cts +121 -6
- package/dist/contract.d.ts +121 -6
- package/dist/contract.js +15 -1
- package/dist/contract.js.map +1 -1
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/openapi.json +250 -3
- package/package.json +1 -1
package/dist/openapi.json
CHANGED
|
@@ -32637,6 +32637,15 @@
|
|
|
32637
32637
|
"feeVatRate": {
|
|
32638
32638
|
"type": "string",
|
|
32639
32639
|
"pattern": "^\\d+(\\.\\d{1,4})?$"
|
|
32640
|
+
},
|
|
32641
|
+
"provider": {
|
|
32642
|
+
"type": "string",
|
|
32643
|
+
"enum": [
|
|
32644
|
+
"sumup",
|
|
32645
|
+
"paypal",
|
|
32646
|
+
"stripe",
|
|
32647
|
+
"klarna"
|
|
32648
|
+
]
|
|
32640
32649
|
}
|
|
32641
32650
|
},
|
|
32642
32651
|
"required": [
|
|
@@ -33386,7 +33395,7 @@
|
|
|
33386
33395
|
"payments-external"
|
|
33387
33396
|
],
|
|
33388
33397
|
"summary": "Settle invoice via external API",
|
|
33389
|
-
"description": "One-shot settlement for shop/payment-provider flows:
|
|
33398
|
+
"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.",
|
|
33390
33399
|
"responses": {
|
|
33391
33400
|
"200": {
|
|
33392
33401
|
"description": "JSON response",
|
|
@@ -33504,6 +33513,10 @@
|
|
|
33504
33513
|
"type": "string",
|
|
33505
33514
|
"minLength": 1
|
|
33506
33515
|
},
|
|
33516
|
+
"paidAt": {
|
|
33517
|
+
"type": "string",
|
|
33518
|
+
"minLength": 1
|
|
33519
|
+
},
|
|
33507
33520
|
"valueAt": {
|
|
33508
33521
|
"type": "string"
|
|
33509
33522
|
},
|
|
@@ -33517,6 +33530,54 @@
|
|
|
33517
33530
|
}
|
|
33518
33531
|
]
|
|
33519
33532
|
},
|
|
33533
|
+
"grossAmount": {
|
|
33534
|
+
"anyOf": [
|
|
33535
|
+
{
|
|
33536
|
+
"type": "string"
|
|
33537
|
+
},
|
|
33538
|
+
{
|
|
33539
|
+
"type": "number"
|
|
33540
|
+
}
|
|
33541
|
+
]
|
|
33542
|
+
},
|
|
33543
|
+
"feeAmount": {
|
|
33544
|
+
"anyOf": [
|
|
33545
|
+
{
|
|
33546
|
+
"type": "string"
|
|
33547
|
+
},
|
|
33548
|
+
{
|
|
33549
|
+
"type": "number"
|
|
33550
|
+
}
|
|
33551
|
+
]
|
|
33552
|
+
},
|
|
33553
|
+
"feeProvider": {
|
|
33554
|
+
"type": "string",
|
|
33555
|
+
"enum": [
|
|
33556
|
+
"sumup",
|
|
33557
|
+
"paypal",
|
|
33558
|
+
"stripe",
|
|
33559
|
+
"klarna"
|
|
33560
|
+
]
|
|
33561
|
+
},
|
|
33562
|
+
"feeReference": {
|
|
33563
|
+
"type": "string",
|
|
33564
|
+
"maxLength": 200
|
|
33565
|
+
},
|
|
33566
|
+
"originalAmount": {
|
|
33567
|
+
"anyOf": [
|
|
33568
|
+
{
|
|
33569
|
+
"type": "string"
|
|
33570
|
+
},
|
|
33571
|
+
{
|
|
33572
|
+
"type": "number"
|
|
33573
|
+
}
|
|
33574
|
+
]
|
|
33575
|
+
},
|
|
33576
|
+
"originalCurrency": {
|
|
33577
|
+
"type": "string",
|
|
33578
|
+
"minLength": 3,
|
|
33579
|
+
"maxLength": 3
|
|
33580
|
+
},
|
|
33520
33581
|
"currency": {
|
|
33521
33582
|
"type": "string",
|
|
33522
33583
|
"minLength": 3,
|
|
@@ -33561,11 +33622,197 @@
|
|
|
33561
33622
|
},
|
|
33562
33623
|
"raw": {}
|
|
33563
33624
|
},
|
|
33625
|
+
"required": [
|
|
33626
|
+
"invoiceId",
|
|
33627
|
+
"paymentAccountId"
|
|
33628
|
+
],
|
|
33629
|
+
"additionalProperties": false
|
|
33630
|
+
}
|
|
33631
|
+
}
|
|
33632
|
+
}
|
|
33633
|
+
},
|
|
33634
|
+
"security": [
|
|
33635
|
+
{
|
|
33636
|
+
"oauth2Bearer": []
|
|
33637
|
+
},
|
|
33638
|
+
{
|
|
33639
|
+
"companyApiKeyBearer": []
|
|
33640
|
+
}
|
|
33641
|
+
],
|
|
33642
|
+
"x-auth": {
|
|
33643
|
+
"allowOAuth2": true,
|
|
33644
|
+
"allowApiKey": true,
|
|
33645
|
+
"allowUserSession": false,
|
|
33646
|
+
"requireRole": "editor"
|
|
33647
|
+
},
|
|
33648
|
+
"x-scopes": [
|
|
33649
|
+
"payments:write",
|
|
33650
|
+
"invoices:write"
|
|
33651
|
+
]
|
|
33652
|
+
}
|
|
33653
|
+
},
|
|
33654
|
+
"/bookkeeping/payments/external/settle-invoice/fee-correction": {
|
|
33655
|
+
"post": {
|
|
33656
|
+
"operationId": "bookkeeping_payments_settlement_fee_correction_external",
|
|
33657
|
+
"tags": [
|
|
33658
|
+
"bookkeeping",
|
|
33659
|
+
"payments-external"
|
|
33660
|
+
],
|
|
33661
|
+
"summary": "Correct the provider fee of an external settlement",
|
|
33662
|
+
"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.",
|
|
33663
|
+
"responses": {
|
|
33664
|
+
"200": {
|
|
33665
|
+
"description": "JSON response",
|
|
33666
|
+
"content": {
|
|
33667
|
+
"application/json": {
|
|
33668
|
+
"schema": {
|
|
33669
|
+
"type": "object",
|
|
33670
|
+
"properties": {
|
|
33671
|
+
"success": {
|
|
33672
|
+
"type": "boolean"
|
|
33673
|
+
},
|
|
33674
|
+
"message": {
|
|
33675
|
+
"anyOf": [
|
|
33676
|
+
{
|
|
33677
|
+
"type": "string"
|
|
33678
|
+
},
|
|
33679
|
+
{
|
|
33680
|
+
"type": "null"
|
|
33681
|
+
}
|
|
33682
|
+
]
|
|
33683
|
+
},
|
|
33684
|
+
"code": {
|
|
33685
|
+
"anyOf": [
|
|
33686
|
+
{
|
|
33687
|
+
"type": "string"
|
|
33688
|
+
},
|
|
33689
|
+
{
|
|
33690
|
+
"type": "null"
|
|
33691
|
+
}
|
|
33692
|
+
]
|
|
33693
|
+
},
|
|
33694
|
+
"data": {
|
|
33695
|
+
"anyOf": [
|
|
33696
|
+
{},
|
|
33697
|
+
{
|
|
33698
|
+
"type": "null"
|
|
33699
|
+
}
|
|
33700
|
+
]
|
|
33701
|
+
}
|
|
33702
|
+
},
|
|
33703
|
+
"required": [
|
|
33704
|
+
"success",
|
|
33705
|
+
"data"
|
|
33706
|
+
],
|
|
33707
|
+
"additionalProperties": false
|
|
33708
|
+
}
|
|
33709
|
+
}
|
|
33710
|
+
}
|
|
33711
|
+
},
|
|
33712
|
+
"201": {
|
|
33713
|
+
"description": "JSON response",
|
|
33714
|
+
"content": {
|
|
33715
|
+
"application/json": {
|
|
33716
|
+
"schema": {
|
|
33717
|
+
"type": "object",
|
|
33718
|
+
"properties": {
|
|
33719
|
+
"success": {
|
|
33720
|
+
"type": "boolean"
|
|
33721
|
+
},
|
|
33722
|
+
"message": {
|
|
33723
|
+
"anyOf": [
|
|
33724
|
+
{
|
|
33725
|
+
"type": "string"
|
|
33726
|
+
},
|
|
33727
|
+
{
|
|
33728
|
+
"type": "null"
|
|
33729
|
+
}
|
|
33730
|
+
]
|
|
33731
|
+
},
|
|
33732
|
+
"code": {
|
|
33733
|
+
"anyOf": [
|
|
33734
|
+
{
|
|
33735
|
+
"type": "string"
|
|
33736
|
+
},
|
|
33737
|
+
{
|
|
33738
|
+
"type": "null"
|
|
33739
|
+
}
|
|
33740
|
+
]
|
|
33741
|
+
},
|
|
33742
|
+
"data": {
|
|
33743
|
+
"anyOf": [
|
|
33744
|
+
{},
|
|
33745
|
+
{
|
|
33746
|
+
"type": "null"
|
|
33747
|
+
}
|
|
33748
|
+
]
|
|
33749
|
+
}
|
|
33750
|
+
},
|
|
33751
|
+
"required": [
|
|
33752
|
+
"success",
|
|
33753
|
+
"data"
|
|
33754
|
+
],
|
|
33755
|
+
"additionalProperties": false
|
|
33756
|
+
}
|
|
33757
|
+
}
|
|
33758
|
+
}
|
|
33759
|
+
}
|
|
33760
|
+
},
|
|
33761
|
+
"requestBody": {
|
|
33762
|
+
"required": true,
|
|
33763
|
+
"content": {
|
|
33764
|
+
"application/json": {
|
|
33765
|
+
"schema": {
|
|
33766
|
+
"type": "object",
|
|
33767
|
+
"properties": {
|
|
33768
|
+
"invoiceId": {
|
|
33769
|
+
"type": "integer",
|
|
33770
|
+
"exclusiveMinimum": 0
|
|
33771
|
+
},
|
|
33772
|
+
"paymentAccountId": {
|
|
33773
|
+
"type": "integer",
|
|
33774
|
+
"exclusiveMinimum": 0
|
|
33775
|
+
},
|
|
33776
|
+
"externalRef": {
|
|
33777
|
+
"type": "string",
|
|
33778
|
+
"minLength": 3,
|
|
33779
|
+
"maxLength": 120
|
|
33780
|
+
},
|
|
33781
|
+
"feeAmount": {
|
|
33782
|
+
"anyOf": [
|
|
33783
|
+
{
|
|
33784
|
+
"type": "string"
|
|
33785
|
+
},
|
|
33786
|
+
{
|
|
33787
|
+
"type": "number"
|
|
33788
|
+
}
|
|
33789
|
+
]
|
|
33790
|
+
},
|
|
33791
|
+
"correctedAt": {
|
|
33792
|
+
"type": "string",
|
|
33793
|
+
"minLength": 1
|
|
33794
|
+
},
|
|
33795
|
+
"correctionRef": {
|
|
33796
|
+
"type": "string",
|
|
33797
|
+
"minLength": 3,
|
|
33798
|
+
"maxLength": 120
|
|
33799
|
+
},
|
|
33800
|
+
"feeReference": {
|
|
33801
|
+
"type": "string",
|
|
33802
|
+
"maxLength": 200
|
|
33803
|
+
},
|
|
33804
|
+
"reason": {
|
|
33805
|
+
"type": "string",
|
|
33806
|
+
"maxLength": 500
|
|
33807
|
+
}
|
|
33808
|
+
},
|
|
33564
33809
|
"required": [
|
|
33565
33810
|
"invoiceId",
|
|
33566
33811
|
"paymentAccountId",
|
|
33567
|
-
"
|
|
33568
|
-
"
|
|
33812
|
+
"externalRef",
|
|
33813
|
+
"feeAmount",
|
|
33814
|
+
"correctedAt",
|
|
33815
|
+
"correctionRef"
|
|
33569
33816
|
],
|
|
33570
33817
|
"additionalProperties": false
|
|
33571
33818
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orvello/sdk",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "Typed, zero-dependency SDK for integrating Node and Next.js applications with orvello - the accounting & invoicing platform. Sends the credential each route demands, and can prove a call would work without making it.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"orvello",
|