factpulse 4.4.0 → 4.5.0

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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -7
  3. data/Gemfile.lock +9 -9
  4. data/docs/Amount3.md +15 -0
  5. data/docs/ChorusProDestination.md +1 -1
  6. data/docs/ClientManagementApi.md +152 -0
  7. data/docs/CreateCDARRequest.md +5 -1
  8. data/docs/ElectronicSignatureApi.md +6 -6
  9. data/docs/EncaisseAmountByRate.md +20 -0
  10. data/docs/EncaisseeRequest.md +7 -3
  11. data/docs/FacturXConversionApi.md +2 -2
  12. data/docs/FacturXPDFXMLVerificationApi.md +4 -4
  13. data/docs/FacturXValidationApi.md +4 -4
  14. data/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +15 -0
  15. data/docs/{ChorusProCredentials.md → FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md} +2 -2
  16. data/docs/{ValidationErrorResponse.md → FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md} +2 -2
  17. data/docs/Flux10EReportingApi.md +4 -4
  18. data/docs/Flux6InvoiceLifecycleCDARApi.md +8 -4
  19. data/docs/InvoiceGenerationApi.md +4 -4
  20. data/docs/InvoiceInput.md +1 -1
  21. data/docs/LifecycleResponse.md +9 -1
  22. data/docs/ParseApi.md +4 -4
  23. data/docs/PaymentAmountByRate.md +1 -1
  24. data/docs/SubmitCDARRequest.md +4 -0
  25. data/docs/SuperPDPVatRegimeResponse.md +20 -0
  26. data/docs/SuperPDPVatRegimeUpdateRequest.md +20 -0
  27. data/docs/ValidateCDARRequest.md +3 -1
  28. data/docs/ValidationApi.md +3 -3
  29. data/docs/ValidationError.md +5 -1
  30. data/lib/factpulse/api/client_management_api.rb +137 -0
  31. data/lib/factpulse/api/electronic_signature_api.rb +6 -6
  32. data/lib/factpulse/api/factur_x_conversion_api.rb +2 -2
  33. data/lib/factpulse/api/factur_x_validation_api.rb +4 -4
  34. data/lib/factpulse/api/factur_xpdfxml_verification_api.rb +4 -4
  35. data/lib/factpulse/api/flux10_e_reporting_api.rb +4 -4
  36. data/lib/factpulse/api/flux6_invoice_lifecycle_cdar_api.rb +10 -4
  37. data/lib/factpulse/api/invoice_generation_api.rb +2 -2
  38. data/lib/factpulse/api/parse_api.rb +4 -4
  39. data/lib/factpulse/api/validation_api.rb +4 -4
  40. data/lib/factpulse/models/amount1.rb +1 -1
  41. data/lib/factpulse/models/amount2.rb +1 -1
  42. data/lib/factpulse/models/amount3.rb +104 -0
  43. data/lib/factpulse/models/chorus_pro_destination.rb +1 -1
  44. data/lib/factpulse/models/create_cdar_request.rb +56 -4
  45. data/lib/factpulse/models/encaisse_amount_by_rate.rb +192 -0
  46. data/lib/factpulse/models/encaisseamount.rb +1 -1
  47. data/lib/factpulse/models/encaissee_request.rb +43 -24
  48. data/lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb +43 -0
  49. data/lib/factpulse/models/{chorus_pro_credentials.rb → facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb} +3 -3
  50. data/lib/factpulse/models/{validation_error_response.rb → facture_electronique_rest_api_schemas_validation_validation_error_response.rb} +3 -3
  51. data/lib/factpulse/models/invoice_input.rb +1 -1
  52. data/lib/factpulse/models/invoice_type_code.rb +17 -6
  53. data/lib/factpulse/models/lifecycle_response.rb +48 -4
  54. data/lib/factpulse/models/payment_amount_by_rate.rb +1 -1
  55. data/lib/factpulse/models/payment_means.rb +2 -1
  56. data/lib/factpulse/models/submit_cdar_request.rb +53 -1
  57. data/lib/factpulse/models/super_pdp_vat_regime_response.rb +195 -0
  58. data/lib/factpulse/models/super_pdp_vat_regime_update_request.rb +200 -0
  59. data/lib/factpulse/models/validate_cdar_request.rb +17 -5
  60. data/lib/factpulse/models/validation_error.rb +23 -4
  61. data/lib/factpulse/version.rb +1 -1
  62. data/lib/factpulse.rb +7 -2
  63. metadata +16 -6
