Module: FactPulse

Defined in:
lib/factpulse/version.rb,
lib/factpulse.rb,
lib/factpulse/api_error.rb,
lib/factpulse/api_client.rb,
lib/factpulse/api/user_api.rb,
lib/factpulse/models/payee.rb,
lib/factpulse/configuration.rb,
lib/factpulse/api/health_api.rb,
lib/factpulse/api_model_base.rb,
lib/factpulse/helpers/client.rb,
lib/factpulse/helpers/helpers.rb,
lib/factpulse/models/quantity.rb,
lib/factpulse/models/supplier.rb,
lib/factpulse/models/vat_line.rb,
lib/factpulse/models/api_error.rb,
lib/factpulse/models/flow_type.rb,
lib/factpulse/models/recipient.rb,
lib/factpulse/models/scheme_id.rb,
lib/factpulse/models/amount_due.rb,
lib/factpulse/models/vat_amount.rb,
lib/factpulse/api/afnorpdppa_api.rb,
lib/factpulse/api/chorus_pro_api.rb,
lib/factpulse/helpers/exceptions.rb,
lib/factpulse/models/api_profile.rb,
lib/factpulse/models/destination.rb,
lib/factpulse/models/error_level.rb,
lib/factpulse/models/flow_syntax.rb,
lib/factpulse/models/manual_rate.rb,
lib/factpulse/models/afnor_result.rb,
lib/factpulse/models/error_source.rb,
lib/factpulse/models/field_status.rb,
lib/factpulse/models/flow_profile.rb,
lib/factpulse/models/flow_summary.rb,
lib/factpulse/models/invoice_line.rb,
lib/factpulse/models/invoice_note.rb,
lib/factpulse/models/vat_category.rb,
lib/factpulse/models/celery_status.rb,
lib/factpulse/models/document_type.rb,
lib/factpulse/models/output_format.rb,
lib/factpulse/models/payment_means.rb,
lib/factpulse/models/task_response.rb,
lib/factpulse/models/flow_direction.rb,
lib/factpulse/models/invoice_format.rb,
lib/factpulse/models/invoice_status.rb,
lib/factpulse/models/invoice_totals.rb,
lib/factpulse/models/postal_address.rb,
lib/factpulse/models/signature_info.rb,
lib/factpulse/models/structure_info.rb,
lib/factpulse/models/taxable_amount.rb,
lib/factpulse/models/unit_net_price.rb,
lib/factpulse/models/line_net_amount.rb,
lib/factpulse/models/manual_vat_rate.rb,
lib/factpulse/models/pdp_credentials.rb,
lib/factpulse/models/submission_mode.rb,
lib/factpulse/models/unit_of_measure.rb,
lib/factpulse/models/factur_x_invoice.rb,
lib/factpulse/models/factur_xpdf_info.rb,
lib/factpulse/models/incoming_invoice.rb,
lib/factpulse/models/operation_nature.rb,
lib/factpulse/models/total_net_amount.rb,
lib/factpulse/models/total_vat_amount.rb,
lib/factpulse/models/validation_error.rb,
lib/factpulse/models/afnor_credentials.rb,
lib/factpulse/models/afnor_destination.rb,
lib/factpulse/models/async_task_status.rb,
lib/factpulse/models/chorus_pro_result.rb,
lib/factpulse/models/incoming_supplier.rb,
lib/factpulse/models/invoice_type_code.rb,
lib/factpulse/models/structure_service.rb,
lib/factpulse/models/submit_net_amount.rb,
lib/factpulse/models/submit_vat_amount.rb,
lib/factpulse/models/electronic_address.rb,
lib/factpulse/models/invoice_references.rb,
lib/factpulse/models/processing_options.rb,
lib/factpulse/models/signature_info_api.rb,
lib/factpulse/models/total_gross_amount.rb,
lib/factpulse/api/invoice_processing_api.rb,
lib/factpulse/models/bounding_box_schema.rb,
lib/factpulse/models/get_invoice_request.rb,
lib/factpulse/models/invoicing_framework.rb,
lib/factpulse/models/search_flow_request.rb,
lib/factpulse/models/submit_flow_request.rb,
lib/factpulse/models/submit_gross_amount.rb,
lib/factpulse/models/vat_accounting_code.rb,
lib/factpulse/api/pdfxml_verification_api.rb,
lib/factpulse/models/get_invoice_response.rb,
lib/factpulse/models/search_flow_response.rb,
lib/factpulse/models/signature_parameters.rb,
lib/factpulse/models/structure_parameters.rb,
lib/factpulse/models/submit_flow_response.rb,
lib/factpulse/models/acknowledgment_status.rb,
lib/factpulse/models/allowance_reason_code.rb,
lib/factpulse/models/enriched_invoice_info.rb,
lib/factpulse/models/get_structure_request.rb,
lib/factpulse/models/http_validation_error.rb,
lib/factpulse/models/mandatory_note_schema.rb,
lib/factpulse/models/verified_field_schema.rb,
lib/factpulse/models/chorus_pro_destination.rb,
lib/factpulse/models/get_structure_response.rb,
lib/factpulse/models/page_dimensions_schema.rb,
lib/factpulse/models/submit_invoice_request.rb,
lib/factpulse/models/global_allowance_amount.rb,
lib/factpulse/models/simplified_invoice_data.rb,
lib/factpulse/models/submit_invoice_response.rb,
lib/factpulse/models/validation_error_detail.rb,
lib/factpulse/api/afnorpdppa_flow_service_api.rb,
lib/factpulse/models/invoicing_framework_code.rb,
lib/factpulse/models/search_services_response.rb,
lib/factpulse/models/search_structure_request.rb,
lib/factpulse/models/supplementary_attachment.rb,
lib/factpulse/models/certificate_info_response.rb,
lib/factpulse/models/get_chorus_pro_id_request.rb,
lib/factpulse/models/invoice_totals_prepayment.rb,
lib/factpulse/models/pdf_validation_result_api.rb,
lib/factpulse/models/search_structure_response.rb,
lib/factpulse/models/validation_error_response.rb,
lib/factpulse/models/get_chorus_pro_id_response.rb,
lib/factpulse/models/validation_error_loc_inner.rb,
lib/factpulse/models/afnor_health_check_response.rb,
lib/factpulse/models/validation_success_response.rb,
lib/factpulse/models/generate_certificate_request.rb,
lib/factpulse/api/afnorpdppa_directory_service_api.rb,
lib/factpulse/models/generate_certificate_response.rb,
lib/factpulse/models/invoice_line_allowance_amount.rb,
lib/factpulse/models/verification_success_response.rb,
lib/factpulse/models/submit_complete_invoice_request.rb,
lib/factpulse/models/submit_complete_invoice_response.rb,
lib/factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.rb,
lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb

