factpulse 3.0.4 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -3
- data/Gemfile.lock +1 -1
- data/docs/AdditionalDocument.md +26 -0
- data/docs/AllowanceCharge.md +32 -0
- data/docs/AllowanceTotalAmount.md +15 -0
- data/docs/{APIProfile.md → Amount.md} +2 -2
- data/docs/{DocumentType.md → BaseAmount.md} +2 -2
- data/docs/ChargeTotalAmount.md +15 -0
- data/docs/Contact.md +24 -0
- data/docs/ConvertErrorResponse.md +26 -0
- data/docs/ConvertPendingInputResponse.md +32 -0
- data/docs/ConvertResumeRequest.md +18 -0
- data/docs/ConvertSuccessResponse.md +36 -0
- data/docs/ConvertValidationFailedResponse.md +34 -0
- data/docs/DeliveryParty.md +24 -0
- data/docs/DocumentConversionApi.md +373 -0
- data/docs/DocumentTypeInfo.md +22 -0
- data/docs/ExtractionInfo.md +24 -0
- data/docs/FacturXInvoice.md +29 -1
- data/docs/FacturXProfile.md +15 -0
- data/docs/FileInfo.md +20 -0
- data/docs/FilesInfo.md +20 -0
- data/docs/GrossUnitPrice.md +15 -0
- data/docs/IncomingInvoice.md +1 -1
- data/docs/InvoiceLine.md +43 -9
- data/docs/InvoiceProcessingApi.md +8 -8
- data/docs/InvoiceReferences.md +26 -6
- data/docs/InvoiceTotals.md +10 -2
- data/docs/LineTotalAmount.md +15 -0
- data/docs/MissingField.md +28 -0
- data/docs/Payee.md +5 -1
- data/docs/PaymentCard.md +20 -0
- data/docs/Percentage.md +15 -0
- data/docs/PostalAddress.md +5 -1
- data/docs/PriceAllowanceAmount.md +15 -0
- data/docs/PriceBasisQuantity.md +15 -0
- data/docs/ProcessingOptions.md +3 -3
- data/docs/ProductCharacteristic.md +20 -0
- data/docs/ProductClassification.md +22 -0
- data/docs/Recipient.md +7 -1
- data/docs/RoundingAmount.md +15 -0
- data/docs/Supplier.md +17 -1
- data/docs/TaxRepresentative.md +22 -0
- data/docs/VATLine.md +2 -0
- data/docs/VATPointDateCode.md +15 -0
- data/docs/ValidationInfo.md +28 -0
- data/docs/VatRate.md +15 -0
- data/factpulse.gemspec +1 -1
- data/lib/factpulse/api/afnorpdppa_api.rb +1 -1
- data/lib/factpulse/api/afnorpdppa_directory_service_api.rb +1 -1
- data/lib/factpulse/api/afnorpdppa_flow_service_api.rb +1 -1
- data/lib/factpulse/api/chorus_pro_api.rb +1 -1
- data/lib/factpulse/api/document_conversion_api.rb +378 -0
- data/lib/factpulse/api/health_api.rb +1 -1
- data/lib/factpulse/api/invoice_processing_api.rb +9 -9
- data/lib/factpulse/api/pdfxml_verification_api.rb +1 -1
- data/lib/factpulse/api/user_api.rb +1 -1
- data/lib/factpulse/api_client.rb +1 -1
- data/lib/factpulse/api_error.rb +1 -1
- data/lib/factpulse/api_model_base.rb +1 -1
- data/lib/factpulse/configuration.rb +1 -1
- data/lib/factpulse/models/acknowledgment_status.rb +1 -1
- data/lib/factpulse/models/additional_document.rb +206 -0
- data/lib/factpulse/models/afnor_credentials.rb +1 -1
- data/lib/factpulse/models/afnor_destination.rb +1 -1
- data/lib/factpulse/models/afnor_health_check_response.rb +1 -1
- data/lib/factpulse/models/afnor_result.rb +1 -1
- data/lib/factpulse/models/allowance_charge.rb +252 -0
- data/lib/factpulse/models/allowance_reason_code.rb +1 -1
- data/lib/factpulse/models/allowance_total_amount.rb +104 -0
- data/lib/factpulse/models/amount.rb +104 -0
- data/lib/factpulse/models/amount_due.rb +2 -2
- data/lib/factpulse/models/api_error.rb +1 -1
- data/lib/factpulse/models/async_task_status.rb +1 -1
- data/lib/factpulse/models/base_amount.rb +104 -0
- data/lib/factpulse/models/bounding_box_schema.rb +1 -1
- data/lib/factpulse/models/celery_status.rb +1 -1
- data/lib/factpulse/models/certificate_info_response.rb +1 -1
- data/lib/factpulse/models/charge_total_amount.rb +104 -0
- data/lib/factpulse/models/chorus_pro_destination.rb +1 -1
- data/lib/factpulse/models/chorus_pro_result.rb +1 -1
- data/lib/factpulse/models/contact.rb +179 -0
- data/lib/factpulse/models/convert_error_response.rb +224 -0
- data/lib/factpulse/models/convert_pending_input_response.rb +322 -0
- data/lib/factpulse/models/convert_resume_request.rb +151 -0
- data/lib/factpulse/models/convert_success_response.rb +360 -0
- data/lib/factpulse/models/convert_validation_failed_response.rb +334 -0
- data/lib/factpulse/models/delivery_party.rb +179 -0
- data/lib/factpulse/models/destination.rb +1 -1
- data/lib/factpulse/models/document_type_info.rb +220 -0
- data/lib/factpulse/models/electronic_address.rb +1 -1
- data/lib/factpulse/models/enriched_invoice_info.rb +1 -1
- data/lib/factpulse/models/error_level.rb +1 -1
- data/lib/factpulse/models/error_source.rb +1 -1
- data/lib/factpulse/models/extraction_info.rb +217 -0
- data/lib/factpulse/models/factur_x_invoice.rb +150 -6
- data/lib/factpulse/models/{api_profile.rb → factur_x_profile.rb} +4 -4
- data/lib/factpulse/models/factur_xpdf_info.rb +1 -1
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.rb +5 -5
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb +1 -1
- data/lib/factpulse/models/field_status.rb +1 -1
- data/lib/factpulse/models/file_info.rb +161 -0
- data/lib/factpulse/models/files_info.rb +159 -0
- data/lib/factpulse/models/flow_direction.rb +1 -1
- data/lib/factpulse/models/flow_profile.rb +1 -1
- data/lib/factpulse/models/flow_summary.rb +1 -1
- data/lib/factpulse/models/flow_syntax.rb +1 -1
- data/lib/factpulse/models/flow_type.rb +1 -1
- data/lib/factpulse/models/generate_certificate_request.rb +6 -6
- data/lib/factpulse/models/generate_certificate_response.rb +1 -1
- data/lib/factpulse/models/get_chorus_pro_id_request.rb +2 -2
- data/lib/factpulse/models/get_chorus_pro_id_response.rb +1 -1
- data/lib/factpulse/models/get_invoice_request.rb +2 -2
- data/lib/factpulse/models/get_invoice_response.rb +1 -1
- data/lib/factpulse/models/get_structure_request.rb +3 -3
- data/lib/factpulse/models/get_structure_response.rb +1 -1
- data/lib/factpulse/models/global_allowance_amount.rb +2 -2
- data/lib/factpulse/models/gross_unit_price.rb +104 -0
- data/lib/factpulse/models/http_validation_error.rb +1 -1
- data/lib/factpulse/models/incoming_invoice.rb +2 -2
- data/lib/factpulse/models/incoming_supplier.rb +1 -1
- data/lib/factpulse/models/invoice_format.rb +1 -1
- data/lib/factpulse/models/invoice_line.rb +209 -25
- data/lib/factpulse/models/invoice_line_allowance_amount.rb +2 -2
- data/lib/factpulse/models/invoice_note.rb +1 -1
- data/lib/factpulse/models/invoice_references.rb +119 -16
- data/lib/factpulse/models/invoice_status.rb +1 -1
- data/lib/factpulse/models/invoice_totals.rb +52 -12
- data/lib/factpulse/models/invoice_totals_prepayment.rb +2 -2
- data/lib/factpulse/models/invoice_type_code.rb +1 -1
- data/lib/factpulse/models/invoicing_framework.rb +1 -1
- data/lib/factpulse/models/invoicing_framework_code.rb +1 -1
- data/lib/factpulse/models/line_net_amount.rb +2 -2
- data/lib/factpulse/models/line_total_amount.rb +104 -0
- data/lib/factpulse/models/mandatory_note_schema.rb +1 -1
- data/lib/factpulse/models/manual_rate.rb +2 -2
- data/lib/factpulse/models/manual_vat_rate.rb +2 -2
- data/lib/factpulse/models/missing_field.rb +269 -0
- data/lib/factpulse/models/operation_nature.rb +1 -1
- data/lib/factpulse/models/output_format.rb +1 -1
- data/lib/factpulse/models/page_dimensions_schema.rb +1 -1
- data/lib/factpulse/models/payee.rb +28 -6
- data/lib/factpulse/models/payment_card.rb +159 -0
- data/lib/factpulse/models/payment_means.rb +1 -1
- data/lib/factpulse/models/pdf_validation_result_api.rb +1 -1
- data/lib/factpulse/models/pdp_credentials.rb +6 -6
- data/lib/factpulse/models/percentage.rb +104 -0
- data/lib/factpulse/models/postal_address.rb +27 -7
- data/lib/factpulse/models/price_allowance_amount.rb +104 -0
- data/lib/factpulse/models/price_basis_quantity.rb +104 -0
- data/lib/factpulse/models/processing_options.rb +10 -10
- data/lib/factpulse/models/product_characteristic.rb +193 -0
- data/lib/factpulse/models/product_classification.rb +186 -0
- data/lib/factpulse/models/quantity.rb +2 -2
- data/lib/factpulse/models/recipient.rb +39 -7
- data/lib/factpulse/models/rounding_amount.rb +104 -0
- data/lib/factpulse/models/scheme_id.rb +12 -6
- data/lib/factpulse/models/search_flow_request.rb +8 -8
- data/lib/factpulse/models/search_flow_response.rb +1 -1
- data/lib/factpulse/models/search_services_response.rb +1 -1
- data/lib/factpulse/models/search_structure_request.rb +5 -5
- data/lib/factpulse/models/search_structure_response.rb +1 -1
- data/lib/factpulse/models/signature_info.rb +1 -1
- data/lib/factpulse/models/signature_info_api.rb +1 -1
- data/lib/factpulse/models/signature_parameters.rb +1 -1
- data/lib/factpulse/models/simplified_invoice_data.rb +1 -1
- data/lib/factpulse/models/structure_info.rb +1 -1
- data/lib/factpulse/models/structure_parameters.rb +1 -1
- data/lib/factpulse/models/structure_service.rb +1 -1
- data/lib/factpulse/models/submission_mode.rb +1 -1
- data/lib/factpulse/models/submit_complete_invoice_request.rb +1 -1
- data/lib/factpulse/models/submit_complete_invoice_response.rb +1 -1
- data/lib/factpulse/models/submit_flow_request.rb +7 -7
- data/lib/factpulse/models/submit_flow_response.rb +1 -1
- data/lib/factpulse/models/submit_gross_amount.rb +1 -1
- data/lib/factpulse/models/submit_invoice_request.rb +14 -14
- data/lib/factpulse/models/submit_invoice_response.rb +1 -1
- data/lib/factpulse/models/submit_net_amount.rb +1 -1
- data/lib/factpulse/models/submit_vat_amount.rb +1 -1
- data/lib/factpulse/models/supplementary_attachment.rb +1 -1
- data/lib/factpulse/models/supplier.rb +89 -7
- data/lib/factpulse/models/task_response.rb +1 -1
- data/lib/factpulse/models/tax_representative.rb +220 -0
- data/lib/factpulse/models/taxable_amount.rb +2 -2
- data/lib/factpulse/models/total_gross_amount.rb +2 -2
- data/lib/factpulse/models/total_net_amount.rb +2 -2
- data/lib/factpulse/models/total_vat_amount.rb +2 -2
- data/lib/factpulse/models/unit_net_price.rb +2 -2
- data/lib/factpulse/models/unit_of_measure.rb +1 -1
- data/lib/factpulse/models/validation_error.rb +1 -1
- data/lib/factpulse/models/validation_error_detail.rb +1 -1
- data/lib/factpulse/models/validation_error_loc_inner.rb +1 -1
- data/lib/factpulse/models/validation_error_response.rb +1 -1
- data/lib/factpulse/models/validation_info.rb +255 -0
- data/lib/factpulse/models/validation_success_response.rb +1 -1
- data/lib/factpulse/models/vat_accounting_code.rb +1 -1
- data/lib/factpulse/models/vat_amount.rb +2 -2
- data/lib/factpulse/models/vat_category.rb +1 -1
- data/lib/factpulse/models/vat_line.rb +13 -3
- data/lib/factpulse/models/{document_type.rb → vat_point_date_code.rb} +8 -10
- data/lib/factpulse/models/vat_rate.rb +104 -0
- data/lib/factpulse/models/verification_success_response.rb +1 -1
- data/lib/factpulse/models/verified_field_schema.rb +1 -1
- data/lib/factpulse/version.rb +2 -2
- data/lib/factpulse.rb +34 -3
- metadata +68 -6
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FactPulse REST API
|
|
3
|
+
|
|
4
|
+
# REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF 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 - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 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://www.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://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.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://www.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://www.factpulse.fr/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://www.factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FactPulse
|
|
17
|
+
# Reponse erreur de conversion.
|
|
18
|
+
class ConvertErrorResponse < ApiModelBase
|
|
19
|
+
attr_accessor :status
|
|
20
|
+
|
|
21
|
+
# Code erreur
|
|
22
|
+
attr_accessor :error
|
|
23
|
+
|
|
24
|
+
# Message d'erreur
|
|
25
|
+
attr_accessor :message
|
|
26
|
+
|
|
27
|
+
attr_accessor :conversion_id
|
|
28
|
+
|
|
29
|
+
attr_accessor :resume_url
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'status' => :'status',
|
|
35
|
+
:'error' => :'error',
|
|
36
|
+
:'message' => :'message',
|
|
37
|
+
:'conversion_id' => :'conversion_id',
|
|
38
|
+
:'resume_url' => :'resume_url'
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns attribute mapping this model knows about
|
|
43
|
+
def self.acceptable_attribute_map
|
|
44
|
+
attribute_map
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns all the JSON keys this model knows about
|
|
48
|
+
def self.acceptable_attributes
|
|
49
|
+
acceptable_attribute_map.values
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute type mapping.
|
|
53
|
+
def self.openapi_types
|
|
54
|
+
{
|
|
55
|
+
:'status' => :'String',
|
|
56
|
+
:'error' => :'String',
|
|
57
|
+
:'message' => :'String',
|
|
58
|
+
:'conversion_id' => :'String',
|
|
59
|
+
:'resume_url' => :'String'
|
|
60
|
+
}
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# List of attributes with nullable: true
|
|
64
|
+
def self.openapi_nullable
|
|
65
|
+
Set.new([
|
|
66
|
+
:'conversion_id',
|
|
67
|
+
:'resume_url'
|
|
68
|
+
])
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Initializes the object
|
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
|
+
def initialize(attributes = {})
|
|
74
|
+
if (!attributes.is_a?(Hash))
|
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::ConvertErrorResponse` initialize method"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
79
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
81
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::ConvertErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
83
|
+
end
|
|
84
|
+
h[k.to_sym] = v
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'status')
|
|
88
|
+
self.status = attributes[:'status']
|
|
89
|
+
else
|
|
90
|
+
self.status = 'error'
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'error')
|
|
94
|
+
self.error = attributes[:'error']
|
|
95
|
+
else
|
|
96
|
+
self.error = nil
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'message')
|
|
100
|
+
self.message = attributes[:'message']
|
|
101
|
+
else
|
|
102
|
+
self.message = nil
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'conversion_id')
|
|
106
|
+
self.conversion_id = attributes[:'conversion_id']
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'resume_url')
|
|
110
|
+
self.resume_url = attributes[:'resume_url']
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
115
|
+
# @return Array for valid properties with the reasons
|
|
116
|
+
def list_invalid_properties
|
|
117
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
118
|
+
invalid_properties = Array.new
|
|
119
|
+
if @error.nil?
|
|
120
|
+
invalid_properties.push('invalid value for "error", error cannot be nil.')
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if @message.nil?
|
|
124
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
invalid_properties
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Check to see if the all the properties in the model are valid
|
|
131
|
+
# @return true if the model is valid
|
|
132
|
+
def valid?
|
|
133
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
134
|
+
return false if @error.nil?
|
|
135
|
+
return false if @message.nil?
|
|
136
|
+
true
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Custom attribute writer method with validation
|
|
140
|
+
# @param [Object] error Value to be assigned
|
|
141
|
+
def error=(error)
|
|
142
|
+
if error.nil?
|
|
143
|
+
fail ArgumentError, 'error cannot be nil'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@error = error
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] message Value to be assigned
|
|
151
|
+
def message=(message)
|
|
152
|
+
if message.nil?
|
|
153
|
+
fail ArgumentError, 'message cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@message = message
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Checks equality by comparing each attribute.
|
|
160
|
+
# @param [Object] Object to be compared
|
|
161
|
+
def ==(o)
|
|
162
|
+
return true if self.equal?(o)
|
|
163
|
+
self.class == o.class &&
|
|
164
|
+
status == o.status &&
|
|
165
|
+
error == o.error &&
|
|
166
|
+
message == o.message &&
|
|
167
|
+
conversion_id == o.conversion_id &&
|
|
168
|
+
resume_url == o.resume_url
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# @see the `==` method
|
|
172
|
+
# @param [Object] Object to be compared
|
|
173
|
+
def eql?(o)
|
|
174
|
+
self == o
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Calculates hash code according to all attributes.
|
|
178
|
+
# @return [Integer] Hash code
|
|
179
|
+
def hash
|
|
180
|
+
[status, error, message, conversion_id, resume_url].hash
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Builds the object from hash
|
|
184
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
185
|
+
# @return [Object] Returns the model itself
|
|
186
|
+
def self.build_from_hash(attributes)
|
|
187
|
+
return nil unless attributes.is_a?(Hash)
|
|
188
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
189
|
+
transformed_hash = {}
|
|
190
|
+
openapi_types.each_pair do |key, type|
|
|
191
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
192
|
+
transformed_hash["#{key}"] = nil
|
|
193
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
194
|
+
# check to ensure the input is an array given that the attribute
|
|
195
|
+
# is documented as an array but the input is not
|
|
196
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
197
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
198
|
+
end
|
|
199
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
200
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
new(transformed_hash)
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Returns the object in the form of hash
|
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
|
208
|
+
def to_hash
|
|
209
|
+
hash = {}
|
|
210
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
211
|
+
value = self.send(attr)
|
|
212
|
+
if value.nil?
|
|
213
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
214
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
hash[param] = _to_hash(value)
|
|
218
|
+
end
|
|
219
|
+
hash
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
end
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FactPulse REST API
|
|
3
|
+
|
|
4
|
+
# REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF 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 - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 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://www.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://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.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://www.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://www.factpulse.fr/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://www.factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FactPulse
|
|
17
|
+
# Reponse donnees manquantes.
|
|
18
|
+
class ConvertPendingInputResponse < ApiModelBase
|
|
19
|
+
attr_accessor :status
|
|
20
|
+
|
|
21
|
+
attr_accessor :conversion_id
|
|
22
|
+
|
|
23
|
+
attr_accessor :message
|
|
24
|
+
|
|
25
|
+
attr_accessor :extraction
|
|
26
|
+
|
|
27
|
+
# Donnees extraites par OCR au format FacturXInvoice
|
|
28
|
+
attr_accessor :extracted_data
|
|
29
|
+
|
|
30
|
+
attr_accessor :missing_fields
|
|
31
|
+
|
|
32
|
+
attr_accessor :resume_url
|
|
33
|
+
|
|
34
|
+
attr_accessor :expires_at
|
|
35
|
+
|
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
|
+
def self.attribute_map
|
|
38
|
+
{
|
|
39
|
+
:'status' => :'status',
|
|
40
|
+
:'conversion_id' => :'conversion_id',
|
|
41
|
+
:'message' => :'message',
|
|
42
|
+
:'extraction' => :'extraction',
|
|
43
|
+
:'extracted_data' => :'extracted_data',
|
|
44
|
+
:'missing_fields' => :'missing_fields',
|
|
45
|
+
:'resume_url' => :'resume_url',
|
|
46
|
+
:'expires_at' => :'expires_at'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Returns attribute mapping this model knows about
|
|
51
|
+
def self.acceptable_attribute_map
|
|
52
|
+
attribute_map
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns all the JSON keys this model knows about
|
|
56
|
+
def self.acceptable_attributes
|
|
57
|
+
acceptable_attribute_map.values
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Attribute type mapping.
|
|
61
|
+
def self.openapi_types
|
|
62
|
+
{
|
|
63
|
+
:'status' => :'String',
|
|
64
|
+
:'conversion_id' => :'String',
|
|
65
|
+
:'message' => :'String',
|
|
66
|
+
:'extraction' => :'ExtractionInfo',
|
|
67
|
+
:'extracted_data' => :'Hash<String, Object>',
|
|
68
|
+
:'missing_fields' => :'Array<MissingField>',
|
|
69
|
+
:'resume_url' => :'String',
|
|
70
|
+
:'expires_at' => :'Time'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# List of attributes with nullable: true
|
|
75
|
+
def self.openapi_nullable
|
|
76
|
+
Set.new([
|
|
77
|
+
])
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Initializes the object
|
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
82
|
+
def initialize(attributes = {})
|
|
83
|
+
if (!attributes.is_a?(Hash))
|
|
84
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::ConvertPendingInputResponse` initialize method"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
88
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
89
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
90
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::ConvertPendingInputResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
92
|
+
end
|
|
93
|
+
h[k.to_sym] = v
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'status')
|
|
97
|
+
self.status = attributes[:'status']
|
|
98
|
+
else
|
|
99
|
+
self.status = 'pending_input'
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'conversion_id')
|
|
103
|
+
self.conversion_id = attributes[:'conversion_id']
|
|
104
|
+
else
|
|
105
|
+
self.conversion_id = nil
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'message')
|
|
109
|
+
self.message = attributes[:'message']
|
|
110
|
+
else
|
|
111
|
+
self.message = 'Donnees manquantes requises pour la conformite'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'extraction')
|
|
115
|
+
self.extraction = attributes[:'extraction']
|
|
116
|
+
else
|
|
117
|
+
self.extraction = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'extracted_data')
|
|
121
|
+
if (value = attributes[:'extracted_data']).is_a?(Hash)
|
|
122
|
+
self.extracted_data = value
|
|
123
|
+
end
|
|
124
|
+
else
|
|
125
|
+
self.extracted_data = nil
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'missing_fields')
|
|
129
|
+
if (value = attributes[:'missing_fields']).is_a?(Array)
|
|
130
|
+
self.missing_fields = value
|
|
131
|
+
end
|
|
132
|
+
else
|
|
133
|
+
self.missing_fields = nil
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'resume_url')
|
|
137
|
+
self.resume_url = attributes[:'resume_url']
|
|
138
|
+
else
|
|
139
|
+
self.resume_url = nil
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'expires_at')
|
|
143
|
+
self.expires_at = attributes[:'expires_at']
|
|
144
|
+
else
|
|
145
|
+
self.expires_at = nil
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
150
|
+
# @return Array for valid properties with the reasons
|
|
151
|
+
def list_invalid_properties
|
|
152
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
153
|
+
invalid_properties = Array.new
|
|
154
|
+
if @conversion_id.nil?
|
|
155
|
+
invalid_properties.push('invalid value for "conversion_id", conversion_id cannot be nil.')
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if @extraction.nil?
|
|
159
|
+
invalid_properties.push('invalid value for "extraction", extraction cannot be nil.')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if @extracted_data.nil?
|
|
163
|
+
invalid_properties.push('invalid value for "extracted_data", extracted_data cannot be nil.')
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if @missing_fields.nil?
|
|
167
|
+
invalid_properties.push('invalid value for "missing_fields", missing_fields cannot be nil.')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if @resume_url.nil?
|
|
171
|
+
invalid_properties.push('invalid value for "resume_url", resume_url cannot be nil.')
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if @expires_at.nil?
|
|
175
|
+
invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
invalid_properties
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Check to see if the all the properties in the model are valid
|
|
182
|
+
# @return true if the model is valid
|
|
183
|
+
def valid?
|
|
184
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
185
|
+
return false if @conversion_id.nil?
|
|
186
|
+
return false if @extraction.nil?
|
|
187
|
+
return false if @extracted_data.nil?
|
|
188
|
+
return false if @missing_fields.nil?
|
|
189
|
+
return false if @resume_url.nil?
|
|
190
|
+
return false if @expires_at.nil?
|
|
191
|
+
true
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Custom attribute writer method with validation
|
|
195
|
+
# @param [Object] conversion_id Value to be assigned
|
|
196
|
+
def conversion_id=(conversion_id)
|
|
197
|
+
if conversion_id.nil?
|
|
198
|
+
fail ArgumentError, 'conversion_id cannot be nil'
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
@conversion_id = conversion_id
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Custom attribute writer method with validation
|
|
205
|
+
# @param [Object] extraction Value to be assigned
|
|
206
|
+
def extraction=(extraction)
|
|
207
|
+
if extraction.nil?
|
|
208
|
+
fail ArgumentError, 'extraction cannot be nil'
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
@extraction = extraction
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Custom attribute writer method with validation
|
|
215
|
+
# @param [Object] extracted_data Value to be assigned
|
|
216
|
+
def extracted_data=(extracted_data)
|
|
217
|
+
if extracted_data.nil?
|
|
218
|
+
fail ArgumentError, 'extracted_data cannot be nil'
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
@extracted_data = extracted_data
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Custom attribute writer method with validation
|
|
225
|
+
# @param [Object] missing_fields Value to be assigned
|
|
226
|
+
def missing_fields=(missing_fields)
|
|
227
|
+
if missing_fields.nil?
|
|
228
|
+
fail ArgumentError, 'missing_fields cannot be nil'
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
@missing_fields = missing_fields
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Custom attribute writer method with validation
|
|
235
|
+
# @param [Object] resume_url Value to be assigned
|
|
236
|
+
def resume_url=(resume_url)
|
|
237
|
+
if resume_url.nil?
|
|
238
|
+
fail ArgumentError, 'resume_url cannot be nil'
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
@resume_url = resume_url
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Custom attribute writer method with validation
|
|
245
|
+
# @param [Object] expires_at Value to be assigned
|
|
246
|
+
def expires_at=(expires_at)
|
|
247
|
+
if expires_at.nil?
|
|
248
|
+
fail ArgumentError, 'expires_at cannot be nil'
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
@expires_at = expires_at
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Checks equality by comparing each attribute.
|
|
255
|
+
# @param [Object] Object to be compared
|
|
256
|
+
def ==(o)
|
|
257
|
+
return true if self.equal?(o)
|
|
258
|
+
self.class == o.class &&
|
|
259
|
+
status == o.status &&
|
|
260
|
+
conversion_id == o.conversion_id &&
|
|
261
|
+
message == o.message &&
|
|
262
|
+
extraction == o.extraction &&
|
|
263
|
+
extracted_data == o.extracted_data &&
|
|
264
|
+
missing_fields == o.missing_fields &&
|
|
265
|
+
resume_url == o.resume_url &&
|
|
266
|
+
expires_at == o.expires_at
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# @see the `==` method
|
|
270
|
+
# @param [Object] Object to be compared
|
|
271
|
+
def eql?(o)
|
|
272
|
+
self == o
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# Calculates hash code according to all attributes.
|
|
276
|
+
# @return [Integer] Hash code
|
|
277
|
+
def hash
|
|
278
|
+
[status, conversion_id, message, extraction, extracted_data, missing_fields, resume_url, expires_at].hash
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Builds the object from hash
|
|
282
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
283
|
+
# @return [Object] Returns the model itself
|
|
284
|
+
def self.build_from_hash(attributes)
|
|
285
|
+
return nil unless attributes.is_a?(Hash)
|
|
286
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
287
|
+
transformed_hash = {}
|
|
288
|
+
openapi_types.each_pair do |key, type|
|
|
289
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
290
|
+
transformed_hash["#{key}"] = nil
|
|
291
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
292
|
+
# check to ensure the input is an array given that the attribute
|
|
293
|
+
# is documented as an array but the input is not
|
|
294
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
295
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
296
|
+
end
|
|
297
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
298
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
new(transformed_hash)
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# Returns the object in the form of hash
|
|
305
|
+
# @return [Hash] Returns the object in the form of hash
|
|
306
|
+
def to_hash
|
|
307
|
+
hash = {}
|
|
308
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
309
|
+
value = self.send(attr)
|
|
310
|
+
if value.nil?
|
|
311
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
312
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
hash[param] = _to_hash(value)
|
|
316
|
+
end
|
|
317
|
+
hash
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
end
|