@@ -65,6 +65,10 @@ module FactPulse
65
65
  # Taux de TVA du montant encaissé en % (MDT-224, requis par BR-FR-CDV-14 pour le statut 212 ; défaut 20)
66
66
  attr_accessor :encaisse_vat_rate
67
67
 
68
+ attr_accessor :encaisse_amounts_by_rate
69
+
70
+ attr_accessor :comment
71
+
68
72
  # Type de flux AFNOR (CustomerInvoiceLC, SupplierInvoiceLC, etc.)
69
73
  attr_accessor :flow_type
70
74
 
@@ -98,6 +102,8 @@ module FactPulse
98
102
  :'action_code' => :'actionCode',
99
103
  :'encaisse_amount' => :'encaisseAmount',
100
104
  :'encaisse_vat_rate' => :'encaisseVatRate',
105
+ :'encaisse_amounts_by_rate' => :'encaisseAmountsByRate',
106
+ :'comment' => :'comment',
101
107
  :'flow_type' => :'flowType',
102
108
  :'pdp_flow_service_url' => :'pdpFlowServiceUrl',
103
109
  :'pdp_token_url' => :'pdpTokenUrl',
@@ -138,6 +144,8 @@ module FactPulse
138
144
  :'action_code' => :'String',
139
145
  :'encaisse_amount' => :'Encaisseamount',
140
146
  :'encaisse_vat_rate' => :'Float',
147
+ :'encaisse_amounts_by_rate' => :'Array<EncaisseAmountByRate>',
148
+ :'comment' => :'String',
141
149
  :'flow_type' => :'String',
142
150
  :'pdp_flow_service_url' => :'String',
143
151
  :'pdp_token_url' => :'String',
@@ -157,6 +165,8 @@ module FactPulse
157
165
  :'reason_text',
158
166
  :'action_code',
159
167
  :'encaisse_amount',
168
+ :'encaisse_amounts_by_rate',
169
+ :'comment',
160
170
  :'pdp_flow_service_url',
161
171
  :'pdp_token_url',
162
172
  :'pdp_client_id',
@@ -278,6 +288,16 @@ module FactPulse
278
288
  self.encaisse_vat_rate = 20
279
289
  end
280
290
 
291
+ if attributes.key?(:'encaisse_amounts_by_rate')
292
+ if (value = attributes[:'encaisse_amounts_by_rate']).is_a?(Array)
293
+ self.encaisse_amounts_by_rate = value
294
+ end
295
+ end
296
+
297
+ if attributes.key?(:'comment')
298
+ self.comment = attributes[:'comment']
299
+ end
300
+
281
301
  if attributes.key?(:'flow_type')
282
302
  self.flow_type = attributes[:'flow_type']
283
303
  else
@@ -326,6 +346,14 @@ module FactPulse
326
346
  invalid_properties.push('invalid value for "status", status cannot be nil.')
327
347
  end
328
348
 
349
+ if !@encaisse_amounts_by_rate.nil? && @encaisse_amounts_by_rate.length < 1
350
+ invalid_properties.push('invalid value for "encaisse_amounts_by_rate", number of items must be greater than or equal to 1.')
351
+ end
352
+
353
+ if !@comment.nil? && @comment.to_s.length > 2000
354
+ invalid_properties.push('invalid value for "comment", the character length must be smaller than or equal to 2000.')
355
+ end
356
+
329
357
  invalid_properties
330
358
  end
331
359
 
@@ -338,6 +366,8 @@ module FactPulse
338
366
  return false if @invoice_id.nil?
339
367
  return false if @invoice_issue_date.nil?
340
368
  return false if @status.nil?
369
+ return false if !@encaisse_amounts_by_rate.nil? && @encaisse_amounts_by_rate.length < 1
370
+ return false if !@comment.nil? && @comment.to_s.length > 2000
341
371
  true
342
372
  end
343
373
 
@@ -391,6 +421,26 @@ module FactPulse
391
421
  @status = status
392
422
  end
393
423
 
