factpulse 3.0.7__py3-none-any.whl → 3.0.23__py3-none-any.whl
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.
Potentially problematic release.
This version of factpulse might be problematic. Click here for more details.
- factpulse/__init__.py +289 -12
- factpulse/api/__init__.py +2 -0
- factpulse/api/afnorpdppa_api.py +16 -14
- factpulse/api/afnorpdppa_directory_service_api.py +1224 -309
- factpulse/api/afnorpdppa_flow_service_api.py +199 -68
- factpulse/api/chorus_pro_api.py +61 -8
- factpulse/api/document_conversion_api.py +54 -338
- factpulse/api/downloads_api.py +1171 -0
- factpulse/api/e_reporting_api.py +3254 -0
- factpulse/api/health_api.py +8 -1
- factpulse/api/invoice_processing_api.py +234 -37
- factpulse/api/pdfxml_verification_api.py +98 -19
- factpulse/api/user_api.py +5 -1
- factpulse/api_client.py +3 -2
- factpulse/configuration.py +10 -5
- factpulse/exceptions.py +2 -1
- factpulse/models/__init__.py +143 -6
- factpulse/models/accept_language.py +38 -0
- factpulse/models/acknowledgment_status.py +2 -1
- factpulse/models/additional_document.py +2 -1
- factpulse/models/afnor_acknowledgement.py +100 -0
- factpulse/models/afnor_acknowledgement_detail.py +105 -0
- factpulse/models/afnor_address_edit.py +111 -0
- factpulse/models/afnor_address_patch.py +141 -0
- factpulse/models/afnor_address_put.py +129 -0
- factpulse/models/afnor_address_read.py +113 -0
- factpulse/models/afnor_algorithm.py +41 -0
- factpulse/models/afnor_contains_operator.py +37 -0
- factpulse/models/afnor_create_directory_line_body.py +98 -0
- factpulse/models/afnor_create_directory_line_body_addressing_information.py +122 -0
- factpulse/models/afnor_create_directory_line_body_period.py +91 -0
- factpulse/models/afnor_create_routing_code_body.py +153 -0
- factpulse/models/afnor_credentials.py +2 -1
- factpulse/models/afnor_destination.py +15 -15
- factpulse/models/afnor_diffusion_status.py +38 -0
- factpulse/models/afnor_directory_line_field.py +42 -0
- factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code.py +139 -0
- factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_platform.py +92 -0
- factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_routing_code.py +134 -0
- factpulse/models/afnor_directory_line_post201_response.py +94 -0
- factpulse/models/afnor_directory_line_search_post200_response.py +104 -0
- factpulse/models/afnor_entity_type.py +38 -0
- factpulse/models/afnor_error.py +97 -0
- factpulse/models/afnor_facility_administrative_status.py +38 -0
- factpulse/models/afnor_facility_nature.py +38 -0
- factpulse/models/afnor_facility_payload_history.py +140 -0
- factpulse/models/afnor_facility_payload_history_ule_b2g_additional_data.py +98 -0
- factpulse/models/afnor_facility_payload_included.py +134 -0
- factpulse/models/afnor_facility_type.py +38 -0
- factpulse/models/afnor_flow.py +129 -0
- factpulse/models/afnor_flow_ack_status.py +39 -0
- factpulse/models/afnor_flow_direction.py +38 -0
- factpulse/models/afnor_flow_info.py +112 -0
- factpulse/models/afnor_flow_profile.py +39 -0
- factpulse/models/afnor_flow_syntax.py +41 -0
- factpulse/models/afnor_flow_type.py +49 -0
- factpulse/models/afnor_full_flow_info.py +117 -0
- factpulse/models/afnor_health_check_response.py +2 -1
- factpulse/models/afnor_legal_unit_administrative_status.py +38 -0
- factpulse/models/afnor_legal_unit_payload_history.py +107 -0
- factpulse/models/afnor_legal_unit_payload_included.py +107 -0
- factpulse/models/afnor_legal_unit_payload_included_no_siren.py +95 -0
- factpulse/models/afnor_platform_status.py +38 -0
- factpulse/models/afnor_processing_rule.py +42 -0
- factpulse/models/afnor_reason_code.py +141 -0
- factpulse/models/afnor_reason_code_enum.py +51 -0
- factpulse/models/afnor_recipient_platform_type.py +38 -0
- factpulse/models/afnor_result.py +25 -3
- factpulse/models/afnor_routing_code_administrative_status.py +38 -0
- factpulse/models/afnor_routing_code_field.py +44 -0
- factpulse/models/afnor_routing_code_payload_history_legal_unit_facility.py +158 -0
- factpulse/models/afnor_routing_code_post201_response.py +113 -0
- factpulse/models/afnor_routing_code_search.py +122 -0
- factpulse/models/afnor_routing_code_search_filters.py +128 -0
- factpulse/models/afnor_routing_code_search_filters_administrative_status.py +92 -0
- factpulse/models/afnor_routing_code_search_filters_routing_code_name.py +102 -0
- factpulse/models/afnor_routing_code_search_filters_routing_identifier.py +102 -0
- factpulse/models/afnor_routing_code_search_post200_response.py +104 -0
- factpulse/models/afnor_routing_code_search_sorting_inner.py +92 -0
- factpulse/models/afnor_search_directory_line.py +109 -0
- factpulse/models/afnor_search_directory_line_filters.py +116 -0
- factpulse/models/afnor_search_directory_line_filters_addressing_identifier.py +92 -0
- factpulse/models/afnor_search_directory_line_filters_addressing_suffix.py +92 -0
- factpulse/models/afnor_search_directory_line_sorting_inner.py +92 -0
- factpulse/models/afnor_search_flow_content.py +104 -0
- factpulse/models/afnor_search_flow_filters.py +106 -0
- factpulse/models/afnor_search_flow_params.py +95 -0
- factpulse/models/afnor_search_siren.py +109 -0
- factpulse/models/afnor_search_siren_filters.py +110 -0
- factpulse/models/afnor_search_siren_filters_administrative_status.py +92 -0
- factpulse/models/afnor_search_siren_filters_business_name.py +92 -0
- factpulse/models/afnor_search_siren_filters_entity_type.py +92 -0
- factpulse/models/afnor_search_siren_filters_siren.py +102 -0
- factpulse/models/afnor_search_siren_sorting_inner.py +92 -0
- factpulse/models/afnor_search_siret.py +122 -0
- factpulse/models/afnor_search_siret_filters.py +140 -0
- factpulse/models/afnor_search_siret_filters_address_lines.py +92 -0
- factpulse/models/afnor_search_siret_filters_administrative_status.py +92 -0
- factpulse/models/afnor_search_siret_filters_country_subdivision.py +92 -0
- factpulse/models/afnor_search_siret_filters_facility_type.py +92 -0
- factpulse/models/afnor_search_siret_filters_locality.py +92 -0
- factpulse/models/afnor_search_siret_filters_name.py +92 -0
- factpulse/models/afnor_search_siret_filters_postal_code.py +102 -0
- factpulse/models/afnor_search_siret_filters_siret.py +102 -0
- factpulse/models/afnor_search_siret_sorting_inner.py +92 -0
- factpulse/models/afnor_siren_field.py +41 -0
- factpulse/models/afnor_siren_search_post200_response.py +104 -0
- factpulse/models/afnor_siret_field.py +50 -0
- factpulse/models/afnor_siret_search_post200_response.py +104 -0
- factpulse/models/afnor_sorting_order.py +38 -0
- factpulse/models/afnor_strict_operator.py +37 -0
- factpulse/models/afnor_update_patch_directory_line_body.py +89 -0
- factpulse/models/afnor_update_patch_routing_code_body.py +120 -0
- factpulse/models/afnor_update_put_routing_code_body.py +114 -0
- factpulse/models/afnor_webhook_callback_content.py +92 -0
- factpulse/models/aggregated_payment_input.py +106 -0
- factpulse/models/aggregated_transaction_input.py +136 -0
- factpulse/models/allowance_charge.py +9 -6
- factpulse/models/allowance_charge_reason_code.py +74 -0
- factpulse/models/allowance_reason_code.py +2 -1
- factpulse/models/allowance_total_amount.py +2 -1
- factpulse/models/amount.py +3 -2
- factpulse/models/amount1.py +140 -0
- factpulse/models/amount_due.py +2 -1
- factpulse/models/api_error.py +2 -1
- factpulse/models/api_profile.py +41 -0
- factpulse/models/async_task_status.py +2 -1
- factpulse/models/base_amount.py +2 -1
- factpulse/models/bounding_box_schema.py +2 -1
- factpulse/models/buyercountry.py +137 -0
- factpulse/models/celery_status.py +2 -1
- factpulse/models/certificate_info_response.py +2 -1
- factpulse/models/charge_total_amount.py +2 -1
- factpulse/models/{facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.py → chorus_pro_credentials.py} +5 -4
- factpulse/models/chorus_pro_destination.py +2 -1
- factpulse/models/chorus_pro_result.py +2 -1
- factpulse/models/contact.py +2 -1
- factpulse/models/convert_resume_request.py +2 -1
- factpulse/models/convert_success_response.py +2 -1
- factpulse/models/convert_validation_failed_response.py +7 -6
- factpulse/models/country_code.py +206 -0
- factpulse/models/create_aggregated_report_request.py +170 -0
- factpulse/models/create_e_reporting_request.py +173 -0
- factpulse/models/currency.py +137 -0
- factpulse/models/currency_code.py +89 -0
- factpulse/models/delivery_party.py +2 -1
- factpulse/models/destination.py +2 -1
- factpulse/models/directory_line_include.py +40 -0
- factpulse/models/doc_type.py +40 -0
- factpulse/models/document_type_info.py +2 -1
- factpulse/models/e_reporting_flow_type.py +40 -0
- factpulse/models/{convert_error_response.py → e_reporting_validation_error.py} +15 -23
- factpulse/models/electronic_address.py +4 -3
- factpulse/models/enriched_invoice_info.py +8 -7
- factpulse/models/error_level.py +2 -1
- factpulse/models/error_source.py +2 -1
- factpulse/models/extraction_info.py +2 -1
- factpulse/models/factur_x_invoice.py +2 -1
- factpulse/models/factur_xpdf_info.py +2 -1
- factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.py +41 -0
- factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.py +2 -1
- factpulse/models/field_status.py +2 -1
- factpulse/models/file_info.py +2 -1
- factpulse/models/files_info.py +2 -1
- factpulse/models/flow_direction.py +2 -1
- factpulse/models/flow_profile.py +2 -1
- factpulse/models/flow_summary.py +5 -4
- factpulse/models/flow_syntax.py +2 -1
- factpulse/models/flow_type.py +12 -3
- factpulse/models/generate_aggregated_report_response.py +100 -0
- factpulse/models/generate_certificate_request.py +2 -1
- factpulse/models/generate_certificate_response.py +2 -1
- factpulse/models/generate_e_reporting_response.py +96 -0
- factpulse/models/get_chorus_pro_id_request.py +5 -4
- factpulse/models/get_chorus_pro_id_response.py +2 -1
- factpulse/models/get_invoice_request.py +5 -4
- factpulse/models/get_invoice_response.py +4 -3
- factpulse/models/get_structure_request.py +5 -4
- factpulse/models/get_structure_response.py +4 -3
- factpulse/models/global_allowance_amount.py +2 -1
- factpulse/models/gross_unit_price.py +2 -1
- factpulse/models/http_validation_error.py +2 -1
- factpulse/models/incoming_invoice.py +8 -29
- factpulse/models/incoming_supplier.py +2 -1
- factpulse/models/invoice_format.py +2 -1
- factpulse/models/invoice_input.py +179 -0
- factpulse/models/invoice_line.py +18 -2
- factpulse/models/invoice_line_allowance_amount.py +2 -1
- factpulse/models/invoice_note.py +4 -3
- factpulse/models/invoice_payment_input.py +110 -0
- factpulse/models/invoice_references.py +2 -1
- factpulse/models/invoice_status.py +2 -1
- factpulse/models/invoice_totals.py +2 -1
- factpulse/models/invoice_totals_prepayment.py +2 -1
- factpulse/models/invoice_type_code.py +2 -1
- factpulse/models/invoice_type_code_output.py +52 -0
- factpulse/models/invoicing_framework.py +4 -3
- factpulse/models/invoicing_framework_code.py +2 -1
- factpulse/models/line_net_amount.py +2 -1
- factpulse/models/line_sub_type.py +39 -0
- factpulse/models/line_total_amount.py +2 -1
- factpulse/models/{validation_error_loc_inner.py → location_inner.py} +8 -7
- factpulse/models/mandatory_note_schema.py +2 -1
- factpulse/models/manual_rate.py +2 -1
- factpulse/models/manual_vat_rate.py +2 -1
- factpulse/models/missing_field.py +2 -1
- factpulse/models/operation_nature.py +2 -1
- factpulse/models/output_format.py +2 -1
- factpulse/models/page_dimensions_schema.py +2 -1
- factpulse/models/payee.py +2 -1
- factpulse/models/payment_amount_by_rate.py +98 -0
- factpulse/models/payment_card.py +2 -1
- factpulse/models/payment_means.py +2 -1
- factpulse/models/pdf_validation_result_api.py +2 -1
- factpulse/models/pdp_credentials.py +2 -1
- factpulse/models/percentage.py +2 -1
- factpulse/models/postal_address.py +2 -1
- factpulse/models/price_allowance_amount.py +2 -1
- factpulse/models/price_basis_quantity.py +2 -1
- factpulse/models/processing_options.py +4 -3
- factpulse/models/processing_rule.py +42 -0
- factpulse/models/product_characteristic.py +2 -1
- factpulse/models/product_classification.py +2 -1
- factpulse/models/quantity.py +2 -1
- factpulse/models/rate.py +140 -0
- factpulse/models/rate1.py +140 -0
- factpulse/models/recipient.py +2 -1
- factpulse/models/report_period.py +91 -0
- factpulse/models/report_sender.py +98 -0
- factpulse/models/rounding_amount.py +2 -1
- factpulse/models/routing_code_include.py +38 -0
- factpulse/models/schematron_validation_error.py +128 -0
- factpulse/models/scheme_id.py +9 -1
- factpulse/models/search_flow_request.py +2 -1
- factpulse/models/search_flow_response.py +2 -1
- factpulse/models/search_services_response.py +5 -4
- factpulse/models/search_structure_request.py +5 -4
- factpulse/models/search_structure_response.py +2 -1
- factpulse/models/sellercountry.py +137 -0
- factpulse/models/signature_info.py +2 -1
- factpulse/models/signature_info_api.py +2 -1
- factpulse/models/signature_parameters.py +2 -1
- factpulse/models/simplified_invoice_data.py +30 -3
- factpulse/models/siret_include.py +37 -0
- factpulse/models/structure_info.py +2 -1
- factpulse/models/structure_parameters.py +2 -1
- factpulse/models/structure_service.py +2 -1
- factpulse/models/submission_mode.py +2 -1
- factpulse/models/submit_aggregated_report_request.py +127 -0
- factpulse/models/submit_complete_invoice_request.py +2 -1
- factpulse/models/submit_complete_invoice_response.py +2 -1
- factpulse/models/submit_e_reporting_request.py +127 -0
- factpulse/models/submit_e_reporting_response.py +117 -0
- factpulse/models/submit_flow_request.py +2 -1
- factpulse/models/submit_flow_response.py +2 -1
- factpulse/models/submit_gross_amount.py +2 -1
- factpulse/models/submit_invoice_request.py +5 -4
- factpulse/models/submit_invoice_response.py +2 -1
- factpulse/models/submit_net_amount.py +2 -1
- factpulse/models/submit_vat_amount.py +2 -1
- factpulse/models/supplementary_attachment.py +7 -6
- factpulse/models/supplier.py +2 -1
- factpulse/models/task_response.py +2 -1
- factpulse/models/tax_breakdown_input.py +104 -0
- factpulse/models/tax_due_date_type.py +42 -0
- factpulse/models/tax_representative.py +2 -1
- factpulse/models/taxable_amount.py +2 -1
- factpulse/models/taxableamount.py +140 -0
- factpulse/models/taxamount.py +140 -0
- factpulse/models/taxamount1.py +140 -0
- factpulse/models/taxamount2.py +140 -0
- factpulse/models/taxexclusiveamount.py +140 -0
- factpulse/models/taxexclusiveamount1.py +140 -0
- factpulse/models/total_gross_amount.py +2 -1
- factpulse/models/total_net_amount.py +2 -1
- factpulse/models/total_vat_amount.py +2 -1
- factpulse/models/transaction_category.py +40 -0
- factpulse/models/transmission_type_code.py +38 -0
- factpulse/models/unit_net_price.py +2 -1
- factpulse/models/unit_of_measure.py +2 -1
- factpulse/models/validate_e_reporting_request.py +92 -0
- factpulse/models/validate_e_reporting_response.py +113 -0
- factpulse/models/validation_error.py +5 -4
- factpulse/models/validation_error_detail.py +2 -1
- factpulse/models/validation_error_response.py +2 -1
- factpulse/models/validation_info.py +5 -4
- factpulse/models/validation_success_response.py +2 -1
- factpulse/models/vat_accounting_code.py +2 -1
- factpulse/models/vat_amount.py +2 -1
- factpulse/models/vat_category.py +2 -1
- factpulse/models/vat_line.py +2 -1
- factpulse/models/vat_point_date_code.py +2 -1
- factpulse/models/vat_rate.py +2 -1
- factpulse/models/verification_success_response.py +2 -1
- factpulse/models/verified_field_schema.py +2 -1
- factpulse/rest.py +2 -1
- {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/METADATA +42 -40
- factpulse-3.0.23.dist-info/RECORD +306 -0
- {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/licenses/LICENSE +1 -1
- factpulse_helpers/client.py +2 -1
- factpulse/models/convert_pending_input_response.py +0 -114
- factpulse/models/factur_x_profile.py +0 -39
- factpulse-3.0.7.dist-info/RECORD +0 -168
- {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/WHEEL +0 -0
- {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FactPulse REST API
|
|
5
|
+
|
|
6
|
+
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://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/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: contact@factpulse.fr
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
from enum import Enum
|
|
19
|
+
from typing_extensions import Self
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AFNORFlowDirection(str, Enum):
|
|
23
|
+
"""
|
|
24
|
+
Direction of the flow: - `In`: Incoming flow, from the PDP to the OD - `Out`: Outgoing flow, from the OD to the PDP
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
allowed enum values
|
|
29
|
+
"""
|
|
30
|
+
IN = 'In'
|
|
31
|
+
OUT = 'Out'
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_json(cls, json_str: str) -> Self:
|
|
35
|
+
"""Create an instance of AFNORFlowDirection from a JSON string"""
|
|
36
|
+
return cls(json.loads(json_str))
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FactPulse REST API
|
|
5
|
+
|
|
6
|
+
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://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/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: contact@factpulse.fr
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from factpulse.models.afnor_flow_profile import AFNORFlowProfile
|
|
25
|
+
from factpulse.models.afnor_flow_syntax import AFNORFlowSyntax
|
|
26
|
+
from factpulse.models.afnor_processing_rule import AFNORProcessingRule
|
|
27
|
+
from typing import Optional, Set
|
|
28
|
+
from typing_extensions import Self
|
|
29
|
+
|
|
30
|
+
class AFNORFlowInfo(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
Signaling of the flow: - The tracking id is an external identifier and is used to track the flow by the sender - The sha256 is the fingerprint of the attached file: - if provided in the request: it should be checked once received - if not provided in the request: it should be computed and returned in the response
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
tracking_id: Optional[Annotated[str, Field(strict=True, max_length=36)]] = Field(default=None, description="Unique identifier supporting UUID but not only, for flexibility purpose", alias="trackingId")
|
|
35
|
+
name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Name of the file")
|
|
36
|
+
processing_rule: Optional[AFNORProcessingRule] = Field(default=None, alias="processingRule")
|
|
37
|
+
flow_syntax: AFNORFlowSyntax = Field(alias="flowSyntax")
|
|
38
|
+
flow_profile: Optional[AFNORFlowProfile] = Field(default=None, alias="flowProfile")
|
|
39
|
+
sha256: Optional[Annotated[str, Field(strict=True)]] = None
|
|
40
|
+
__properties: ClassVar[List[str]] = ["trackingId", "name", "processingRule", "flowSyntax", "flowProfile", "sha256"]
|
|
41
|
+
|
|
42
|
+
@field_validator('sha256')
|
|
43
|
+
def sha256_validate_regular_expression(cls, value):
|
|
44
|
+
"""Validates the regular expression"""
|
|
45
|
+
if value is None:
|
|
46
|
+
return value
|
|
47
|
+
|
|
48
|
+
if not re.match(r"^[a-f0-9]{64}$", value):
|
|
49
|
+
raise ValueError(r"must validate the regular expression /^[a-f0-9]{64}$/")
|
|
50
|
+
return value
|
|
51
|
+
|
|
52
|
+
model_config = ConfigDict(
|
|
53
|
+
populate_by_name=True,
|
|
54
|
+
validate_assignment=True,
|
|
55
|
+
protected_namespaces=(),
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def to_str(self) -> str:
|
|
60
|
+
"""Returns the string representation of the model using alias"""
|
|
61
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
62
|
+
|
|
63
|
+
def to_json(self) -> str:
|
|
64
|
+
"""Returns the JSON representation of the model using alias"""
|
|
65
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
66
|
+
return json.dumps(self.to_dict())
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
70
|
+
"""Create an instance of AFNORFlowInfo from a JSON string"""
|
|
71
|
+
return cls.from_dict(json.loads(json_str))
|
|
72
|
+
|
|
73
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
74
|
+
"""Return the dictionary representation of the model using alias.
|
|
75
|
+
|
|
76
|
+
This has the following differences from calling pydantic's
|
|
77
|
+
`self.model_dump(by_alias=True)`:
|
|
78
|
+
|
|
79
|
+
* `None` is only added to the output dict for nullable fields that
|
|
80
|
+
were set at model initialization. Other fields with value `None`
|
|
81
|
+
are ignored.
|
|
82
|
+
"""
|
|
83
|
+
excluded_fields: Set[str] = set([
|
|
84
|
+
])
|
|
85
|
+
|
|
86
|
+
_dict = self.model_dump(
|
|
87
|
+
by_alias=True,
|
|
88
|
+
exclude=excluded_fields,
|
|
89
|
+
exclude_none=True,
|
|
90
|
+
)
|
|
91
|
+
return _dict
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
95
|
+
"""Create an instance of AFNORFlowInfo from a dict"""
|
|
96
|
+
if obj is None:
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
if not isinstance(obj, dict):
|
|
100
|
+
return cls.model_validate(obj)
|
|
101
|
+
|
|
102
|
+
_obj = cls.model_validate({
|
|
103
|
+
"trackingId": obj.get("trackingId"),
|
|
104
|
+
"name": obj.get("name"),
|
|
105
|
+
"processingRule": obj.get("processingRule"),
|
|
106
|
+
"flowSyntax": obj.get("flowSyntax"),
|
|
107
|
+
"flowProfile": obj.get("flowProfile"),
|
|
108
|
+
"sha256": obj.get("sha256")
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FactPulse REST API
|
|
5
|
+
|
|
6
|
+
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://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/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: contact@factpulse.fr
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
from enum import Enum
|
|
19
|
+
from typing_extensions import Self
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AFNORFlowProfile(str, Enum):
|
|
23
|
+
"""
|
|
24
|
+
AFNORFlowProfile
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
allowed enum values
|
|
29
|
+
"""
|
|
30
|
+
BASIC = 'Basic'
|
|
31
|
+
CIUS = 'CIUS'
|
|
32
|
+
EXTENDED_MINUS_CTC_MINUS_FR = 'Extended-CTC-FR'
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
|
36
|
+
"""Create an instance of AFNORFlowProfile from a JSON string"""
|
|
37
|
+
return cls(json.loads(json_str))
|
|
38
|
+
|
|
39
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FactPulse REST API
|
|
5
|
+
|
|
6
|
+
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://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/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: contact@factpulse.fr
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
from enum import Enum
|
|
19
|
+
from typing_extensions import Self
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AFNORFlowSyntax(str, Enum):
|
|
23
|
+
"""
|
|
24
|
+
Syntax of the original file belonging to a flow
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
allowed enum values
|
|
29
|
+
"""
|
|
30
|
+
CII = 'CII'
|
|
31
|
+
UBL = 'UBL'
|
|
32
|
+
FACTUR_MINUS_X = 'Factur-X'
|
|
33
|
+
CDAR = 'CDAR'
|
|
34
|
+
FRR = 'FRR'
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def from_json(cls, json_str: str) -> Self:
|
|
38
|
+
"""Create an instance of AFNORFlowSyntax from a JSON string"""
|
|
39
|
+
return cls(json.loads(json_str))
|
|
40
|
+
|
|
41
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FactPulse REST API
|
|
5
|
+
|
|
6
|
+
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://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/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: contact@factpulse.fr
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
from enum import Enum
|
|
19
|
+
from typing_extensions import Self
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AFNORFlowType(str, Enum):
|
|
23
|
+
"""
|
|
24
|
+
- `CustomerInvoice`: a non-self-billed outgoing invoice or a self-billed incoming invoice - `SupplierInvoice`: a non-self-billed incoming invoice or self-billed outgoing invoice - `StateInvoice`: an invoice Flow sent to DFH - `CustomerInvoiceLC`: a lifecycle (CDAR) related to a customer invoice - `SupplierInvoiceLC`: a lifecycle (CDAR) related to supplier invoice - `StateCustomerInvoiceLC`: a customer invoice LC sent to DFH - `StateSupplierInvoiceLC`: a supplier invoice LC sent to DFH - `AggregatedCustomerTransactionReport` : a transaction E-Reporting flow containing aggregated B2C sales (FRR 10.3) - `IndividualCustomerTransactionReport`: a transaction E-Reporting flow containing international B2B sales or a B2C transaction flow reported individually (FRR 10.1) - `AggregatedCustomerPaymentReport` : a E-Reporting of collections flow containing collections linked to B2C sales (FRR 10.4) - `UnitaryCustomerPaymentReport` : an E-Reporting of collections flow containing collections linked to unit international B2B sales or B2C sales (FRR 10.2) - `UnitarySupplierTransactionReport`: a transaction E-Reporting flow containing international B2B purchases (FRR 10.1) - `MultiFlowReport`: an E-Reporting flow which contains at least 2 different flow types (FRR 10)
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
allowed enum values
|
|
29
|
+
"""
|
|
30
|
+
CUSTOMERINVOICE = 'CustomerInvoice'
|
|
31
|
+
SUPPLIERINVOICE = 'SupplierInvoice'
|
|
32
|
+
STATEINVOICE = 'StateInvoice'
|
|
33
|
+
CUSTOMERINVOICELC = 'CustomerInvoiceLC'
|
|
34
|
+
SUPPLIERINVOICELC = 'SupplierInvoiceLC'
|
|
35
|
+
STATECUSTOMERINVOICELC = 'StateCustomerInvoiceLC'
|
|
36
|
+
STATESUPPLIERINVOICELC = 'StateSupplierInvoiceLC'
|
|
37
|
+
AGGREGATEDCUSTOMERTRANSACTIONREPORT = 'AggregatedCustomerTransactionReport'
|
|
38
|
+
UNITARYCUSTOMERTRANSACTIONREPORT = 'UnitaryCustomerTransactionReport'
|
|
39
|
+
AGGREGATEDCUSTOMERPAYMENTREPORT = 'AggregatedCustomerPaymentReport'
|
|
40
|
+
UNITARYCUSTOMERPAYMENTREPORT = 'UnitaryCustomerPaymentReport'
|
|
41
|
+
UNITARYSUPPLIERTRANSACTIONREPORT = 'UnitarySupplierTransactionReport'
|
|
42
|
+
MULTIFLOWREPORT = 'MultiFlowReport'
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def from_json(cls, json_str: str) -> Self:
|
|
46
|
+
"""Create an instance of AFNORFlowType from a JSON string"""
|
|
47
|
+
return cls(json.loads(json_str))
|
|
48
|
+
|
|
49
|
+
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FactPulse REST API
|
|
5
|
+
|
|
6
|
+
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://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/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: contact@factpulse.fr
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
|
+
from typing_extensions import Annotated
|
|
25
|
+
from factpulse.models.afnor_flow_profile import AFNORFlowProfile
|
|
26
|
+
from factpulse.models.afnor_flow_syntax import AFNORFlowSyntax
|
|
27
|
+
from factpulse.models.afnor_processing_rule import AFNORProcessingRule
|
|
28
|
+
from typing import Optional, Set
|
|
29
|
+
from typing_extensions import Self
|
|
30
|
+
|
|
31
|
+
class AFNORFullFlowInfo(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Identified Flow info: flow info + id + timestamp
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
tracking_id: Optional[Annotated[str, Field(strict=True, max_length=36)]] = Field(default=None, description="Unique identifier supporting UUID but not only, for flexibility purpose", alias="trackingId")
|
|
36
|
+
name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Name of the file")
|
|
37
|
+
processing_rule: Optional[AFNORProcessingRule] = Field(default=None, alias="processingRule")
|
|
38
|
+
flow_syntax: AFNORFlowSyntax = Field(alias="flowSyntax")
|
|
39
|
+
flow_profile: Optional[AFNORFlowProfile] = Field(default=None, alias="flowProfile")
|
|
40
|
+
sha256: Optional[Annotated[str, Field(strict=True)]] = None
|
|
41
|
+
flow_id: Optional[Annotated[str, Field(strict=True, max_length=36)]] = Field(default=None, description="Unique identifier supporting UUID but not only, for flexibility purpose", alias="flowId")
|
|
42
|
+
submitted_at: Optional[datetime] = Field(default=None, description="The flow submission date and time (the date and time when the flow was created on the system) This property should be used by the API consumer as a time reference to avoid clock synchronization issues ", alias="submittedAt")
|
|
43
|
+
__properties: ClassVar[List[str]] = ["trackingId", "name", "processingRule", "flowSyntax", "flowProfile", "sha256", "flowId", "submittedAt"]
|
|
44
|
+
|
|
45
|
+
@field_validator('sha256')
|
|
46
|
+
def sha256_validate_regular_expression(cls, value):
|
|
47
|
+
"""Validates the regular expression"""
|
|
48
|
+
if value is None:
|
|
49
|
+
return value
|
|
50
|
+
|
|
51
|
+
if not re.match(r"^[a-f0-9]{64}$", value):
|
|
52
|
+
raise ValueError(r"must validate the regular expression /^[a-f0-9]{64}$/")
|
|
53
|
+
return value
|
|
54
|
+
|
|
55
|
+
model_config = ConfigDict(
|
|
56
|
+
populate_by_name=True,
|
|
57
|
+
validate_assignment=True,
|
|
58
|
+
protected_namespaces=(),
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def to_str(self) -> str:
|
|
63
|
+
"""Returns the string representation of the model using alias"""
|
|
64
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
65
|
+
|
|
66
|
+
def to_json(self) -> str:
|
|
67
|
+
"""Returns the JSON representation of the model using alias"""
|
|
68
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
69
|
+
return json.dumps(self.to_dict())
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
73
|
+
"""Create an instance of AFNORFullFlowInfo from a JSON string"""
|
|
74
|
+
return cls.from_dict(json.loads(json_str))
|
|
75
|
+
|
|
76
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
77
|
+
"""Return the dictionary representation of the model using alias.
|
|
78
|
+
|
|
79
|
+
This has the following differences from calling pydantic's
|
|
80
|
+
`self.model_dump(by_alias=True)`:
|
|
81
|
+
|
|
82
|
+
* `None` is only added to the output dict for nullable fields that
|
|
83
|
+
were set at model initialization. Other fields with value `None`
|
|
84
|
+
are ignored.
|
|
85
|
+
"""
|
|
86
|
+
excluded_fields: Set[str] = set([
|
|
87
|
+
])
|
|
88
|
+
|
|
89
|
+
_dict = self.model_dump(
|
|
90
|
+
by_alias=True,
|
|
91
|
+
exclude=excluded_fields,
|
|
92
|
+
exclude_none=True,
|
|
93
|
+
)
|
|
94
|
+
return _dict
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
98
|
+
"""Create an instance of AFNORFullFlowInfo from a dict"""
|
|
99
|
+
if obj is None:
|
|
100
|
+
return None
|
|
101
|
+
|
|
102
|
+
if not isinstance(obj, dict):
|
|
103
|
+
return cls.model_validate(obj)
|
|
104
|
+
|
|
105
|
+
_obj = cls.model_validate({
|
|
106
|
+
"trackingId": obj.get("trackingId"),
|
|
107
|
+
"name": obj.get("name"),
|
|
108
|
+
"processingRule": obj.get("processingRule"),
|
|
109
|
+
"flowSyntax": obj.get("flowSyntax"),
|
|
110
|
+
"flowProfile": obj.get("flowProfile"),
|
|
111
|
+
"sha256": obj.get("sha256"),
|
|
112
|
+
"flowId": obj.get("flowId"),
|
|
113
|
+
"submittedAt": obj.get("submittedAt")
|
|
114
|
+
})
|
|
115
|
+
return _obj
|
|
116
|
+
|
|
117
|
+
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
"""
|
|
4
4
|
FactPulse REST API
|
|
5
5
|
|
|
6
|
-
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://
|
|
6
|
+
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://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/
|
|
7
7
|
|
|
8
8
|
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: contact@factpulse.fr
|
|
9
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
11
|
|
|
11
12
|
Do not edit the class manually.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FactPulse REST API
|
|
5
|
+
|
|
6
|
+
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://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/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: contact@factpulse.fr
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
from enum import Enum
|
|
19
|
+
from typing_extensions import Self
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AFNORLegalUnitAdministrativeStatus(str, Enum):
|
|
23
|
+
"""
|
|
24
|
+
Refers to the administrative status of the legal unit [A - Active , C - Closed]
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
allowed enum values
|
|
29
|
+
"""
|
|
30
|
+
A = 'A'
|
|
31
|
+
C = 'C'
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_json(cls, json_str: str) -> Self:
|
|
35
|
+
"""Create an instance of AFNORLegalUnitAdministrativeStatus from a JSON string"""
|
|
36
|
+
return cls(json.loads(json_str))
|
|
37
|
+
|
|
38
|
+
|