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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -7
- data/Gemfile.lock +9 -9
- data/docs/Amount3.md +15 -0
- data/docs/ChorusProDestination.md +1 -1
- data/docs/ClientManagementApi.md +152 -0
- data/docs/CreateCDARRequest.md +5 -1
- data/docs/ElectronicSignatureApi.md +6 -6
- data/docs/EncaisseAmountByRate.md +20 -0
- data/docs/EncaisseeRequest.md +7 -3
- data/docs/FacturXConversionApi.md +2 -2
- data/docs/FacturXPDFXMLVerificationApi.md +4 -4
- data/docs/FacturXValidationApi.md +4 -4
- data/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +15 -0
- data/docs/{ChorusProCredentials.md → FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md} +2 -2
- data/docs/{ValidationErrorResponse.md → FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md} +2 -2
- data/docs/Flux10EReportingApi.md +4 -4
- data/docs/Flux6InvoiceLifecycleCDARApi.md +8 -4
- data/docs/InvoiceGenerationApi.md +4 -4
- data/docs/InvoiceInput.md +1 -1
- data/docs/LifecycleResponse.md +9 -1
- data/docs/ParseApi.md +4 -4
- data/docs/PaymentAmountByRate.md +1 -1
- data/docs/SubmitCDARRequest.md +4 -0
- data/docs/SuperPDPVatRegimeResponse.md +20 -0
- data/docs/SuperPDPVatRegimeUpdateRequest.md +20 -0
- data/docs/ValidateCDARRequest.md +3 -1
- data/docs/ValidationApi.md +3 -3
- data/docs/ValidationError.md +5 -1
- data/lib/factpulse/api/client_management_api.rb +137 -0
- data/lib/factpulse/api/electronic_signature_api.rb +6 -6
- data/lib/factpulse/api/factur_x_conversion_api.rb +2 -2
- data/lib/factpulse/api/factur_x_validation_api.rb +4 -4
- data/lib/factpulse/api/factur_xpdfxml_verification_api.rb +4 -4
- data/lib/factpulse/api/flux10_e_reporting_api.rb +4 -4
- data/lib/factpulse/api/flux6_invoice_lifecycle_cdar_api.rb +10 -4
- data/lib/factpulse/api/invoice_generation_api.rb +2 -2
- data/lib/factpulse/api/parse_api.rb +4 -4
- data/lib/factpulse/api/validation_api.rb +4 -4
- data/lib/factpulse/models/amount1.rb +1 -1
- data/lib/factpulse/models/amount2.rb +1 -1
- data/lib/factpulse/models/amount3.rb +104 -0
- data/lib/factpulse/models/chorus_pro_destination.rb +1 -1
- data/lib/factpulse/models/create_cdar_request.rb +56 -4
- data/lib/factpulse/models/encaisse_amount_by_rate.rb +192 -0
- data/lib/factpulse/models/encaisseamount.rb +1 -1
- data/lib/factpulse/models/encaissee_request.rb +43 -24
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb +43 -0
- data/lib/factpulse/models/{chorus_pro_credentials.rb → facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb} +3 -3
- data/lib/factpulse/models/{validation_error_response.rb → facture_electronique_rest_api_schemas_validation_validation_error_response.rb} +3 -3
- data/lib/factpulse/models/invoice_input.rb +1 -1
- data/lib/factpulse/models/invoice_type_code.rb +17 -6
- data/lib/factpulse/models/lifecycle_response.rb +48 -4
- data/lib/factpulse/models/payment_amount_by_rate.rb +1 -1
- data/lib/factpulse/models/payment_means.rb +2 -1
- data/lib/factpulse/models/submit_cdar_request.rb +53 -1
- data/lib/factpulse/models/super_pdp_vat_regime_response.rb +195 -0
- data/lib/factpulse/models/super_pdp_vat_regime_update_request.rb +200 -0
- data/lib/factpulse/models/validate_cdar_request.rb +17 -5
- data/lib/factpulse/models/validation_error.rb +23 -4
- data/lib/factpulse/version.rb +1 -1
- data/lib/factpulse.rb +7 -2
- metadata +16 -6
|
@@ -0,0 +1,192 @@
|
|
|
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
|
+
# Montant encaissé TTC pour un taux de TVA (un bloc MEN, MDG-43).
|
|
18
|
+
class EncaisseAmountByRate < ApiModelBase
|
|
19
|
+
# Taux de TVA applicable au montant encaissé, en % (MDT-224)
|
|
20
|
+
attr_accessor :rate
|
|
21
|
+
|
|
22
|
+
attr_accessor :amount
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'rate' => :'rate',
|
|
28
|
+
:'amount' => :'amount'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'rate' => :'Float',
|
|
46
|
+
:'amount' => :'Amount1'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::EncaisseAmountByRate` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::EncaisseAmountByRate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'rate')
|
|
73
|
+
self.rate = attributes[:'rate']
|
|
74
|
+
else
|
|
75
|
+
self.rate = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'amount')
|
|
79
|
+
self.amount = attributes[:'amount']
|
|
80
|
+
else
|
|
81
|
+
self.amount = nil
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
86
|
+
# @return Array for valid properties with the reasons
|
|
87
|
+
def list_invalid_properties
|
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
|
+
invalid_properties = Array.new
|
|
90
|
+
if @rate.nil?
|
|
91
|
+
invalid_properties.push('invalid value for "rate", rate cannot be nil.')
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if @amount.nil?
|
|
95
|
+
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
invalid_properties
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Check to see if the all the properties in the model are valid
|
|
102
|
+
# @return true if the model is valid
|
|
103
|
+
def valid?
|
|
104
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
105
|
+
return false if @rate.nil?
|
|
106
|
+
return false if @amount.nil?
|
|
107
|
+
true
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Custom attribute writer method with validation
|
|
111
|
+
# @param [Object] rate Value to be assigned
|
|
112
|
+
def rate=(rate)
|
|
113
|
+
if rate.nil?
|
|
114
|
+
fail ArgumentError, 'rate cannot be nil'
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
@rate = rate
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Custom attribute writer method with validation
|
|
121
|
+
# @param [Object] amount Value to be assigned
|
|
122
|
+
def amount=(amount)
|
|
123
|
+
if amount.nil?
|
|
124
|
+
fail ArgumentError, 'amount cannot be nil'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
@amount = amount
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Checks equality by comparing each attribute.
|
|
131
|
+
# @param [Object] Object to be compared
|
|
132
|
+
def ==(o)
|
|
133
|
+
return true if self.equal?(o)
|
|
134
|
+
self.class == o.class &&
|
|
135
|
+
rate == o.rate &&
|
|
136
|
+
amount == o.amount
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# @see the `==` method
|
|
140
|
+
# @param [Object] Object to be compared
|
|
141
|
+
def eql?(o)
|
|
142
|
+
self == o
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Calculates hash code according to all attributes.
|
|
146
|
+
# @return [Integer] Hash code
|
|
147
|
+
def hash
|
|
148
|
+
[rate, amount].hash
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Builds the object from hash
|
|
152
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
153
|
+
# @return [Object] Returns the model itself
|
|
154
|
+
def self.build_from_hash(attributes)
|
|
155
|
+
return nil unless attributes.is_a?(Hash)
|
|
156
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
157
|
+
transformed_hash = {}
|
|
158
|
+
openapi_types.each_pair do |key, type|
|
|
159
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
160
|
+
transformed_hash["#{key}"] = nil
|
|
161
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
162
|
+
# check to ensure the input is an array given that the attribute
|
|
163
|
+
# is documented as an array but the input is not
|
|
164
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
165
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
166
|
+
end
|
|
167
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
168
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
new(transformed_hash)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Returns the object in the form of hash
|
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
|
176
|
+
def to_hash
|
|
177
|
+
hash = {}
|
|
178
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
179
|
+
value = self.send(attr)
|
|
180
|
+
if value.nil?
|
|
181
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
182
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
hash[param] = _to_hash(value)
|
|
186
|
+
end
|
|
187
|
+
hash
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
# Montant encaissé
|
|
17
|
+
# Montant TTC encaissé à un seul taux (statut 212). Négatif pour un décaissement. Pour plusieurs taux, utiliser encaisseAmountsByRate
|
|
18
18
|
module Encaisseamount
|
|
19
19
|
class << self
|
|
20
20
|
# List of class defined in anyOf (OpenAPI v3)
|
|
@@ -25,14 +25,17 @@ module FactPulse
|
|
|
25
25
|
# SIREN de l'acheteur (destinataire du statut)
|
|
26
26
|
attr_accessor :invoice_buyer_siren
|
|
27
27
|
|
|
28
|
-
# Adresse électronique de l'acheteur (MDT-73)
|
|
29
28
|
attr_accessor :invoice_buyer_electronic_address
|
|
30
29
|
|
|
31
30
|
attr_accessor :amount
|
|
32
31
|
|
|
33
|
-
# Taux de TVA du montant encaissé en % (MDT-224, requis par BR-FR-CDV-14 ; défaut 20)
|
|
32
|
+
# Taux de TVA du montant encaissé en % (MDT-224, requis par BR-FR-CDV-14 ; défaut 20). Ignoré avec amountsByRate
|
|
34
33
|
attr_accessor :vat_rate
|
|
35
34
|
|
|
35
|
+
attr_accessor :amounts_by_rate
|
|
36
|
+
|
|
37
|
+
attr_accessor :comment
|
|
38
|
+
|
|
36
39
|
# Code devise ISO 4217
|
|
37
40
|
attr_accessor :currency
|
|
38
41
|
|
|
@@ -58,6 +61,8 @@ module FactPulse
|
|
|
58
61
|
:'invoice_buyer_electronic_address' => :'invoiceBuyerElectronicAddress',
|
|
59
62
|
:'amount' => :'amount',
|
|
60
63
|
:'vat_rate' => :'vatRate',
|
|
64
|
+
:'amounts_by_rate' => :'amountsByRate',
|
|
65
|
+
:'comment' => :'comment',
|
|
61
66
|
:'currency' => :'currency',
|
|
62
67
|
:'sender_siren' => :'senderSiren',
|
|
63
68
|
:'flow_type' => :'flowType',
|
|
@@ -85,8 +90,10 @@ module FactPulse
|
|
|
85
90
|
:'invoice_issue_date' => :'Date',
|
|
86
91
|
:'invoice_buyer_siren' => :'String',
|
|
87
92
|
:'invoice_buyer_electronic_address' => :'String',
|
|
88
|
-
:'amount' => :'
|
|
93
|
+
:'amount' => :'Amount2',
|
|
89
94
|
:'vat_rate' => :'Float',
|
|
95
|
+
:'amounts_by_rate' => :'Array<EncaisseAmountByRate>',
|
|
96
|
+
:'comment' => :'String',
|
|
90
97
|
:'currency' => :'String',
|
|
91
98
|
:'sender_siren' => :'String',
|
|
92
99
|
:'flow_type' => :'String',
|
|
@@ -100,6 +107,10 @@ module FactPulse
|
|
|
100
107
|
# List of attributes with nullable: true
|
|
101
108
|
def self.openapi_nullable
|
|
102
109
|
Set.new([
|
|
110
|
+
:'invoice_buyer_electronic_address',
|
|
111
|
+
:'amount',
|
|
112
|
+
:'amounts_by_rate',
|
|
113
|
+
:'comment',
|
|
103
114
|
:'sender_siren',
|
|
104
115
|
:'pdp_flow_service_url',
|
|
105
116
|
:'pdp_token_url',
|
|
@@ -144,14 +155,10 @@ module FactPulse
|
|
|
144
155
|
|
|
145
156
|
if attributes.key?(:'invoice_buyer_electronic_address')
|
|
146
157
|
self.invoice_buyer_electronic_address = attributes[:'invoice_buyer_electronic_address']
|
|
147
|
-
else
|
|
148
|
-
self.invoice_buyer_electronic_address = nil
|
|
149
158
|
end
|
|
150
159
|
|
|
151
160
|
if attributes.key?(:'amount')
|
|
152
161
|
self.amount = attributes[:'amount']
|
|
153
|
-
else
|
|
154
|
-
self.amount = nil
|
|
155
162
|
end
|
|
156
163
|
|
|
157
164
|
if attributes.key?(:'vat_rate')
|
|
@@ -160,6 +167,16 @@ module FactPulse
|
|
|
160
167
|
self.vat_rate = 20
|
|
161
168
|
end
|
|
162
169
|
|
|
170
|
+
if attributes.key?(:'amounts_by_rate')
|
|
171
|
+
if (value = attributes[:'amounts_by_rate']).is_a?(Array)
|
|
172
|
+
self.amounts_by_rate = value
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if attributes.key?(:'comment')
|
|
177
|
+
self.comment = attributes[:'comment']
|
|
178
|
+
end
|
|
179
|
+
|
|
163
180
|
if attributes.key?(:'currency')
|
|
164
181
|
self.currency = attributes[:'currency']
|
|
165
182
|
else
|
|
@@ -210,12 +227,12 @@ module FactPulse
|
|
|
210
227
|
invalid_properties.push('invalid value for "invoice_buyer_siren", invoice_buyer_siren cannot be nil.')
|
|
211
228
|
end
|
|
212
229
|
|
|
213
|
-
if
|
|
214
|
-
invalid_properties.push('invalid value for "
|
|
230
|
+
if !@amounts_by_rate.nil? && @amounts_by_rate.length < 1
|
|
231
|
+
invalid_properties.push('invalid value for "amounts_by_rate", number of items must be greater than or equal to 1.')
|
|
215
232
|
end
|
|
216
233
|
|
|
217
|
-
if
|
|
218
|
-
invalid_properties.push('invalid value for "
|
|
234
|
+
if !@comment.nil? && @comment.to_s.length > 2000
|
|
235
|
+
invalid_properties.push('invalid value for "comment", the character length must be smaller than or equal to 2000.')
|
|
219
236
|
end
|
|
220
237
|
|
|
221
238
|
invalid_properties
|
|
@@ -228,8 +245,8 @@ module FactPulse
|
|
|
228
245
|
return false if @invoice_id.nil?
|
|
229
246
|
return false if @invoice_issue_date.nil?
|
|
230
247
|
return false if @invoice_buyer_siren.nil?
|
|
231
|
-
return false if
|
|
232
|
-
return false if
|
|
248
|
+
return false if !@amounts_by_rate.nil? && @amounts_by_rate.length < 1
|
|
249
|
+
return false if !@comment.nil? && @comment.to_s.length > 2000
|
|
233
250
|
true
|
|
234
251
|
end
|
|
235
252
|
|
|
@@ -264,23 +281,23 @@ module FactPulse
|
|
|
264
281
|
end
|
|
265
282
|
|
|
266
283
|
# Custom attribute writer method with validation
|
|
267
|
-
# @param [Object]
|
|
268
|
-
def
|
|
269
|
-
if
|
|
270
|
-
fail ArgumentError, '
|
|
284
|
+
# @param [Object] amounts_by_rate Value to be assigned
|
|
285
|
+
def amounts_by_rate=(amounts_by_rate)
|
|
286
|
+
if !amounts_by_rate.nil? && amounts_by_rate.length < 1
|
|
287
|
+
fail ArgumentError, 'invalid value for "amounts_by_rate", number of items must be greater than or equal to 1.'
|
|
271
288
|
end
|
|
272
289
|
|
|
273
|
-
@
|
|
290
|
+
@amounts_by_rate = amounts_by_rate
|
|
274
291
|
end
|
|
275
292
|
|
|
276
293
|
# Custom attribute writer method with validation
|
|
277
|
-
# @param [Object]
|
|
278
|
-
def
|
|
279
|
-
if
|
|
280
|
-
fail ArgumentError, '
|
|
294
|
+
# @param [Object] comment Value to be assigned
|
|
295
|
+
def comment=(comment)
|
|
296
|
+
if !comment.nil? && comment.to_s.length > 2000
|
|
297
|
+
fail ArgumentError, 'invalid value for "comment", the character length must be smaller than or equal to 2000.'
|
|
281
298
|
end
|
|
282
299
|
|
|
283
|
-
@
|
|
300
|
+
@comment = comment
|
|
284
301
|
end
|
|
285
302
|
|
|
286
303
|
# Checks equality by comparing each attribute.
|
|
@@ -294,6 +311,8 @@ module FactPulse
|
|
|
294
311
|
invoice_buyer_electronic_address == o.invoice_buyer_electronic_address &&
|
|
295
312
|
amount == o.amount &&
|
|
296
313
|
vat_rate == o.vat_rate &&
|
|
314
|
+
amounts_by_rate == o.amounts_by_rate &&
|
|
315
|
+
comment == o.comment &&
|
|
297
316
|
currency == o.currency &&
|
|
298
317
|
sender_siren == o.sender_siren &&
|
|
299
318
|
flow_type == o.flow_type &&
|
|
@@ -312,7 +331,7 @@ module FactPulse
|
|
|
312
331
|
# Calculates hash code according to all attributes.
|
|
313
332
|
# @return [Integer] Hash code
|
|
314
333
|
def hash
|
|
315
|
-
[invoice_id, invoice_issue_date, invoice_buyer_siren, invoice_buyer_electronic_address, amount, vat_rate, currency, sender_siren, flow_type, pdp_flow_service_url, pdp_token_url, pdp_client_id, pdp_client_secret].hash
|
|
334
|
+
[invoice_id, invoice_issue_date, invoice_buyer_siren, invoice_buyer_electronic_address, amount, vat_rate, amounts_by_rate, comment, currency, sender_siren, flow_type, pdp_flow_service_url, pdp_token_url, pdp_client_id, pdp_client_secret].hash
|
|
316
335
|
end
|
|
317
336
|
|
|
318
337
|
# Builds the object from hash
|
data/lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
class FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode
|
|
18
|
+
N380 = "380".freeze
|
|
19
|
+
N381 = "381".freeze
|
|
20
|
+
N384 = "384".freeze
|
|
21
|
+
N389 = "389".freeze
|
|
22
|
+
N386 = "386".freeze
|
|
23
|
+
|
|
24
|
+
def self.all_vars
|
|
25
|
+
@all_vars ||= [N380, N381, N384, N389, N386].freeze
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Builds the enum from string
|
|
29
|
+
# @param [String] The enum value in the form of the string
|
|
30
|
+
# @return [String] The enum value
|
|
31
|
+
def self.build_from_hash(value)
|
|
32
|
+
new.build_from_hash(value)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Builds the enum from string
|
|
36
|
+
# @param [String] The enum value in the form of the string
|
|
37
|
+
# @return [String] The enum value
|
|
38
|
+
def build_from_hash(value)
|
|
39
|
+
return value if FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.all_vars.include?(value)
|
|
40
|
+
raise "Invalid ENUM value #{value} for class #FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode"
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
17
|
# Optional Chorus Pro credentials. **MODE 1 - JWT retrieval (recommended):** Do not provide this `credentials` field in the payload. Credentials will be automatically retrieved via client_uid from JWT (0-trust). **MODE 2 - Credentials in payload:** Provide all required fields below. Useful for tests or third-party integrations.
|
|
18
|
-
class
|
|
18
|
+
class FactureElectroniqueRestApiSchemasProcessingChorusProCredentials < ApiModelBase
|
|
19
19
|
attr_accessor :piste_client_id
|
|
20
20
|
|
|
21
21
|
attr_accessor :piste_client_secret
|
|
@@ -73,14 +73,14 @@ module FactPulse
|
|
|
73
73
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
74
74
|
def initialize(attributes = {})
|
|
75
75
|
if (!attributes.is_a?(Hash))
|
|
76
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::
|
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::FactureElectroniqueRestApiSchemasProcessingChorusProCredentials` initialize method"
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
80
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
81
81
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
82
82
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::FactureElectroniqueRestApiSchemasProcessingChorusProCredentials`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
84
84
|
end
|
|
85
85
|
h[k.to_sym] = v
|
|
86
86
|
}
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
17
|
# Response for validation errors.
|
|
18
|
-
class
|
|
18
|
+
class FactureElectroniqueRestApiSchemasValidationValidationErrorResponse < ApiModelBase
|
|
19
19
|
# List of detected validation errors.
|
|
20
20
|
attr_accessor :detail
|
|
21
21
|
|
|
@@ -53,14 +53,14 @@ module FactPulse
|
|
|
53
53
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
54
54
|
def initialize(attributes = {})
|
|
55
55
|
if (!attributes.is_a?(Hash))
|
|
56
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::
|
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::FactureElectroniqueRestApiSchemasValidationValidationErrorResponse` initialize method"
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
60
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
61
61
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
62
62
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
63
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::
|
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::FactureElectroniqueRestApiSchemasValidationValidationErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
64
64
|
end
|
|
65
65
|
h[k.to_sym] = v
|
|
66
66
|
}
|
|
@@ -120,7 +120,7 @@ module FactPulse
|
|
|
120
120
|
{
|
|
121
121
|
:'invoice_id' => :'String',
|
|
122
122
|
:'issue_date' => :'Date',
|
|
123
|
-
:'type_code' => :'
|
|
123
|
+
:'type_code' => :'FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode',
|
|
124
124
|
:'currency' => :'Currency',
|
|
125
125
|
:'due_date' => :'Date',
|
|
126
126
|
:'seller_id' => :'String',
|
|
@@ -15,14 +15,25 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
17
|
class InvoiceTypeCode
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
INVOICE = "380".freeze
|
|
19
|
+
SELF_BILLED_INVOICE = "389".freeze
|
|
20
|
+
FACTORED_INVOICE = "393".freeze
|
|
21
|
+
SELF_BILLED_FACTORED_INVOICE = "501".freeze
|
|
22
|
+
PREPAYMENT_INVOICE = "386".freeze
|
|
23
|
+
SELF_BILLED_PREPAYMENT_INVOICE = "500".freeze
|
|
24
|
+
CORRECTIVE_INVOICE = "384".freeze
|
|
25
|
+
SELF_BILLED_CORRECTIVE_INVOICE = "471".freeze
|
|
26
|
+
FACTORED_CORRECTIVE_INVOICE = "472".freeze
|
|
27
|
+
SELF_BILLED_FACTORED_CORRECTIVE_INVOICE = "473".freeze
|
|
28
|
+
CREDIT_NOTE = "381".freeze
|
|
29
|
+
SELF_BILLED_CREDIT_NOTE = "261".freeze
|
|
30
|
+
GLOBAL_ALLOWANCE_CREDIT_NOTE = "262".freeze
|
|
31
|
+
FACTORED_CREDIT_NOTE = "396".freeze
|
|
32
|
+
SELF_BILLED_FACTORED_CREDIT_NOTE = "502".freeze
|
|
33
|
+
PREPAYMENT_CREDIT_NOTE = "503".freeze
|
|
23
34
|
|
|
24
35
|
def self.all_vars
|
|
25
|
-
@all_vars ||= [
|
|
36
|
+
@all_vars ||= [INVOICE, SELF_BILLED_INVOICE, FACTORED_INVOICE, SELF_BILLED_FACTORED_INVOICE, PREPAYMENT_INVOICE, SELF_BILLED_PREPAYMENT_INVOICE, CORRECTIVE_INVOICE, SELF_BILLED_CORRECTIVE_INVOICE, FACTORED_CORRECTIVE_INVOICE, SELF_BILLED_FACTORED_CORRECTIVE_INVOICE, CREDIT_NOTE, SELF_BILLED_CREDIT_NOTE, GLOBAL_ALLOWANCE_CREDIT_NOTE, FACTORED_CREDIT_NOTE, SELF_BILLED_FACTORED_CREDIT_NOTE, PREPAYMENT_CREDIT_NOTE].freeze
|
|
26
37
|
end
|
|
27
38
|
|
|
28
39
|
# Builds the enum from string
|
|
@@ -25,12 +25,26 @@ module FactPulse
|
|
|
25
25
|
# Nombre de jours de la fenetre de recherche
|
|
26
26
|
attr_accessor :cutoff_days
|
|
27
27
|
|
|
28
|
+
# Nombre de flux de statut (CDAR) lus sur la PA
|
|
29
|
+
attr_accessor :total_flows
|
|
30
|
+
|
|
31
|
+
# True si la limite de flux lus par appel a ete atteinte : la reponse est incomplete, reduire la fenetre (dateFrom/dateTo ou days)
|
|
32
|
+
attr_accessor :truncated
|
|
33
|
+
|
|
34
|
+
attr_accessor :date_from
|
|
35
|
+
|
|
36
|
+
attr_accessor :date_to
|
|
37
|
+
|
|
28
38
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
39
|
def self.attribute_map
|
|
30
40
|
{
|
|
31
41
|
:'invoices' => :'invoices',
|
|
32
42
|
:'total_invoices' => :'totalInvoices',
|
|
33
|
-
:'cutoff_days' => :'cutoffDays'
|
|
43
|
+
:'cutoff_days' => :'cutoffDays',
|
|
44
|
+
:'total_flows' => :'totalFlows',
|
|
45
|
+
:'truncated' => :'truncated',
|
|
46
|
+
:'date_from' => :'dateFrom',
|
|
47
|
+
:'date_to' => :'dateTo'
|
|
34
48
|
}
|
|
35
49
|
end
|
|
36
50
|
|
|
@@ -49,13 +63,19 @@ module FactPulse
|
|
|
49
63
|
{
|
|
50
64
|
:'invoices' => :'Array<InvoiceLifecycle>',
|
|
51
65
|
:'total_invoices' => :'Integer',
|
|
52
|
-
:'cutoff_days' => :'Integer'
|
|
66
|
+
:'cutoff_days' => :'Integer',
|
|
67
|
+
:'total_flows' => :'Integer',
|
|
68
|
+
:'truncated' => :'Boolean',
|
|
69
|
+
:'date_from' => :'String',
|
|
70
|
+
:'date_to' => :'String'
|
|
53
71
|
}
|
|
54
72
|
end
|
|
55
73
|
|
|
56
74
|
# List of attributes with nullable: true
|
|
57
75
|
def self.openapi_nullable
|
|
58
76
|
Set.new([
|
|
77
|
+
:'date_from',
|
|
78
|
+
:'date_to'
|
|
59
79
|
])
|
|
60
80
|
end
|
|
61
81
|
|
|
@@ -92,6 +112,26 @@ module FactPulse
|
|
|
92
112
|
else
|
|
93
113
|
self.cutoff_days = nil
|
|
94
114
|
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'total_flows')
|
|
117
|
+
self.total_flows = attributes[:'total_flows']
|
|
118
|
+
else
|
|
119
|
+
self.total_flows = 0
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'truncated')
|
|
123
|
+
self.truncated = attributes[:'truncated']
|
|
124
|
+
else
|
|
125
|
+
self.truncated = false
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'date_from')
|
|
129
|
+
self.date_from = attributes[:'date_from']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'date_to')
|
|
133
|
+
self.date_to = attributes[:'date_to']
|
|
134
|
+
end
|
|
95
135
|
end
|
|
96
136
|
|
|
97
137
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -146,7 +186,11 @@ module FactPulse
|
|
|
146
186
|
self.class == o.class &&
|
|
147
187
|
invoices == o.invoices &&
|
|
148
188
|
total_invoices == o.total_invoices &&
|
|
149
|
-
cutoff_days == o.cutoff_days
|
|
189
|
+
cutoff_days == o.cutoff_days &&
|
|
190
|
+
total_flows == o.total_flows &&
|
|
191
|
+
truncated == o.truncated &&
|
|
192
|
+
date_from == o.date_from &&
|
|
193
|
+
date_to == o.date_to
|
|
150
194
|
end
|
|
151
195
|
|
|
152
196
|
# @see the `==` method
|
|
@@ -158,7 +202,7 @@ module FactPulse
|
|
|
158
202
|
# Calculates hash code according to all attributes.
|
|
159
203
|
# @return [Integer] Hash code
|
|
160
204
|
def hash
|
|
161
|
-
[invoices, total_invoices, cutoff_days].hash
|
|
205
|
+
[invoices, total_invoices, cutoff_days, total_flows, truncated, date_from, date_to].hash
|
|
162
206
|
end
|
|
163
207
|
|
|
164
208
|
# Builds the object from hash
|
|
@@ -21,9 +21,10 @@ module FactPulse
|
|
|
21
21
|
ESPECE = "ESPECE".freeze
|
|
22
22
|
AUTRE = "AUTRE".freeze
|
|
23
23
|
REPORT = "REPORT".freeze
|
|
24
|
+
CARTE = "CARTE".freeze
|
|
24
25
|
|
|
25
26
|
def self.all_vars
|
|
26
|
-
@all_vars ||= [CHEQUE, PRELEVEMENT, VIREMENT, ESPECE, AUTRE, REPORT].freeze
|
|
27
|
+
@all_vars ||= [CHEQUE, PRELEVEMENT, VIREMENT, ESPECE, AUTRE, REPORT, CARTE].freeze
|
|
27
28
|
end
|
|
28
29
|
|
|
29
30
|
# Builds the enum from string
|