424
+ # Custom attribute writer method with validation
425
+ # @param [Object] encaisse_amounts_by_rate Value to be assigned
426
+ def encaisse_amounts_by_rate=(encaisse_amounts_by_rate)
427
+ if !encaisse_amounts_by_rate.nil? && encaisse_amounts_by_rate.length < 1
428
+ fail ArgumentError, 'invalid value for "encaisse_amounts_by_rate", number of items must be greater than or equal to 1.'
429
+ end
430
+
431
+ @encaisse_amounts_by_rate = encaisse_amounts_by_rate
432
+ end
433
+
434
+ # Custom attribute writer method with validation
435
+ # @param [Object] comment Value to be assigned
436
+ def comment=(comment)
437
+ if !comment.nil? && comment.to_s.length > 2000
438
+ fail ArgumentError, 'invalid value for "comment", the character length must be smaller than or equal to 2000.'
439
+ end
440
+
441
+ @comment = comment
442
+ end
443
+
394
444
  # Checks equality by comparing each attribute.
395
445
  # @param [Object] Object to be compared
396
446
  def ==(o)
@@ -415,6 +465,8 @@ module FactPulse
415
465
  action_code == o.action_code &&
416
466
  encaisse_amount == o.encaisse_amount &&
417
467
  encaisse_vat_rate == o.encaisse_vat_rate &&
468
+ encaisse_amounts_by_rate == o.encaisse_amounts_by_rate &&
469
+ comment == o.comment &&
418
470
  flow_type == o.flow_type &&
419
471
  pdp_flow_service_url == o.pdp_flow_service_url &&
420
472
  pdp_token_url == o.pdp_token_url &&
@@ -431,7 +483,7 @@ module FactPulse
431
483
  # Calculates hash code according to all attributes.
432
484
  # @return [Integer] Hash code
433
485
  def hash
434
- [document_id, business_process, type_code, sender_siren, sender_role, sender_name, sender_email, recipients, invoice_id, invoice_issue_date, invoice_type_code, invoice_seller_siren, invoice_buyer_siren, status, reason_code, reason_text, action_code, encaisse_amount, encaisse_vat_rate, flow_type, pdp_flow_service_url, pdp_token_url, pdp_client_id, pdp_client_secret].hash
486
+ [document_id, business_process, type_code, sender_siren, sender_role, sender_name, sender_email, recipients, invoice_id, invoice_issue_date, invoice_type_code, invoice_seller_siren, invoice_buyer_siren, status, reason_code, reason_text, action_code, encaisse_amount, encaisse_vat_rate, encaisse_amounts_by_rate, comment, flow_type, pdp_flow_service_url, pdp_token_url, pdp_client_id, pdp_client_secret].hash
435
487
  end
436
488
 
437
489
  # Builds the object from hash
