@orvello/sdk 0.6.0 → 0.7.1

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/openapi.json CHANGED
@@ -8486,6 +8486,789 @@
8486
8486
  ]
8487
8487
  }
8488
8488
  },
8489
+ "/invoices/external/preview": {
8490
+ "post": {
8491
+ "operationId": "invoices_preview_external",
8492
+ "tags": [
8493
+ "invoices-external"
8494
+ ],
8495
+ "summary": "Calculate net, VAT and gross using current accounting facts",
8496
+ "description": "Same calculation as invoice creation. Accepts exactly one net or gross unit price. Gross prices keep the agreed EUR total. No invoice or payment is created. The quote is a dated observation; creation revalidates quoteHash and quoteVersion. Missing tax facts fail closed.",
8497
+ "responses": {
8498
+ "200": {
8499
+ "description": "JSON response",
8500
+ "content": {
8501
+ "application/json": {
8502
+ "schema": {
8503
+ "type": "object",
8504
+ "properties": {
8505
+ "success": {
8506
+ "type": "boolean"
8507
+ },
8508
+ "message": {
8509
+ "anyOf": [
8510
+ {
8511
+ "type": "string"
8512
+ },
8513
+ {
8514
+ "type": "null"
8515
+ }
8516
+ ]
8517
+ },
8518
+ "code": {
8519
+ "anyOf": [
8520
+ {
8521
+ "type": "string"
8522
+ },
8523
+ {
8524
+ "type": "null"
8525
+ }
8526
+ ]
8527
+ },
8528
+ "data": {
8529
+ "anyOf": [
8530
+ {
8531
+ "type": "object",
8532
+ "properties": {
8533
+ "quoteVersion": {
8534
+ "type": "string"
8535
+ },
8536
+ "quoteHash": {
8537
+ "type": "string"
8538
+ },
8539
+ "computedAt": {
8540
+ "type": "string"
8541
+ },
8542
+ "totals": {
8543
+ "type": "object",
8544
+ "properties": {
8545
+ "net": {
8546
+ "type": "string",
8547
+ "pattern": "^\\d+\\.\\d{2}$"
8548
+ },
8549
+ "tax": {
8550
+ "type": "string",
8551
+ "pattern": "^\\d+\\.\\d{2}$"
8552
+ },
8553
+ "gross": {
8554
+ "type": "string",
8555
+ "pattern": "^\\d+\\.\\d{2}$"
8556
+ },
8557
+ "currency": {
8558
+ "type": "string"
8559
+ }
8560
+ },
8561
+ "required": [
8562
+ "net",
8563
+ "tax",
8564
+ "gross",
8565
+ "currency"
8566
+ ],
8567
+ "additionalProperties": false
8568
+ },
8569
+ "vat": {
8570
+ "type": "object",
8571
+ "properties": {
8572
+ "requestedProductType": {
8573
+ "type": "string",
8574
+ "enum": [
8575
+ "standard",
8576
+ "reduced",
8577
+ "custom"
8578
+ ]
8579
+ },
8580
+ "effectiveTreatment": {
8581
+ "type": "string"
8582
+ },
8583
+ "effectiveRate": {
8584
+ "type": "number"
8585
+ },
8586
+ "legalReference": {
8587
+ "anyOf": [
8588
+ {
8589
+ "type": "string"
8590
+ },
8591
+ {
8592
+ "type": "null"
8593
+ }
8594
+ ]
8595
+ },
8596
+ "note": {
8597
+ "anyOf": [
8598
+ {
8599
+ "type": "string"
8600
+ },
8601
+ {
8602
+ "type": "null"
8603
+ }
8604
+ ]
8605
+ },
8606
+ "isMixedRates": {
8607
+ "type": "boolean"
8608
+ }
8609
+ },
8610
+ "required": [
8611
+ "requestedProductType",
8612
+ "effectiveTreatment",
8613
+ "effectiveRate",
8614
+ "legalReference",
8615
+ "note",
8616
+ "isMixedRates"
8617
+ ],
8618
+ "additionalProperties": false
8619
+ },
8620
+ "lineItems": {
8621
+ "type": "array",
8622
+ "items": {
8623
+ "type": "object",
8624
+ "properties": {
8625
+ "index": {
8626
+ "type": "integer"
8627
+ },
8628
+ "title": {
8629
+ "type": "string"
8630
+ },
8631
+ "quantity": {
8632
+ "type": "number"
8633
+ },
8634
+ "unitPriceNet": {
8635
+ "type": "string"
8636
+ },
8637
+ "netAmount": {
8638
+ "type": "string",
8639
+ "pattern": "^\\d+\\.\\d{2}$"
8640
+ },
8641
+ "taxAmount": {
8642
+ "type": "string",
8643
+ "pattern": "^\\d+\\.\\d{2}$"
8644
+ },
8645
+ "grossAmount": {
8646
+ "type": "string",
8647
+ "pattern": "^\\d+\\.\\d{2}$"
8648
+ },
8649
+ "effectiveTaxRate": {
8650
+ "type": "number"
8651
+ },
8652
+ "taxSource": {
8653
+ "type": "object",
8654
+ "properties": {
8655
+ "mode": {
8656
+ "type": "string"
8657
+ },
8658
+ "reason": {
8659
+ "type": "object",
8660
+ "properties": {
8661
+ "key": {
8662
+ "type": "string"
8663
+ },
8664
+ "defaultMessage": {
8665
+ "type": "string"
8666
+ },
8667
+ "params": {
8668
+ "type": "object",
8669
+ "additionalProperties": {
8670
+ "anyOf": [
8671
+ {
8672
+ "type": "string"
8673
+ },
8674
+ {
8675
+ "type": "number"
8676
+ },
8677
+ {
8678
+ "type": "boolean"
8679
+ },
8680
+ {
8681
+ "type": "null"
8682
+ }
8683
+ ]
8684
+ }
8685
+ }
8686
+ },
8687
+ "required": [
8688
+ "key",
8689
+ "defaultMessage"
8690
+ ],
8691
+ "additionalProperties": false
8692
+ }
8693
+ },
8694
+ "required": [
8695
+ "mode",
8696
+ "reason"
8697
+ ],
8698
+ "additionalProperties": false
8699
+ }
8700
+ },
8701
+ "required": [
8702
+ "index",
8703
+ "title",
8704
+ "quantity",
8705
+ "unitPriceNet",
8706
+ "netAmount",
8707
+ "taxAmount",
8708
+ "grossAmount",
8709
+ "effectiveTaxRate",
8710
+ "taxSource"
8711
+ ],
8712
+ "additionalProperties": false
8713
+ }
8714
+ },
8715
+ "warnings": {
8716
+ "type": "array",
8717
+ "items": {
8718
+ "type": "object",
8719
+ "properties": {
8720
+ "code": {
8721
+ "type": "string"
8722
+ },
8723
+ "severity": {
8724
+ "type": "string",
8725
+ "enum": [
8726
+ "info",
8727
+ "warning",
8728
+ "critical"
8729
+ ]
8730
+ },
8731
+ "title": {
8732
+ "type": "object",
8733
+ "properties": {
8734
+ "key": {
8735
+ "type": "string"
8736
+ },
8737
+ "defaultMessage": {
8738
+ "type": "string"
8739
+ },
8740
+ "params": {
8741
+ "type": "object",
8742
+ "additionalProperties": {
8743
+ "anyOf": [
8744
+ {
8745
+ "type": "string"
8746
+ },
8747
+ {
8748
+ "type": "number"
8749
+ },
8750
+ {
8751
+ "type": "boolean"
8752
+ },
8753
+ {
8754
+ "type": "null"
8755
+ }
8756
+ ]
8757
+ }
8758
+ }
8759
+ },
8760
+ "required": [
8761
+ "key",
8762
+ "defaultMessage"
8763
+ ],
8764
+ "additionalProperties": false
8765
+ },
8766
+ "message": {
8767
+ "type": "object",
8768
+ "properties": {
8769
+ "key": {
8770
+ "type": "string"
8771
+ },
8772
+ "defaultMessage": {
8773
+ "type": "string"
8774
+ },
8775
+ "params": {
8776
+ "type": "object",
8777
+ "additionalProperties": {
8778
+ "anyOf": [
8779
+ {
8780
+ "type": "string"
8781
+ },
8782
+ {
8783
+ "type": "number"
8784
+ },
8785
+ {
8786
+ "type": "boolean"
8787
+ },
8788
+ {
8789
+ "type": "null"
8790
+ }
8791
+ ]
8792
+ }
8793
+ }
8794
+ },
8795
+ "required": [
8796
+ "key",
8797
+ "defaultMessage"
8798
+ ],
8799
+ "additionalProperties": false
8800
+ },
8801
+ "recommendation": {
8802
+ "anyOf": [
8803
+ {
8804
+ "type": "object",
8805
+ "properties": {
8806
+ "key": {
8807
+ "type": "string"
8808
+ },
8809
+ "defaultMessage": {
8810
+ "type": "string"
8811
+ },
8812
+ "params": {
8813
+ "type": "object",
8814
+ "additionalProperties": {
8815
+ "anyOf": [
8816
+ {
8817
+ "type": "string"
8818
+ },
8819
+ {
8820
+ "type": "number"
8821
+ },
8822
+ {
8823
+ "type": "boolean"
8824
+ },
8825
+ {
8826
+ "type": "null"
8827
+ }
8828
+ ]
8829
+ }
8830
+ }
8831
+ },
8832
+ "required": [
8833
+ "key",
8834
+ "defaultMessage"
8835
+ ],
8836
+ "additionalProperties": false
8837
+ },
8838
+ {
8839
+ "type": "null"
8840
+ }
8841
+ ]
8842
+ }
8843
+ },
8844
+ "required": [
8845
+ "code",
8846
+ "severity",
8847
+ "title",
8848
+ "message"
8849
+ ],
8850
+ "additionalProperties": false
8851
+ }
8852
+ }
8853
+ },
8854
+ "required": [
8855
+ "quoteVersion",
8856
+ "quoteHash",
8857
+ "computedAt",
8858
+ "totals",
8859
+ "vat",
8860
+ "lineItems",
8861
+ "warnings"
8862
+ ],
8863
+ "additionalProperties": false
8864
+ },
8865
+ {
8866
+ "type": "null"
8867
+ }
8868
+ ]
8869
+ }
8870
+ },
8871
+ "required": [
8872
+ "success",
8873
+ "data"
8874
+ ],
8875
+ "additionalProperties": false
8876
+ }
8877
+ }
8878
+ }
8879
+ }
8880
+ },
8881
+ "requestBody": {
8882
+ "required": true,
8883
+ "content": {
8884
+ "application/json": {
8885
+ "schema": {
8886
+ "type": "object",
8887
+ "properties": {
8888
+ "idempotencyKey": {
8889
+ "type": "string",
8890
+ "minLength": 1,
8891
+ "maxLength": 200,
8892
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
8893
+ },
8894
+ "companyId": {
8895
+ "anyOf": [
8896
+ {
8897
+ "type": "integer",
8898
+ "exclusiveMinimum": 0
8899
+ },
8900
+ {
8901
+ "type": "null"
8902
+ }
8903
+ ]
8904
+ },
8905
+ "costCenterId": {
8906
+ "anyOf": [
8907
+ {
8908
+ "type": "integer",
8909
+ "exclusiveMinimum": 0
8910
+ },
8911
+ {
8912
+ "type": "null"
8913
+ }
8914
+ ]
8915
+ },
8916
+ "paymentAccountId": {
8917
+ "anyOf": [
8918
+ {
8919
+ "type": "integer",
8920
+ "exclusiveMinimum": 0
8921
+ },
8922
+ {
8923
+ "type": "null"
8924
+ }
8925
+ ]
8926
+ },
8927
+ "bankFallbackAccountId": {
8928
+ "anyOf": [
8929
+ {
8930
+ "type": "integer",
8931
+ "exclusiveMinimum": 0
8932
+ },
8933
+ {
8934
+ "type": "null"
8935
+ }
8936
+ ]
8937
+ },
8938
+ "customerName": {
8939
+ "anyOf": [
8940
+ {
8941
+ "type": "string",
8942
+ "minLength": 1
8943
+ },
8944
+ {
8945
+ "type": "null"
8946
+ }
8947
+ ]
8948
+ },
8949
+ "customerStreet": {
8950
+ "anyOf": [
8951
+ {
8952
+ "type": "string"
8953
+ },
8954
+ {
8955
+ "type": "null"
8956
+ }
8957
+ ]
8958
+ },
8959
+ "customerStreetNr": {
8960
+ "anyOf": [
8961
+ {
8962
+ "type": "string"
8963
+ },
8964
+ {
8965
+ "type": "null"
8966
+ }
8967
+ ]
8968
+ },
8969
+ "customerZip": {
8970
+ "anyOf": [
8971
+ {
8972
+ "type": "string"
8973
+ },
8974
+ {
8975
+ "type": "null"
8976
+ }
8977
+ ]
8978
+ },
8979
+ "customerCity": {
8980
+ "anyOf": [
8981
+ {
8982
+ "type": "string"
8983
+ },
8984
+ {
8985
+ "type": "null"
8986
+ }
8987
+ ]
8988
+ },
8989
+ "customerCountry": {
8990
+ "anyOf": [
8991
+ {
8992
+ "type": "string"
8993
+ },
8994
+ {
8995
+ "type": "null"
8996
+ }
8997
+ ]
8998
+ },
8999
+ "customerEmail": {
9000
+ "anyOf": [
9001
+ {
9002
+ "type": "string"
9003
+ },
9004
+ {
9005
+ "type": "null"
9006
+ }
9007
+ ]
9008
+ },
9009
+ "customerPhone": {
9010
+ "anyOf": [
9011
+ {
9012
+ "type": "string"
9013
+ },
9014
+ {
9015
+ "type": "null"
9016
+ }
9017
+ ]
9018
+ },
9019
+ "customerUstId": {
9020
+ "anyOf": [
9021
+ {
9022
+ "type": "string"
9023
+ },
9024
+ {
9025
+ "type": "null"
9026
+ }
9027
+ ]
9028
+ },
9029
+ "invoiceDate": {
9030
+ "type": "string",
9031
+ "minLength": 1
9032
+ },
9033
+ "dueDate": {
9034
+ "type": "string",
9035
+ "minLength": 1
9036
+ },
9037
+ "performedAt": {
9038
+ "anyOf": [
9039
+ {
9040
+ "type": "string"
9041
+ },
9042
+ {
9043
+ "type": "null"
9044
+ }
9045
+ ]
9046
+ },
9047
+ "currency": {
9048
+ "type": "string",
9049
+ "minLength": 3,
9050
+ "maxLength": 3
9051
+ },
9052
+ "notes": {
9053
+ "anyOf": [
9054
+ {
9055
+ "type": "string"
9056
+ },
9057
+ {
9058
+ "type": "null"
9059
+ }
9060
+ ]
9061
+ },
9062
+ "paymentTermsDays": {
9063
+ "anyOf": [
9064
+ {
9065
+ "type": "integer",
9066
+ "exclusiveMinimum": 0,
9067
+ "maximum": 365
9068
+ },
9069
+ {
9070
+ "type": "null"
9071
+ }
9072
+ ]
9073
+ },
9074
+ "paymentTermsText": {
9075
+ "anyOf": [
9076
+ {
9077
+ "type": "string",
9078
+ "maxLength": 500
9079
+ },
9080
+ {
9081
+ "type": "null"
9082
+ }
9083
+ ]
9084
+ },
9085
+ "earlyPaymentDiscountPercent": {
9086
+ "anyOf": [
9087
+ {
9088
+ "type": "number",
9089
+ "minimum": 0,
9090
+ "maximum": 100
9091
+ },
9092
+ {
9093
+ "type": "null"
9094
+ }
9095
+ ]
9096
+ },
9097
+ "earlyPaymentDiscountDays": {
9098
+ "anyOf": [
9099
+ {
9100
+ "type": "integer",
9101
+ "exclusiveMinimum": 0,
9102
+ "maximum": 365
9103
+ },
9104
+ {
9105
+ "type": "null"
9106
+ }
9107
+ ]
9108
+ },
9109
+ "paymentMethod": {
9110
+ "anyOf": [
9111
+ {
9112
+ "type": "string",
9113
+ "maxLength": 50
9114
+ },
9115
+ {
9116
+ "type": "null"
9117
+ }
9118
+ ]
9119
+ },
9120
+ "paymentProvider": {
9121
+ "anyOf": [
9122
+ {
9123
+ "type": "string",
9124
+ "maxLength": 50
9125
+ },
9126
+ {
9127
+ "type": "null"
9128
+ }
9129
+ ]
9130
+ },
9131
+ "paidAt": {
9132
+ "anyOf": [
9133
+ {
9134
+ "type": "string",
9135
+ "format": "date-time"
9136
+ },
9137
+ {
9138
+ "type": "null"
9139
+ }
9140
+ ]
9141
+ },
9142
+ "productType": {
9143
+ "type": "string",
9144
+ "enum": [
9145
+ "standard",
9146
+ "reduced",
9147
+ "custom"
9148
+ ]
9149
+ },
9150
+ "customVatRate": {
9151
+ "type": "number",
9152
+ "minimum": 0,
9153
+ "maximum": 1
9154
+ },
9155
+ "vatOverrideReason": {
9156
+ "type": "string",
9157
+ "maxLength": 500
9158
+ },
9159
+ "lineItems": {
9160
+ "type": "array",
9161
+ "items": {
9162
+ "type": "object",
9163
+ "properties": {
9164
+ "title": {
9165
+ "type": "string",
9166
+ "minLength": 1
9167
+ },
9168
+ "description": {
9169
+ "anyOf": [
9170
+ {
9171
+ "type": "string"
9172
+ },
9173
+ {
9174
+ "type": "null"
9175
+ }
9176
+ ]
9177
+ },
9178
+ "quantity": {
9179
+ "type": "number",
9180
+ "exclusiveMinimum": 0
9181
+ },
9182
+ "unitPriceNet": {
9183
+ "type": "string",
9184
+ "minLength": 1
9185
+ },
9186
+ "unitPriceGross": {
9187
+ "type": "string",
9188
+ "pattern": "^(0|[1-9]\\d{0,9})\\.\\d{2}$"
9189
+ },
9190
+ "itemType": {
9191
+ "anyOf": [
9192
+ {
9193
+ "type": "string"
9194
+ },
9195
+ {
9196
+ "type": "null"
9197
+ }
9198
+ ]
9199
+ },
9200
+ "sortOrder": {
9201
+ "type": "integer"
9202
+ },
9203
+ "productType": {
9204
+ "type": "string",
9205
+ "enum": [
9206
+ "standard",
9207
+ "reduced",
9208
+ "custom"
9209
+ ]
9210
+ },
9211
+ "taxRate": {
9212
+ "type": "number",
9213
+ "minimum": 0,
9214
+ "maximum": 1
9215
+ }
9216
+ },
9217
+ "required": [
9218
+ "title",
9219
+ "quantity"
9220
+ ],
9221
+ "additionalProperties": false
9222
+ }
9223
+ },
9224
+ "language": {
9225
+ "type": "string"
9226
+ },
9227
+ "issueImmediately": {
9228
+ "type": "boolean"
9229
+ },
9230
+ "generatePdf": {
9231
+ "type": "boolean"
9232
+ },
9233
+ "quoteHash": {
9234
+ "type": "string",
9235
+ "pattern": "^[a-fA-F0-9]{64}$"
9236
+ },
9237
+ "quoteVersion": {
9238
+ "type": "string",
9239
+ "maxLength": 32
9240
+ }
9241
+ },
9242
+ "required": [
9243
+ "invoiceDate",
9244
+ "dueDate",
9245
+ "currency",
9246
+ "lineItems"
9247
+ ],
9248
+ "additionalProperties": false
9249
+ }
9250
+ }
9251
+ }
9252
+ },
9253
+ "security": [
9254
+ {
9255
+ "oauth2Bearer": []
9256
+ },
9257
+ {
9258
+ "companyApiKeyBearer": []
9259
+ }
9260
+ ],
9261
+ "x-auth": {
9262
+ "allowOAuth2": true,
9263
+ "allowApiKey": true,
9264
+ "allowUserSession": false,
9265
+ "requireRole": "viewer"
9266
+ },
9267
+ "x-scopes": [
9268
+ "invoices:read"
9269
+ ]
9270
+ }
9271
+ },
8489
9272
  "/invoices/external/:invoiceId/payment-events": {
8490
9273
  "get": {
8491
9274
  "operationId": "invoices_payment_events_external",
@@ -9756,6 +10539,10 @@
9756
10539
  "type": "string",
9757
10540
  "minLength": 1
9758
10541
  },
10542
+ "unitPriceGross": {
10543
+ "type": "string",
10544
+ "pattern": "^(0|[1-9]\\d{0,9})\\.\\d{2}$"
10545
+ },
9759
10546
  "itemType": {
9760
10547
  "anyOf": [
9761
10548
  {
@@ -9785,8 +10572,7 @@
9785
10572
  },
9786
10573
  "required": [
9787
10574
  "title",
9788
- "quantity",
9789
- "unitPriceNet"
10575
+ "quantity"
9790
10576
  ],
9791
10577
  "additionalProperties": false
9792
10578
  }