Overview

#FactPulse REST API

# 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: `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: www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** “`bash curl -X POST www.factpulse.fr/api/token/ \ -H "Content-Type: application/json" \ -d ’{ "username": "[email protected]", "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 www.factpulse.fr/api/token/ \ -H "Content-Type: application/json" \ -d ’{ "username": "[email protected]", "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: 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: www.factpulse.fr/documentation-api/

The version of the OpenAPI document: 1.0.0

Generated by: openapi-generator.tech Generator version: 7.18.0-SNAPSHOT

Defined Under Namespace

Modules: AmountDue, Destination, GlobalAllowanceAmount, Helpers, InvoiceLineAllowanceAmount, InvoiceTotalsPrepayment, LineNetAmount, ManualRate, ManualVatRate, Quantity, SubmitGrossAmount, SubmitNetAmount, SubmitVatAmount, TaxableAmount, TotalGrossAmount, TotalNetAmount, TotalVATAmount, UnitNetPrice, VATAmount, ValidationErrorLocInner Classes: AFNORCredentials, AFNORDestination, AFNORHealthCheckResponse, AFNORPDPPAApi, AFNORPDPPADirectoryServiceApi, AFNORPDPPAFlowServiceApi, AFNORResult, APIError, APIProfile, AcknowledgmentStatus, AllowanceReasonCode, ApiClient, ApiError, ApiModelBase, AsyncTaskStatus, BoundingBoxSchema, CeleryStatus, CertificateInfoResponse, ChorusProApi, ChorusProDestination, ChorusProResult, Configuration, DocumentType, ElectronicAddress, EnrichedInvoiceInfo, ErrorLevel, ErrorSource, FacturXInvoice, FacturXPDFInfo, FactureElectroniqueRestApiSchemasChorusProChorusProCredentials, FactureElectroniqueRestApiSchemasProcessingChorusProCredentials, FieldStatus, FlowDirection, FlowProfile, FlowSummary, FlowSyntax, FlowType, GenerateCertificateRequest, GenerateCertificateResponse, GetChorusProIdRequest, GetChorusProIdResponse, GetInvoiceRequest, GetInvoiceResponse, GetStructureRequest, GetStructureResponse, HTTPValidationError, HealthApi, IncomingInvoice, IncomingSupplier, InvoiceFormat, InvoiceLine, InvoiceNote, InvoiceProcessingApi, InvoiceReferences, InvoiceStatus, InvoiceTotals, InvoiceTypeCode, InvoicingFramework, InvoicingFrameworkCode, MandatoryNoteSchema, OperationNature, OutputFormat, PDFValidationResultAPI, PDFXMLVerificationApi, PDPCredentials, PageDimensionsSchema, Payee, PaymentMeans, PostalAddress, ProcessingOptions, Recipient, SchemeID, SearchFlowRequest, SearchFlowResponse, SearchServicesResponse, SearchStructureRequest, SearchStructureResponse, SignatureInfo, SignatureInfoAPI, SignatureParameters, SimplifiedInvoiceData, StructureInfo, StructureParameters, StructureService, SubmissionMode, SubmitCompleteInvoiceRequest, SubmitCompleteInvoiceResponse, SubmitFlowRequest, SubmitFlowResponse, SubmitInvoiceRequest, SubmitInvoiceResponse, SupplementaryAttachment, Supplier, TaskResponse, UnitOfMeasure, UserApi, VATAccountingCode, VATCategory, VATLine, ValidationError, ValidationErrorDetail, ValidationErrorResponse, ValidationSuccessResponse, VerificationSuccessResponse, VerifiedFieldSchema

Constant Summary collapse

VERSION =
'3.0.5'

Class Method Summary collapse

Class Method Details

.configureObject

Customize default settings for the SDK using block.

FactPulse.configure do |config|
  config.username = "xxx"
  config.password = "xxx"
end

If no block given, return the default Configuration object.



152
153
154
155
156
157
158
# File 'lib/factpulse.rb', line 152

def configure
  if block_given?
    yield(Configuration.default)
  else
    Configuration.default
  end
end