@@ -0,0 +1,195 @@
1
+ =begin
2
+ #FactPulse REST API
3
+
4
+ # REST API for electronic invoicing in France: Factur-X (CII), UBL 2.1, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Invoice Generation - **Formats**: CII XML, UBL 2.1 XML, or Factur-X PDF/A-3 - **Profiles** (CII/PDF): MINIMUM, BASIC, EN16931, EXTENDED - **UBL**: Always EN16931 compliant - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT), UBL 2.1 (OASIS) - **Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Factur-X - Validation - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) ### ✍️ Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification ### 📋 Flux 6 - Invoice Lifecycle (CDAR) - **CDAR Messages**: Acknowledgements, invoice statuses - **PPF Statuses**: REFUSED (210), PAID (212) ### 📊 Flux 10 - E-Reporting - **Tax Declarations**: International B2B, B2C - **Flow Types**: 10.1 (B2B transactions), 10.2 (B2B payments), 10.3 (B2C transactions), 10.4 (B2C payments) ### 📡 AFNOR PDP/PA (XP Z12-013) - **Flow Service**: Submit and search flows to PDPs - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user ### 🏛️ Chorus Pro - **Public Sector Invoicing**: Complete API for Chorus Pro ### ⏳ Async Tasks - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **Webhooks**: Automatic notifications when tasks complete ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: contact@factpulse.fr
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # VAT regime of the client's company at SuperPDP.
18
+ class SuperPDPVatRegimeResponse < ApiModelBase
19
+ attr_accessor :vat_regime
20
+
21
+ # Whether VAT on debits is opted for
22
+ attr_accessor :has_vat_on_debits
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'vat_regime' => :'vatRegime',
50
+ :'has_vat_on_debits' => :'hasVatOnDebits'
51
+ }
52
+ end
53
+
54
+ # Returns attribute mapping this model knows about
55
+ def self.acceptable_attribute_map
56
+ attribute_map
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ acceptable_attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'vat_regime' => :'String',
68
+ :'has_vat_on_debits' => :'Boolean'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ :'vat_regime',
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::SuperPDPVatRegimeResponse` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ acceptable_attribute_map = self.class.acceptable_attribute_map
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!acceptable_attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::SuperPDPVatRegimeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'vat_regime')
96
+ self.vat_regime = attributes[:'vat_regime']
97
+ end
98
+
99
+ if attributes.key?(:'has_vat_on_debits')
100
+ self.has_vat_on_debits = attributes[:'has_vat_on_debits']
101
+ else
102
+ self.has_vat_on_debits = false
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
110
+ invalid_properties = Array.new
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ warn '[DEPRECATED] the `valid?` method is obsolete'
118
+ vat_regime_validator = EnumAttributeValidator.new('String', ["monthly", "quarterly", "simplified", "vat_exemption"])
119
+ return false unless vat_regime_validator.valid?(@vat_regime)
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method checking allowed values (enum).
124
+ # @param [Object] vat_regime Object to be assigned
125
+ def vat_regime=(vat_regime)
126
+ validator = EnumAttributeValidator.new('String', ["monthly", "quarterly", "simplified", "vat_exemption"])
127
+ unless validator.valid?(vat_regime)
128
+ fail ArgumentError, "invalid value for \"vat_regime\", must be one of #{validator.allowable_values}."
129
+ end
130
+ @vat_regime = vat_regime
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ vat_regime == o.vat_regime &&
139
+ has_vat_on_debits == o.has_vat_on_debits
140
+ end
141
+
142
+ # @see the `==` method
143
+ # @param [Object] Object to be compared
144
+ def eql?(o)
145
+ self == o
146
+ end
147
+
148
+ # Calculates hash code according to all attributes.
149
+ # @return [Integer] Hash code
150
+ def hash
151
+ [vat_regime, has_vat_on_debits].hash
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def self.build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ attributes = attributes.transform_keys(&:to_sym)
160
+ transformed_hash = {}
161
+ openapi_types.each_pair do |key, type|
162
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = nil
164
+ elsif type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[attribute_map[key]].is_a?(Array)
168
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
169
+ end
170
+ elsif !attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
172
+ end
173
+ end
174
+ new(transformed_hash)
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ if value.nil?
184
+ is_nullable = self.class.openapi_nullable.include?(attr)
185
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
186
+ end
187
+
188
+ hash[param] = _to_hash(value)
189
+ end
190
+ hash
191
+ end
192
+
193
+ end
194
+
195
+ end
@@ -0,0 +1,200 @@
1
+ =begin
2
+ #FactPulse REST API
3
+
4
+ # REST API for electronic invoicing in France: Factur-X (CII), UBL 2.1, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Invoice Generation - **Formats**: CII XML, UBL 2.1 XML, or Factur-X PDF/A-3 - **Profiles** (CII/PDF): MINIMUM, BASIC, EN16931, EXTENDED - **UBL**: Always EN16931 compliant - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT), UBL 2.1 (OASIS) - **Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Factur-X - Validation - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) ### ✍️ Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification ### 📋 Flux 6 - Invoice Lifecycle (CDAR) - **CDAR Messages**: Acknowledgements, invoice statuses - **PPF Statuses**: REFUSED (210), PAID (212) ### 📊 Flux 10 - E-Reporting - **Tax Declarations**: International B2B, B2C - **Flow Types**: 10.1 (B2B transactions), 10.2 (B2B payments), 10.3 (B2C transactions), 10.4 (B2C payments) ### 📡 AFNOR PDP/PA (XP Z12-013) - **Flow Service**: Submit and search flows to PDPs - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user ### 🏛️ Chorus Pro - **Public Sector Invoicing**: Complete API for Chorus Pro ### ⏳ Async Tasks - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **Webhooks**: Automatic notifications when tasks complete ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: contact@factpulse.fr
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # VAT regime to set on the client's company at SuperPDP.
18
+ class SuperPDPVatRegimeUpdateRequest < ApiModelBase
19
+ # monthly (réel normal mensuel), quarterly (réel normal trimestriel), simplified (régime simplifié), vat_exemption (franchise en base)
20
+ attr_accessor :vat_regime
21
+
22
+ attr_accessor :has_vat_on_debits
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'vat_regime' => :'vatRegime',
50
+ :'has_vat_on_debits' => :'hasVatOnDebits'
51
+ }
52
+ end
53
+
54
+ # Returns attribute mapping this model knows about
55
+ def self.acceptable_attribute_map
56
+ attribute_map
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ acceptable_attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'vat_regime' => :'String',
68
+ :'has_vat_on_debits' => :'Boolean'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ :'has_vat_on_debits'
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::SuperPDPVatRegimeUpdateRequest` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ acceptable_attribute_map = self.class.acceptable_attribute_map
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!acceptable_attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::SuperPDPVatRegimeUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'vat_regime')
96
+ self.vat_regime = attributes[:'vat_regime']
97
+ else
98
+ self.vat_regime = nil
99
+ end
100
+
101
+ if attributes.key?(:'has_vat_on_debits')
102
+ self.has_vat_on_debits = attributes[:'has_vat_on_debits']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
110
+ invalid_properties = Array.new
111
+ if @vat_regime.nil?
112
+ invalid_properties.push('invalid value for "vat_regime", vat_regime cannot be nil.')
113
+ end
114
+
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ warn '[DEPRECATED] the `valid?` method is obsolete'
122
+ return false if @vat_regime.nil?
123
+ vat_regime_validator = EnumAttributeValidator.new('String', ["monthly", "quarterly", "simplified", "vat_exemption"])
124
+ return false unless vat_regime_validator.valid?(@vat_regime)
125
+ true
126
+ end
127
+
128
+ # Custom attribute writer method checking allowed values (enum).
129
+ # @param [Object] vat_regime Object to be assigned
130
+ def vat_regime=(vat_regime)
131
+ validator = EnumAttributeValidator.new('String', ["monthly", "quarterly", "simplified", "vat_exemption"])
132
+ unless validator.valid?(vat_regime)
133
+ fail ArgumentError, "invalid value for \"vat_regime\", must be one of #{validator.allowable_values}."
134
+ end
135
+ @vat_regime = vat_regime
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ vat_regime == o.vat_regime &&
144
+ has_vat_on_debits == o.has_vat_on_debits
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [vat_regime, has_vat_on_debits].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ return nil unless attributes.is_a?(Hash)
164
+ attributes = attributes.transform_keys(&:to_sym)
165
+ transformed_hash = {}
166
+ openapi_types.each_pair do |key, type|
167
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = nil
169
+ elsif type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[attribute_map[key]].is_a?(Array)
173
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
174
+ end
175
+ elsif !attributes[attribute_map[key]].nil?
176
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
177
+ end
178
+ end
179
+ new(transformed_hash)
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ end
199
+
200
+ end
@@ -32,6 +32,8 @@ module FactPulse
32
32
 
33
33
  attr_accessor :encaisse_amount
34
34
 
35
+ attr_accessor :encaisse_amounts_by_rate
36
+
35
37
  # Attribute mapping from ruby-style variable name to JSON key.
36
38
  def self.attribute_map
37
39
  {
@@ -42,7 +44,8 @@ module FactPulse
42
44
  :'invoice_issue_date' => :'invoiceIssueDate',
43
45
  :'status' => :'status',
44
46
  :'reason_code' => :'reasonCode',
45
- :'encaisse_amount' => :'encaisseAmount'
47
+ :'encaisse_amount' => :'encaisseAmount',
48
+ :'encaisse_amounts_by_rate' => :'encaisseAmountsByRate'
46
49
  }
47
50
  end
48
51
 
@@ -66,7 +69,8 @@ module FactPulse
66
69
  :'invoice_issue_date' => :'Date',
67
70
  :'status' => :'String',
68
71
  :'reason_code' => :'String',
69
- :'encaisse_amount' => :'Encaisseamount1'
72
+ :'encaisse_amount' => :'Encaisseamount1',
73
+ :'encaisse_amounts_by_rate' => :'Array<EncaisseAmountByRate>'
70
74
  }
71
75
  end
72
76
 
@@ -80,7 +84,8 @@ module FactPulse
80
84
  :'invoice_issue_date',
81
85
  :'status',
82
86
  :'reason_code',
83
- :'encaisse_amount'
87
+ :'encaisse_amount',
88
+ :'encaisse_amounts_by_rate'
84
89
  ])
85
90
  end
86
91
 
@@ -131,6 +136,12 @@ module FactPulse
131
136
  if attributes.key?(:'encaisse_amount')
132
137
  self.encaisse_amount = attributes[:'encaisse_amount']
133
138
  end
139
+
140
+ if attributes.key?(:'encaisse_amounts_by_rate')
141
+ if (value = attributes[:'encaisse_amounts_by_rate']).is_a?(Array)
142
+ self.encaisse_amounts_by_rate = value
143
+ end
144
+ end
134
145
  end
135
146
 
136
147
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -160,7 +171,8 @@ module FactPulse
160
171
  invoice_issue_date == o.invoice_issue_date &&
161
172
  status == o.status &&
162
173
  reason_code == o.reason_code &&
163
- encaisse_amount == o.encaisse_amount
174
+ encaisse_amount == o.encaisse_amount &&
175
+ encaisse_amounts_by_rate == o.encaisse_amounts_by_rate
164
176
  end
165
177
 
166
178
  # @see the `==` method
@@ -172,7 +184,7 @@ module FactPulse
172
184
  # Calculates hash code according to all attributes.
173
185
  # @return [Integer] Hash code
174
186
  def hash
175
- [document_id, sender_siren, sender_role, invoice_id, invoice_issue_date, status, reason_code, encaisse_amount].hash
187
+ [document_id, sender_siren, sender_role, invoice_id, invoice_issue_date, status, reason_code, encaisse_amount, encaisse_amounts_by_rate].hash
176
188
  end
177
189
 
178
190
  # Builds the object from hash
@@ -21,12 +21,18 @@ module FactPulse
21
21
 
22
22
  attr_accessor :type
23
23
 
24
+ attr_accessor :input
25
+
26
+ attr_accessor :ctx
27
+
24
28
  # Attribute mapping from ruby-style variable name to JSON key.
25
29
  def self.attribute_map
26
30
  {
27
31
  :'loc' => :'loc',
28
32
  :'msg' => :'msg',
29
- :'type' => :'type'
33
+ :'type' => :'type',
34
+ :'input' => :'input',
35
+ :'ctx' => :'ctx'
30
36
  }
31
37
  end
32
38
 
@@ -45,13 +51,16 @@ module FactPulse
45
51
  {
46
52
  :'loc' => :'Array<LocationInner>',
47
53
  :'msg' => :'String',
48
- :'type' => :'String'
54
+ :'type' => :'String',
55
+ :'input' => :'Object',
56
+ :'ctx' => :'Object'
49
57
  }
50
58
  end
51
59
 
52
60
  # List of attributes with nullable: true
53
61
  def self.openapi_nullable
54
62
  Set.new([
63
+ :'input',
55
64
  ])
56
65
  end
57
66
 
@@ -90,6 +99,14 @@ module FactPulse
90
99
  else
91
100
  self.type = nil
92
101
  end
102
+
103
+ if attributes.key?(:'input')
104
+ self.input = attributes[:'input']
105
+ end
106
+
107
+ if attributes.key?(:'ctx')
108
+ self.ctx = attributes[:'ctx']
109
+ end
93
110
  end
94
111
 
95
112
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -159,7 +176,9 @@ module FactPulse
159
176
  self.class == o.class &&
160
177
  loc == o.loc &&
161
178
  msg == o.msg &&
162
- type == o.type
179
+ type == o.type &&
180
+ input == o.input &&
181
+ ctx == o.ctx
163
182
  end
164
183
 
165
184
  # @see the `==` method
@@ -171,7 +190,7 @@ module FactPulse
171
190
  # Calculates hash code according to all attributes.
172
191
  # @return [Integer] Hash code
173
192
  def hash
174
- [loc, msg, type].hash
193
+ [loc, msg, type, input, ctx].hash
175
194
  end
176
195
 
177
196
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.21.0
11
11
  =end
12
12
 
13
13
  module FactPulse
14
- VERSION = '4.4.0'
14
+ VERSION = '4.5.0'
15
15
  end