factpulse 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +17 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +74 -0
- data/LICENSE +21 -0
- data/README.md +220 -0
- data/Rakefile +10 -0
- data/docs/AFNORAcknowledgement.md +20 -0
- data/docs/AFNORAcknowledgementDetail.md +24 -0
- data/docs/AFNORAddressEdit.md +30 -0
- data/docs/AFNORAddressPatch.md +30 -0
- data/docs/AFNORAddressPut.md +30 -0
- data/docs/AFNORAddressRead.md +32 -0
- data/docs/AFNORAlgorithm.md +15 -0
- data/docs/AFNORContainsOperator.md +15 -0
- data/docs/AFNORCreateDirectoryLineBody.md +20 -0
- data/docs/AFNORCreateDirectoryLineBodyAddressingInformation.md +24 -0
- data/docs/AFNORCreateDirectoryLineBodyPeriod.md +20 -0
- data/docs/AFNORCreateRoutingCodeBody.md +32 -0
- data/docs/AFNORCredentials.md +22 -0
- data/docs/AFNORDestination.md +26 -0
- data/docs/AFNORDiffusionStatus.md +15 -0
- data/docs/AFNORDirectoryLineField.md +15 -0
- data/docs/AFNORDirectoryLinePayloadHistoryLegalUnitFacilityRoutingCode.md +32 -0
- data/docs/AFNORDirectoryLinePayloadHistoryLegalUnitFacilityRoutingCodePlatform.md +20 -0
- data/docs/AFNORDirectoryLinePayloadHistoryLegalUnitFacilityRoutingCodeRoutingCode.md +28 -0
- data/docs/AFNORDirectoryLinePost201Response.md +22 -0
- data/docs/AFNORDirectoryLineSearchPost200Response.md +22 -0
- data/docs/AFNOREntityType.md +15 -0
- data/docs/AFNORError.md +26 -0
- data/docs/AFNORFacilityAdministrativeStatus.md +15 -0
- data/docs/AFNORFacilityNature.md +15 -0
- data/docs/AFNORFacilityPayloadHistory.md +34 -0
- data/docs/AFNORFacilityPayloadHistoryUleB2gAdditionalData.md +28 -0
- data/docs/AFNORFacilityPayloadIncluded.md +32 -0
- data/docs/AFNORFacilityType.md +15 -0
- data/docs/AFNORFlow.md +38 -0
- data/docs/AFNORFlowAckStatus.md +15 -0
- data/docs/AFNORFlowDirection.md +15 -0
- data/docs/AFNORFlowInfo.md +28 -0
- data/docs/AFNORFlowProfile.md +15 -0
- data/docs/AFNORFlowSyntax.md +15 -0
- data/docs/AFNORFlowType.md +15 -0
- data/docs/AFNORFullFlowInfo.md +32 -0
- data/docs/AFNORHealthCheckResponse.md +22 -0
- data/docs/AFNORLegalUnitAdministrativeStatus.md +15 -0
- data/docs/AFNORLegalUnitPayloadHistory.md +24 -0
- data/docs/AFNORLegalUnitPayloadIncluded.md +24 -0
- data/docs/AFNORLegalUnitPayloadIncludedNoSiren.md +22 -0
- data/docs/AFNORPDPPAApi.md +150 -0
- data/docs/AFNORPDPPADirectoryServiceApi.md +1223 -0
- data/docs/AFNORPDPPAFlowServiceApi.md +270 -0
- data/docs/AFNORPlatformStatus.md +15 -0
- data/docs/AFNORProcessingRule.md +15 -0
- data/docs/AFNORReasonCode.md +49 -0
- data/docs/AFNORReasonCodeEnum.md +15 -0
- data/docs/AFNORRecipientPlatformType.md +15 -0
- data/docs/AFNORResult.md +32 -0
- data/docs/AFNORRoutingCodeAdministrativeStatus.md +15 -0
- data/docs/AFNORRoutingCodeField.md +15 -0
- data/docs/AFNORRoutingCodePayloadHistoryLegalUnitFacility.md +34 -0
- data/docs/AFNORRoutingCodePost201Response.md +22 -0
- data/docs/AFNORRoutingCodeSearch.md +28 -0
- data/docs/AFNORRoutingCodeSearchFilters.md +30 -0
- data/docs/AFNORRoutingCodeSearchFiltersAdministrativeStatus.md +20 -0
- data/docs/AFNORRoutingCodeSearchFiltersRoutingCodeName.md +20 -0
- data/docs/AFNORRoutingCodeSearchFiltersRoutingIdentifier.md +20 -0
- data/docs/AFNORRoutingCodeSearchPost200Response.md +22 -0
- data/docs/AFNORRoutingCodeSearchSortingInner.md +20 -0
- data/docs/AFNORSearchDirectoryLine.md +26 -0
- data/docs/AFNORSearchDirectoryLineFilters.md +26 -0
- data/docs/AFNORSearchDirectoryLineFiltersAddressingIdentifier.md +20 -0
- data/docs/AFNORSearchDirectoryLineFiltersAddressingSuffix.md +20 -0
- data/docs/AFNORSearchDirectoryLineSortingInner.md +20 -0
- data/docs/AFNORSearchFlowContent.md +22 -0
- data/docs/AFNORSearchFlowFilters.md +30 -0
- data/docs/AFNORSearchFlowParams.md +20 -0
- data/docs/AFNORSearchSiren.md +26 -0
- data/docs/AFNORSearchSirenFilters.md +24 -0
- data/docs/AFNORSearchSirenFiltersAdministrativeStatus.md +20 -0
- data/docs/AFNORSearchSirenFiltersBusinessName.md +20 -0
- data/docs/AFNORSearchSirenFiltersEntityType.md +20 -0
- data/docs/AFNORSearchSirenFiltersSiren.md +20 -0
- data/docs/AFNORSearchSirenSortingInner.md +20 -0
- data/docs/AFNORSearchSiret.md +28 -0
- data/docs/AFNORSearchSiretFilters.md +34 -0
- data/docs/AFNORSearchSiretFiltersAddressLines.md +20 -0
- data/docs/AFNORSearchSiretFiltersAdministrativeStatus.md +20 -0
- data/docs/AFNORSearchSiretFiltersCountrySubdivision.md +20 -0
- data/docs/AFNORSearchSiretFiltersFacilityType.md +20 -0
- data/docs/AFNORSearchSiretFiltersLocality.md +20 -0
- data/docs/AFNORSearchSiretFiltersName.md +20 -0
- data/docs/AFNORSearchSiretFiltersPostalCode.md +20 -0
- data/docs/AFNORSearchSiretFiltersSiret.md +20 -0
- data/docs/AFNORSearchSiretSortingInner.md +20 -0
- data/docs/AFNORSirenField.md +15 -0
- data/docs/AFNORSirenSearchPost200Response.md +22 -0
- data/docs/AFNORSiretField.md +15 -0
- data/docs/AFNORSiretSearchPost200Response.md +22 -0
- data/docs/AFNORSortingOrder.md +15 -0
- data/docs/AFNORStrictOperator.md +15 -0
- data/docs/AFNORUpdatePatchDirectoryLineBody.md +18 -0
- data/docs/AFNORUpdatePatchRoutingCodeBody.md +24 -0
- data/docs/AFNORUpdatePutRoutingCodeBody.md +24 -0
- data/docs/AFNORWebhookCallbackContent.md +18 -0
- data/docs/APIError.md +22 -0
- data/docs/APIProfile.md +15 -0
- data/docs/AcknowledgmentStatus.md +15 -0
- data/docs/ActionCodeInfo.md +22 -0
- data/docs/ActionCodesResponse.md +22 -0
- data/docs/AdditionalDocument.md +26 -0
- data/docs/AggregatedPaymentInput.md +22 -0
- data/docs/AggregatedTransactionInput.md +32 -0
- data/docs/AllowanceCharge.md +32 -0
- data/docs/AllowanceChargeReasonCode.md +15 -0
- data/docs/AllowanceReasonCode.md +15 -0
- data/docs/AllowanceTotalAmount.md +15 -0
- data/docs/Amount.md +15 -0
- data/docs/Amount1.md +15 -0
- data/docs/Amount2.md +15 -0
- data/docs/AmountDue.md +15 -0
- data/docs/AsyncTaskStatus.md +22 -0
- data/docs/AsyncTasksApi.md +82 -0
- data/docs/BaseAmount.md +15 -0
- data/docs/BoundingBoxSchema.md +30 -0
- data/docs/Buyercountry.md +15 -0
- data/docs/CeleryStatus.md +15 -0
- data/docs/CertificateInfoResponse.md +40 -0
- data/docs/ChargeTotalAmount.md +15 -0
- data/docs/ChorusProApi.md +1207 -0
- data/docs/ChorusProCredentials.md +26 -0
- data/docs/ChorusProDestination.md +20 -0
- data/docs/ChorusProResult.md +22 -0
- data/docs/ClientActivateResponse.md +22 -0
- data/docs/ClientCreateRequest.md +22 -0
- data/docs/ClientDetail.md +38 -0
- data/docs/ClientListResponse.md +24 -0
- data/docs/ClientManagementApi.md +921 -0
- data/docs/ClientSummary.md +38 -0
- data/docs/ClientUpdateRequest.md +22 -0
- data/docs/Contact.md +24 -0
- data/docs/ConvertResumeRequest.md +18 -0
- data/docs/ConvertSuccessResponse.md +36 -0
- data/docs/ConvertValidationFailedResponse.md +34 -0
- data/docs/CountryCode.md +15 -0
- data/docs/CreateAggregatedReportRequest.md +36 -0
- data/docs/CreateCDARRequest.md +52 -0
- data/docs/CreateEReportingRequest.md +38 -0
- data/docs/Currency.md +15 -0
- data/docs/CurrencyCode.md +15 -0
- data/docs/DeliveryParty.md +24 -0
- data/docs/Destination.md +79 -0
- data/docs/DocType.md +15 -0
- data/docs/DocumentTypeInfo.md +22 -0
- data/docs/DownloadsApi.md +161 -0
- data/docs/EReportingFlowType.md +15 -0
- data/docs/EReportingValidationError.md +22 -0
- data/docs/ElectronicAddress.md +20 -0
- data/docs/ElectronicSignatureApi.md +339 -0
- data/docs/Encaisseamount.md +15 -0
- data/docs/Encaisseamount1.md +15 -0
- data/docs/EncaisseeRequest.md +40 -0
- data/docs/EnrichedInvoiceInfo.md +32 -0
- data/docs/ErrorLevel.md +15 -0
- data/docs/ErrorSource.md +15 -0
- data/docs/ExtractionInfo.md +24 -0
- data/docs/FacturXConversionApi.md +319 -0
- data/docs/FacturXGenerationApi.md +254 -0
- data/docs/FacturXInvoice.md +76 -0
- data/docs/FacturXPDFInfo.md +22 -0
- data/docs/FacturXPDFXMLVerificationApi.md +240 -0
- data/docs/FacturXValidationApi.md +256 -0
- data/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +15 -0
- data/docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md +26 -0
- data/docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md +18 -0
- data/docs/FieldStatus.md +15 -0
- data/docs/FileInfo.md +20 -0
- data/docs/FilesInfo.md +20 -0
- data/docs/FlowDirection.md +15 -0
- data/docs/FlowProfile.md +15 -0
- data/docs/FlowSummary.md +32 -0
- data/docs/FlowSyntax.md +15 -0
- data/docs/FlowType.md +15 -0
- data/docs/Flux10EReportingApi.md +814 -0
- data/docs/Flux6InvoiceLifecycleCDARApi.md +698 -0
- data/docs/GenerateAggregatedReportResponse.md +30 -0
- data/docs/GenerateCDARResponse.md +26 -0
- data/docs/GenerateCertificateRequest.md +38 -0
- data/docs/GenerateCertificateResponse.md +32 -0
- data/docs/GenerateEReportingResponse.md +26 -0
- data/docs/GetChorusProIdRequest.md +22 -0
- data/docs/GetChorusProIdResponse.md +24 -0
- data/docs/GetInvoiceRequest.md +20 -0
- data/docs/GetInvoiceResponse.md +34 -0
- data/docs/GetStructureRequest.md +22 -0
- data/docs/GetStructureResponse.md +34 -0
- data/docs/GlobalAllowanceAmount.md +15 -0
- data/docs/GrossUnitPrice.md +15 -0
- data/docs/HTTPValidationError.md +18 -0
- data/docs/HealthApi.md +203 -0
- data/docs/IncomingInvoice.md +54 -0
- data/docs/IncomingSupplier.md +32 -0
- data/docs/InvoiceFormat.md +15 -0
- data/docs/InvoiceInput.md +50 -0
- data/docs/InvoiceLine.md +84 -0
- data/docs/InvoiceLineAllowanceAmount.md +15 -0
- data/docs/InvoiceNote.md +20 -0
- data/docs/InvoicePaymentInput.md +26 -0
- data/docs/InvoiceReferences.md +52 -0
- data/docs/InvoiceStatus.md +22 -0
- data/docs/InvoiceTotals.md +38 -0
- data/docs/InvoiceTotalsPrepayment.md +15 -0
- data/docs/InvoiceTypeCode.md +15 -0
- data/docs/InvoiceTypeCodeOutput.md +15 -0
- data/docs/InvoicingFramework.md +24 -0
- data/docs/InvoicingFrameworkCode.md +15 -0
- data/docs/IssuerRoleCode.md +15 -0
- data/docs/KeyRotationRequest.md +20 -0
- data/docs/KeyRotationResponse.md +24 -0
- data/docs/LineNetAmount.md +15 -0
- data/docs/LineSubType.md +15 -0
- data/docs/LineTotalAmount.md +15 -0
- data/docs/LocationInner.md +15 -0
- data/docs/MandatoryNoteSchema.md +30 -0
- data/docs/ManualRate.md +15 -0
- data/docs/ManualVatRate.md +15 -0
- data/docs/MissingField.md +28 -0
- data/docs/OperationNature.md +15 -0
- data/docs/OutputFormat.md +15 -0
- data/docs/PDFValidationResultAPI.md +62 -0
- data/docs/PDPConfigResponse.md +46 -0
- data/docs/PDPConfigUpdateRequest.md +30 -0
- data/docs/PDPCredentials.md +26 -0
- data/docs/PageDimensionsSchema.md +20 -0
- data/docs/Payee.md +32 -0
- data/docs/PaymentAmountByRate.md +20 -0
- data/docs/PaymentCard.md +20 -0
- data/docs/PaymentMeans.md +15 -0
- data/docs/Percentage.md +15 -0
- data/docs/PostalAddress.md +30 -0
- data/docs/PriceAllowanceAmount.md +15 -0
- data/docs/PriceBasisQuantity.md +15 -0
- data/docs/ProcessingOptions.md +24 -0
- data/docs/ProcessingRule.md +15 -0
- data/docs/ProductCharacteristic.md +20 -0
- data/docs/ProductClassification.md +22 -0
- data/docs/Quantity.md +15 -0
- data/docs/Rate.md +15 -0
- data/docs/Rate1.md +15 -0
- data/docs/ReasonCodeInfo.md +22 -0
- data/docs/ReasonCodesResponse.md +22 -0
- data/docs/Recipient.md +34 -0
- data/docs/RecipientInput.md +26 -0
- data/docs/RefuseeRequest.md +40 -0
- data/docs/ReportIssuer.md +24 -0
- data/docs/ReportPeriod.md +20 -0
- data/docs/ReportSender.md +22 -0
- data/docs/RoundingAmount.md +15 -0
- data/docs/SchematronValidationError.md +32 -0
- data/docs/SchemeID.md +15 -0
- data/docs/SearchFlowRequest.md +34 -0
- data/docs/SearchFlowResponse.md +24 -0
- data/docs/SearchServicesResponse.md +24 -0
- data/docs/SearchStructureRequest.md +26 -0
- data/docs/SearchStructureResponse.md +24 -0
- data/docs/SecretStatus.md +24 -0
- data/docs/Sellercountry.md +15 -0
- data/docs/SignatureInfo.md +22 -0
- data/docs/SignatureInfoAPI.md +28 -0
- data/docs/SignatureParameters.md +34 -0
- data/docs/SimplifiedCDARResponse.md +26 -0
- data/docs/SimplifiedInvoiceData.md +42 -0
- data/docs/StatusCodeInfo.md +22 -0
- data/docs/StatusCodesResponse.md +22 -0
- data/docs/StructureInfo.md +26 -0
- data/docs/StructureParameters.md +22 -0
- data/docs/StructureService.md +24 -0
- data/docs/SubmissionMode.md +15 -0
- data/docs/SubmitAggregatedReportRequest.md +28 -0
- data/docs/SubmitCDARRequest.md +62 -0
- data/docs/SubmitCDARResponse.md +24 -0
- data/docs/SubmitCDARXMLRequest.md +30 -0
- data/docs/SubmitCompleteInvoiceRequest.md +26 -0
- data/docs/SubmitCompleteInvoiceResponse.md +34 -0
- data/docs/SubmitEReportingRequest.md +28 -0
- data/docs/SubmitEReportingResponse.md +32 -0
- data/docs/SubmitFlowRequest.md +28 -0
- data/docs/SubmitFlowResponse.md +30 -0
- data/docs/SubmitGrossAmount.md +15 -0
- data/docs/SubmitInvoiceRequest.md +46 -0
- data/docs/SubmitInvoiceResponse.md +24 -0
- data/docs/SubmitNetAmount.md +15 -0
- data/docs/SubmitVatAmount.md +15 -0
- data/docs/SupplementaryAttachment.md +26 -0
- data/docs/Supplier.md +52 -0
- data/docs/TaskResponse.md +18 -0
- data/docs/TaxBreakdownInput.md +22 -0
- data/docs/TaxDueDateType.md +15 -0
- data/docs/TaxRepresentative.md +22 -0
- data/docs/TaxableAmount.md +15 -0
- data/docs/Taxableamount.md +15 -0
- data/docs/Taxamount.md +15 -0
- data/docs/Taxamount1.md +15 -0
- data/docs/Taxamount2.md +15 -0
- data/docs/Taxexclusiveamount.md +15 -0
- data/docs/Taxexclusiveamount1.md +15 -0
- data/docs/TotalGrossAmount.md +15 -0
- data/docs/TotalNetAmount.md +15 -0
- data/docs/TotalVATAmount.md +15 -0
- data/docs/TransactionCategory.md +15 -0
- data/docs/TransmissionTypeCode.md +15 -0
- data/docs/UnitNetPrice.md +15 -0
- data/docs/UnitOfMeasure.md +15 -0
- data/docs/VATAccountingCode.md +15 -0
- data/docs/VATAmount.md +15 -0
- data/docs/VATCategory.md +15 -0
- data/docs/VATLine.md +32 -0
- data/docs/VATPointDateCode.md +15 -0
- data/docs/ValidateCDARRequest.md +32 -0
- data/docs/ValidateCDARResponse.md +22 -0
- data/docs/ValidateEReportingRequest.md +18 -0
- data/docs/ValidateEReportingResponse.md +28 -0
- data/docs/ValidationError.md +22 -0
- data/docs/ValidationErrorDetail.md +26 -0
- data/docs/ValidationErrorResponse.md +24 -0
- data/docs/ValidationInfo.md +28 -0
- data/docs/ValidationSuccessResponse.md +18 -0
- data/docs/VatRate.md +15 -0
- data/docs/VerificationSuccessResponse.md +36 -0
- data/docs/VerifiedFieldSchema.md +34 -0
- data/docs/WebhookSecretDeleteResponse.md +20 -0
- data/docs/WebhookSecretGenerateResponse.md +24 -0
- data/docs/WebhookSecretStatusResponse.md +20 -0
- data/factpulse.gemspec +39 -0
- data/git_push.sh +57 -0
- data/lib/factpulse/api/afnorpdppa_api.rb +148 -0
- data/lib/factpulse/api/afnorpdppa_directory_service_api.rb +1183 -0
- data/lib/factpulse/api/afnorpdppa_flow_service_api.rb +289 -0
- data/lib/factpulse/api/async_tasks_api.rb +85 -0
- data/lib/factpulse/api/chorus_pro_api.rb +1105 -0
- data/lib/factpulse/api/client_management_api.rb +831 -0
- data/lib/factpulse/api/downloads_api.rb +151 -0
- data/lib/factpulse/api/electronic_signature_api.rb +339 -0
- data/lib/factpulse/api/factur_x_conversion_api.rb +306 -0
- data/lib/factpulse/api/factur_x_generation_api.rb +254 -0
- data/lib/factpulse/api/factur_x_validation_api.rb +256 -0
- data/lib/factpulse/api/factur_xpdfxml_verification_api.rb +232 -0
- data/lib/factpulse/api/flux10_e_reporting_api.rb +777 -0
- data/lib/factpulse/api/flux6_invoice_lifecycle_cdar_api.rb +670 -0
- data/lib/factpulse/api/health_api.rb +193 -0
- data/lib/factpulse/api_client.rb +397 -0
- data/lib/factpulse/api_error.rb +58 -0
- data/lib/factpulse/api_model_base.rb +88 -0
- data/lib/factpulse/configuration.rb +319 -0
- data/lib/factpulse/helpers/client.rb +272 -0
- data/lib/factpulse/helpers/exceptions.rb +45 -0
- data/lib/factpulse/helpers/helpers.rb +14 -0
- data/lib/factpulse/models/acknowledgment_status.rb +41 -0
- data/lib/factpulse/models/action_code_info.rb +220 -0
- data/lib/factpulse/models/action_codes_response.rb +207 -0
- data/lib/factpulse/models/additional_document.rb +206 -0
- data/lib/factpulse/models/afnor_acknowledgement.rb +216 -0
- data/lib/factpulse/models/afnor_acknowledgement_detail.rb +267 -0
- data/lib/factpulse/models/afnor_address_edit.rb +353 -0
- data/lib/factpulse/models/afnor_address_patch.rb +386 -0
- data/lib/factpulse/models/afnor_address_put.rb +435 -0
- data/lib/factpulse/models/afnor_address_read.rb +382 -0
- data/lib/factpulse/models/afnor_algorithm.rb +43 -0
- data/lib/factpulse/models/afnor_contains_operator.rb +39 -0
- data/lib/factpulse/models/afnor_create_directory_line_body.rb +156 -0
- data/lib/factpulse/models/afnor_create_directory_line_body_addressing_information.rb +294 -0
- data/lib/factpulse/models/afnor_create_directory_line_body_period.rb +175 -0
- data/lib/factpulse/models/afnor_create_routing_code_body.rb +412 -0
- data/lib/factpulse/models/afnor_credentials.rb +169 -0
- data/lib/factpulse/models/afnor_destination.rb +224 -0
- data/lib/factpulse/models/afnor_diffusion_status.rb +40 -0
- data/lib/factpulse/models/afnor_directory_line_field.rb +44 -0
- data/lib/factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code.rb +312 -0
- data/lib/factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_platform.rb +178 -0
- data/lib/factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_routing_code.rb +308 -0
- data/lib/factpulse/models/afnor_directory_line_post201_response.rb +187 -0
- data/lib/factpulse/models/afnor_directory_line_search_post200_response.rb +168 -0
- data/lib/factpulse/models/afnor_entity_type.rb +40 -0
- data/lib/factpulse/models/afnor_error.rb +214 -0
- data/lib/factpulse/models/afnor_facility_administrative_status.rb +40 -0
- data/lib/factpulse/models/afnor_facility_nature.rb +40 -0
- data/lib/factpulse/models/afnor_facility_payload_history.rb +323 -0
- data/lib/factpulse/models/afnor_facility_payload_history_ule_b2g_additional_data.rb +198 -0
- data/lib/factpulse/models/afnor_facility_payload_included.rb +314 -0
- data/lib/factpulse/models/afnor_facility_type.rb +40 -0
- data/lib/factpulse/models/afnor_flow.rb +315 -0
- data/lib/factpulse/models/afnor_flow_ack_status.rb +41 -0
- data/lib/factpulse/models/afnor_flow_direction.rb +40 -0
- data/lib/factpulse/models/afnor_flow_info.rb +293 -0
- data/lib/factpulse/models/afnor_flow_profile.rb +41 -0
- data/lib/factpulse/models/afnor_flow_syntax.rb +43 -0
- data/lib/factpulse/models/afnor_flow_type.rb +51 -0
- data/lib/factpulse/models/afnor_full_flow_info.rb +339 -0
- data/lib/factpulse/models/afnor_health_check_response.rb +220 -0
- data/lib/factpulse/models/afnor_legal_unit_administrative_status.rb +40 -0
- data/lib/factpulse/models/afnor_legal_unit_payload_history.rb +247 -0
- data/lib/factpulse/models/afnor_legal_unit_payload_included.rb +247 -0
- data/lib/factpulse/models/afnor_legal_unit_payload_included_no_siren.rb +207 -0
- data/lib/factpulse/models/afnor_platform_status.rb +40 -0
- data/lib/factpulse/models/afnor_processing_rule.rb +44 -0
- data/lib/factpulse/models/afnor_reason_code.rb +105 -0
- data/lib/factpulse/models/afnor_reason_code_enum.rb +53 -0
- data/lib/factpulse/models/afnor_recipient_platform_type.rb +40 -0
- data/lib/factpulse/models/afnor_result.rb +270 -0
- data/lib/factpulse/models/afnor_routing_code_administrative_status.rb +40 -0
- data/lib/factpulse/models/afnor_routing_code_field.rb +46 -0
- data/lib/factpulse/models/afnor_routing_code_payload_history_legal_unit_facility.rb +366 -0
- data/lib/factpulse/models/afnor_routing_code_post201_response.rb +228 -0
- data/lib/factpulse/models/afnor_routing_code_search.rb +224 -0
- data/lib/factpulse/models/afnor_routing_code_search_filters.rb +201 -0
- data/lib/factpulse/models/afnor_routing_code_search_filters_administrative_status.rb +178 -0
- data/lib/factpulse/models/afnor_routing_code_search_filters_routing_code_name.rb +209 -0
- data/lib/factpulse/models/afnor_routing_code_search_filters_routing_identifier.rb +209 -0
- data/lib/factpulse/models/afnor_routing_code_search_post200_response.rb +168 -0
- data/lib/factpulse/models/afnor_routing_code_search_sorting_inner.rb +179 -0
- data/lib/factpulse/models/afnor_search_directory_line.rb +191 -0
- data/lib/factpulse/models/afnor_search_directory_line_filters.rb +183 -0
- data/lib/factpulse/models/afnor_search_directory_line_filters_addressing_identifier.rb +198 -0
- data/lib/factpulse/models/afnor_search_directory_line_filters_addressing_suffix.rb +198 -0
- data/lib/factpulse/models/afnor_search_directory_line_sorting_inner.rb +179 -0
- data/lib/factpulse/models/afnor_search_flow_content.rb +168 -0
- data/lib/factpulse/models/afnor_search_flow_filters.rb +250 -0
- data/lib/factpulse/models/afnor_search_flow_params.rb +195 -0
- data/lib/factpulse/models/afnor_search_siren.rb +191 -0
- data/lib/factpulse/models/afnor_search_siren_filters.rb +174 -0
- data/lib/factpulse/models/afnor_search_siren_filters_administrative_status.rb +178 -0
- data/lib/factpulse/models/afnor_search_siren_filters_business_name.rb +198 -0
- data/lib/factpulse/models/afnor_search_siren_filters_entity_type.rb +178 -0
- data/lib/factpulse/models/afnor_search_siren_filters_siren.rb +209 -0
- data/lib/factpulse/models/afnor_search_siren_sorting_inner.rb +179 -0
- data/lib/factpulse/models/afnor_search_siret.rb +224 -0
- data/lib/factpulse/models/afnor_search_siret_filters.rb +219 -0
- data/lib/factpulse/models/afnor_search_siret_filters_address_lines.rb +198 -0
- data/lib/factpulse/models/afnor_search_siret_filters_administrative_status.rb +178 -0
- data/lib/factpulse/models/afnor_search_siret_filters_country_subdivision.rb +198 -0
- data/lib/factpulse/models/afnor_search_siret_filters_facility_type.rb +178 -0
- data/lib/factpulse/models/afnor_search_siret_filters_locality.rb +198 -0
- data/lib/factpulse/models/afnor_search_siret_filters_name.rb +198 -0
- data/lib/factpulse/models/afnor_search_siret_filters_postal_code.rb +209 -0
- data/lib/factpulse/models/afnor_search_siret_filters_siret.rb +209 -0
- data/lib/factpulse/models/afnor_search_siret_sorting_inner.rb +179 -0
- data/lib/factpulse/models/afnor_siren_field.rb +43 -0
- data/lib/factpulse/models/afnor_siren_search_post200_response.rb +168 -0
- data/lib/factpulse/models/afnor_siret_field.rb +52 -0
- data/lib/factpulse/models/afnor_siret_search_post200_response.rb +168 -0
- data/lib/factpulse/models/afnor_sorting_order.rb +40 -0
- data/lib/factpulse/models/afnor_strict_operator.rb +39 -0
- data/lib/factpulse/models/afnor_update_patch_directory_line_body.rb +148 -0
- data/lib/factpulse/models/afnor_update_patch_routing_code_body.rb +258 -0
- data/lib/factpulse/models/afnor_update_put_routing_code_body.rb +289 -0
- data/lib/factpulse/models/afnor_webhook_callback_content.rb +148 -0
- data/lib/factpulse/models/aggregated_payment_input.rb +213 -0
- data/lib/factpulse/models/aggregated_transaction_input.rb +349 -0
- data/lib/factpulse/models/allowance_charge.rb +274 -0
- data/lib/factpulse/models/allowance_charge_reason_code.rb +76 -0
- data/lib/factpulse/models/allowance_reason_code.rb +45 -0
- data/lib/factpulse/models/allowance_total_amount.rb +104 -0
- data/lib/factpulse/models/amount.rb +104 -0
- data/lib/factpulse/models/amount1.rb +104 -0
- data/lib/factpulse/models/amount2.rb +104 -0
- data/lib/factpulse/models/amount_due.rb +104 -0
- data/lib/factpulse/models/api_error.rb +205 -0
- data/lib/factpulse/models/api_profile.rb +43 -0
- data/lib/factpulse/models/async_task_status.rb +227 -0
- data/lib/factpulse/models/base_amount.rb +104 -0
- data/lib/factpulse/models/bounding_box_schema.rb +332 -0
- data/lib/factpulse/models/buyercountry.rb +104 -0
- data/lib/factpulse/models/celery_status.rb +43 -0
- data/lib/factpulse/models/certificate_info_response.rb +446 -0
- data/lib/factpulse/models/charge_total_amount.rb +104 -0
- data/lib/factpulse/models/chorus_pro_credentials.rb +259 -0
- data/lib/factpulse/models/chorus_pro_destination.rb +194 -0
- data/lib/factpulse/models/chorus_pro_result.rb +186 -0
- data/lib/factpulse/models/client_activate_response.rb +220 -0
- data/lib/factpulse/models/client_create_request.rb +236 -0
- data/lib/factpulse/models/client_detail.rb +368 -0
- data/lib/factpulse/models/client_list_response.rb +249 -0
- data/lib/factpulse/models/client_summary.rb +368 -0
- data/lib/factpulse/models/client_update_request.rb +225 -0
- data/lib/factpulse/models/contact.rb +179 -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 +339 -0
- data/lib/factpulse/models/country_code.rb +208 -0
- data/lib/factpulse/models/create_aggregated_report_request.rb +320 -0
- data/lib/factpulse/models/create_cdar_request.rb +414 -0
- data/lib/factpulse/models/create_e_reporting_request.rb +347 -0
- data/lib/factpulse/models/currency.rb +104 -0
- data/lib/factpulse/models/currency_code.rb +91 -0
- data/lib/factpulse/models/delivery_party.rb +179 -0
- data/lib/factpulse/models/destination.rb +56 -0
- data/lib/factpulse/models/doc_type.rb +42 -0
- data/lib/factpulse/models/document_type_info.rb +220 -0
- data/lib/factpulse/models/e_reporting_flow_type.rb +42 -0
- data/lib/factpulse/models/e_reporting_validation_error.rb +203 -0
- data/lib/factpulse/models/electronic_address.rb +198 -0
- data/lib/factpulse/models/encaisseamount.rb +104 -0
- data/lib/factpulse/models/encaisseamount1.rb +103 -0
- data/lib/factpulse/models/encaissee_request.rb +347 -0
- data/lib/factpulse/models/enriched_invoice_info.rb +354 -0
- data/lib/factpulse/models/error_level.rb +40 -0
- data/lib/factpulse/models/error_source.rb +47 -0
- data/lib/factpulse/models/extraction_info.rb +217 -0
- data/lib/factpulse/models/factur_x_invoice.rb +580 -0
- data/lib/factpulse/models/factur_xpdf_info.rb +205 -0
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb +43 -0
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb +191 -0
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_validation_validation_error_response.rb +168 -0
- data/lib/factpulse/models/field_status.rb +43 -0
- 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 +40 -0
- data/lib/factpulse/models/flow_profile.rb +41 -0
- data/lib/factpulse/models/flow_summary.rb +253 -0
- data/lib/factpulse/models/flow_syntax.rb +43 -0
- data/lib/factpulse/models/flow_type.rb +51 -0
- data/lib/factpulse/models/generate_aggregated_report_response.rb +330 -0
- data/lib/factpulse/models/generate_cdar_response.rb +273 -0
- data/lib/factpulse/models/generate_certificate_request.rb +323 -0
- data/lib/factpulse/models/generate_certificate_response.rb +254 -0
- data/lib/factpulse/models/generate_e_reporting_response.rb +274 -0
- data/lib/factpulse/models/get_chorus_pro_id_request.rb +188 -0
- data/lib/factpulse/models/get_chorus_pro_id_response.rb +230 -0
- data/lib/factpulse/models/get_invoice_request.rb +176 -0
- data/lib/factpulse/models/get_invoice_response.rb +263 -0
- data/lib/factpulse/models/get_structure_request.rb +188 -0
- data/lib/factpulse/models/get_structure_response.rb +263 -0
- data/lib/factpulse/models/global_allowance_amount.rb +104 -0
- data/lib/factpulse/models/gross_unit_price.rb +104 -0
- data/lib/factpulse/models/http_validation_error.rb +149 -0
- data/lib/factpulse/models/incoming_invoice.rb +489 -0
- data/lib/factpulse/models/incoming_supplier.rb +236 -0
- data/lib/factpulse/models/invoice_format.rb +41 -0
- data/lib/factpulse/models/invoice_input.rb +439 -0
- data/lib/factpulse/models/invoice_line.rb +593 -0
- data/lib/factpulse/models/invoice_line_allowance_amount.rb +104 -0
- data/lib/factpulse/models/invoice_note.rb +176 -0
- data/lib/factpulse/models/invoice_payment_input.rb +267 -0
- data/lib/factpulse/models/invoice_references.rb +393 -0
- data/lib/factpulse/models/invoice_status.rb +203 -0
- data/lib/factpulse/models/invoice_totals.rb +312 -0
- data/lib/factpulse/models/invoice_totals_prepayment.rb +104 -0
- data/lib/factpulse/models/invoice_type_code.rb +54 -0
- data/lib/factpulse/models/invoice_type_code_output.rb +54 -0
- data/lib/factpulse/models/invoicing_framework.rb +218 -0
- data/lib/factpulse/models/invoicing_framework_code.rb +42 -0
- data/lib/factpulse/models/issuer_role_code.rb +40 -0
- data/lib/factpulse/models/key_rotation_request.rb +211 -0
- data/lib/factpulse/models/key_rotation_response.rb +232 -0
- data/lib/factpulse/models/line_net_amount.rb +104 -0
- data/lib/factpulse/models/line_sub_type.rb +41 -0
- data/lib/factpulse/models/line_total_amount.rb +104 -0
- data/lib/factpulse/models/location_inner.rb +103 -0
- data/lib/factpulse/models/mandatory_note_schema.rb +265 -0
- data/lib/factpulse/models/manual_rate.rb +104 -0
- data/lib/factpulse/models/manual_vat_rate.rb +104 -0
- data/lib/factpulse/models/missing_field.rb +269 -0
- data/lib/factpulse/models/operation_nature.rb +52 -0
- data/lib/factpulse/models/output_format.rb +40 -0
- data/lib/factpulse/models/page_dimensions_schema.rb +193 -0
- data/lib/factpulse/models/payee.rb +281 -0
- data/lib/factpulse/models/payment_amount_by_rate.rb +191 -0
- data/lib/factpulse/models/payment_card.rb +159 -0
- data/lib/factpulse/models/payment_means.rb +44 -0
- data/lib/factpulse/models/pdf_validation_result_api.rb +523 -0
- data/lib/factpulse/models/pdp_config_response.rb +306 -0
- data/lib/factpulse/models/pdp_config_update_request.rb +315 -0
- data/lib/factpulse/models/pdp_credentials.rb +257 -0
- data/lib/factpulse/models/percentage.rb +104 -0
- data/lib/factpulse/models/postal_address.rb +209 -0
- 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 +207 -0
- data/lib/factpulse/models/processing_rule.rb +44 -0
- data/lib/factpulse/models/product_characteristic.rb +193 -0
- data/lib/factpulse/models/product_classification.rb +186 -0
- data/lib/factpulse/models/quantity.rb +104 -0
- data/lib/factpulse/models/rate.rb +104 -0
- data/lib/factpulse/models/rate1.rb +104 -0
- data/lib/factpulse/models/reason_code_info.rb +220 -0
- data/lib/factpulse/models/reason_codes_response.rb +207 -0
- data/lib/factpulse/models/recipient.rb +231 -0
- data/lib/factpulse/models/recipient_input.rb +191 -0
- data/lib/factpulse/models/refusee_request.rb +346 -0
- data/lib/factpulse/models/report_issuer.rb +236 -0
- data/lib/factpulse/models/report_period.rb +193 -0
- data/lib/factpulse/models/report_sender.rb +221 -0
- data/lib/factpulse/models/rounding_amount.rb +104 -0
- data/lib/factpulse/models/schematron_validation_error.rb +294 -0
- data/lib/factpulse/models/scheme_id.rb +56 -0
- data/lib/factpulse/models/search_flow_request.rb +306 -0
- data/lib/factpulse/models/search_flow_response.rb +249 -0
- data/lib/factpulse/models/search_services_response.rb +217 -0
- data/lib/factpulse/models/search_structure_request.rb +191 -0
- data/lib/factpulse/models/search_structure_response.rb +216 -0
- data/lib/factpulse/models/secret_status.rb +213 -0
- data/lib/factpulse/models/sellercountry.rb +104 -0
- data/lib/factpulse/models/signature_info.rb +186 -0
- data/lib/factpulse/models/signature_info_api.rb +216 -0
- data/lib/factpulse/models/signature_parameters.rb +235 -0
- data/lib/factpulse/models/simplified_cdar_response.rb +274 -0
- data/lib/factpulse/models/simplified_invoice_data.rb +404 -0
- data/lib/factpulse/models/status_code_info.rb +220 -0
- data/lib/factpulse/models/status_codes_response.rb +207 -0
- data/lib/factpulse/models/structure_info.rb +274 -0
- data/lib/factpulse/models/structure_parameters.rb +175 -0
- data/lib/factpulse/models/structure_service.rb +247 -0
- data/lib/factpulse/models/submission_mode.rb +41 -0
- data/lib/factpulse/models/submit_aggregated_report_request.rb +216 -0
- data/lib/factpulse/models/submit_cdar_request.rb +466 -0
- data/lib/factpulse/models/submit_cdar_response.rb +213 -0
- data/lib/factpulse/models/submit_cdarxml_request.rb +228 -0
- data/lib/factpulse/models/submit_complete_invoice_request.rb +239 -0
- data/lib/factpulse/models/submit_complete_invoice_response.rb +355 -0
- data/lib/factpulse/models/submit_e_reporting_request.rb +216 -0
- data/lib/factpulse/models/submit_e_reporting_response.rb +306 -0
- data/lib/factpulse/models/submit_flow_request.rb +238 -0
- data/lib/factpulse/models/submit_flow_response.rb +294 -0
- data/lib/factpulse/models/submit_gross_amount.rb +104 -0
- data/lib/factpulse/models/submit_invoice_request.rb +388 -0
- data/lib/factpulse/models/submit_invoice_response.rb +213 -0
- data/lib/factpulse/models/submit_net_amount.rb +104 -0
- data/lib/factpulse/models/submit_vat_amount.rb +104 -0
- data/lib/factpulse/models/supplementary_attachment.rb +274 -0
- data/lib/factpulse/models/supplier.rb +337 -0
- data/lib/factpulse/models/task_response.rb +166 -0
- data/lib/factpulse/models/tax_breakdown_input.rb +217 -0
- data/lib/factpulse/models/tax_due_date_type.rb +44 -0
- data/lib/factpulse/models/tax_representative.rb +220 -0
- data/lib/factpulse/models/taxable_amount.rb +104 -0
- data/lib/factpulse/models/taxableamount.rb +104 -0
- data/lib/factpulse/models/taxamount.rb +104 -0
- data/lib/factpulse/models/taxamount1.rb +104 -0
- data/lib/factpulse/models/taxamount2.rb +104 -0
- data/lib/factpulse/models/taxexclusiveamount.rb +104 -0
- data/lib/factpulse/models/taxexclusiveamount1.rb +104 -0
- data/lib/factpulse/models/total_gross_amount.rb +104 -0
- data/lib/factpulse/models/total_net_amount.rb +104 -0
- data/lib/factpulse/models/total_vat_amount.rb +104 -0
- data/lib/factpulse/models/transaction_category.rb +42 -0
- data/lib/factpulse/models/transmission_type_code.rb +40 -0
- data/lib/factpulse/models/unit_net_price.rb +104 -0
- data/lib/factpulse/models/unit_of_measure.rb +44 -0
- data/lib/factpulse/models/validate_cdar_request.rb +219 -0
- data/lib/factpulse/models/validate_cdar_response.rb +190 -0
- data/lib/factpulse/models/validate_e_reporting_request.rb +166 -0
- data/lib/factpulse/models/validate_e_reporting_response.rb +271 -0
- data/lib/factpulse/models/validation_error.rb +218 -0
- data/lib/factpulse/models/validation_error_detail.rb +245 -0
- data/lib/factpulse/models/validation_error_response.rb +215 -0
- data/lib/factpulse/models/validation_info.rb +255 -0
- data/lib/factpulse/models/validation_success_response.rb +166 -0
- data/lib/factpulse/models/vat_accounting_code.rb +42 -0
- data/lib/factpulse/models/vat_amount.rb +104 -0
- data/lib/factpulse/models/vat_category.rb +47 -0
- data/lib/factpulse/models/vat_line.rb +272 -0
- data/lib/factpulse/models/vat_point_date_code.rb +41 -0
- data/lib/factpulse/models/vat_rate.rb +104 -0
- data/lib/factpulse/models/verification_success_response.rb +343 -0
- data/lib/factpulse/models/verified_field_schema.rb +334 -0
- data/lib/factpulse/models/webhook_secret_delete_response.rb +193 -0
- data/lib/factpulse/models/webhook_secret_generate_response.rb +247 -0
- data/lib/factpulse/models/webhook_secret_status_response.rb +176 -0
- data/lib/factpulse/version.rb +15 -0
- data/lib/factpulse.rb +369 -0
- metadata +806 -0
|
@@ -0,0 +1,256 @@
|
|
|
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 - 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) ### ✅ Factur-X - Validation - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) ### ✍️ Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification ### 📋 Flux 6 - Invoice Lifecycle (CDAR) - **CDAR Messages**: Acknowledgements, invoice statuses - **PPF Statuses**: REFUSED (210), PAID (212) ### 📊 Flux 10 - E-Reporting - **Tax Declarations**: International B2B, B2C - **Flow Types**: 10.1 (B2B transactions), 10.2 (B2B payments), 10.3 (B2C transactions), 10.4 (B2C payments) ### 📡 AFNOR PDP/PA (XP Z12-013) - **Flow Service**: Submit and search flows to PDPs - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user ### 🏛️ Chorus Pro - **Public Sector Invoicing**: Complete API for Chorus Pro ### ⏳ Async Tasks - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **Webhooks**: Automatic notifications when tasks complete ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: contact@factpulse.fr
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.20.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module FactPulse
|
|
16
|
+
class FacturXValidationApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Validate a complete Factur-X PDF
|
|
23
|
+
# Validates a complete Factur-X PDF according to European and French standards. ## Applied validation standards - **EN 16931**: European semantic standard (directive 2014/55/EU) - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Factur-X / ZUGFeRD**: Franco-German specification - **Schematron**: XML business rules validation - **eIDAS**: European regulation on electronic identification (signatures) ## Checks performed ### 1. Factur-X XML extraction and validation **Checks performed:** - Presence of embedded XML file (`factur-x.xml` or `zugferd-invoice.xml`) - Automatic profile detection (MINIMUM, BASIC, EN16931, EXTENDED) - XML parsing with UTF-8 validation - GuidelineSpecifiedDocumentContextParameter/ID extraction **Schematron validation:** - Business rules for detected profile (MINIMUM: 45 rules, EN16931: 178 rules) - Cardinality of required elements - Calculation consistency (net, VAT, gross amounts, discounts) - Identifier formats (SIRET, intra-EU VAT, IBAN) - Standardized codes (ISO country codes, UN/ECE units, VAT codes) **What is verified:** - ✅ XML structure conforming to Cross Industry Invoice XSD - ✅ Correct UN/CEFACT namespace - ✅ European business rules (BR-xx) - ✅ French-specific rules (FR-xx) ### 2. PDF/A-3 compliance **Basic validation (metadata):** - Presence of `/Type` field set to `Catalog` - Metadata `pdfaid:part` = 3 (PDF/A-3) - Metadata `pdfaid:conformance` = B or U - PDF version >= 1.4 **Strict VeraPDF validation (if use_verapdf=True):** - 146+ ISO 19005-3 rules (PDF/A-3B) - Absence of forbidden content (JavaScript, multimedia, dynamic forms) - Correctly embedded fonts and subsets - Compliant color spaces (sRGB, DeviceGray) - Valid file structure (cross-reference table) - XMP metadata conforming to ISO 16684-1 **What is verified:** - ✅ Long-term archivable file (20+ years) - ✅ Guaranteed readability (embedded fonts) - ✅ Legal compliance (France, Germany, EU) ### 3. XMP metadata (eXtensible Metadata Platform) **Checks performed:** - Presence of `<?xpacket>` block with XMP metadata - `fx:` namespace for Factur-X: `urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#` - Required Factur-X fields: - `fx:ConformanceLevel`: Profile (MINIMUM, BASIC, EN16931, EXTENDED) - `fx:DocumentFileName`: Embedded XML name - `fx:DocumentType`: \"INVOICE\" - `fx:Version`: Factur-X version (1.0.07) **What is verified:** - ✅ Metadata conforming to ISO 16684-1 - ✅ Correct declared Factur-X profile - ✅ Supported Factur-X version ### 4. Electronic signatures **Detection and analysis:** - Presence of `/Sig` dictionaries in PDF - Signature type: PAdES (PDF Advanced Electronic Signature) - Information extraction: - Signer name (`/Name`) - Signing date (`/M`) - Signature reason (`/Reason`) - Signature location (`/Location`) - Signature type (approval, certification) **What is verified:** - ✅ Presence of signatures or seals - ✅ Number of signatures (single or multi-signature) - ℹ️ No cryptographic verification (requires certificates) ## Parameters - **pdf_file** (required): The Factur-X PDF file to validate - **profile** (optional): Expected profile. If absent, auto-detected from XML - **use_verapdf** (optional, default=false): Enable strict PDF/A validation with VeraPDF - `false`: Fast metadata validation (2-3 seconds) - `true`: Complete ISO 19005-3 validation (15-30 seconds, **recommended for production**) ## Detailed response ```json { \"isCompliant\": true, \"xml\": { \"present\": true, \"compliant\": true, \"profile\": \"EN16931\", \"errors\": [] }, \"pdfa\": { \"compliant\": true, \"version\": \"PDF/A-3B\", \"method\": \"verapdf\", \"errors\": [] }, \"xmp\": { \"present\": true, \"compliant\": true, \"metadata\": {...} }, \"signatures\": { \"present\": true, \"count\": 1, \"details\": [...] } } ``` ## Use cases - **Before sending**: Validate generated invoice before transmission to client - **On reception**: Verify compliance of invoice received from supplier - **Audit**: Check quality of invoice batches - **Legal compliance**: Ensure B2B/B2G obligations are met in France - **Debugging**: Identify issues in generation process - **Archiving**: Guarantee long-term validity (PDF/A-3) ## Processing time - Basic validation: 2-3 seconds - VeraPDF validation: 15-30 seconds (depends on PDF size)
|
|
24
|
+
# @param pdf_file [File] Factur-X PDF file to validate (.pdf format).
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [APIProfile] :profile
|
|
27
|
+
# @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation. (default to false)
|
|
28
|
+
# @option opts [Boolean] :skip_br_fr
|
|
29
|
+
# @return [PDFValidationResultAPI]
|
|
30
|
+
def validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post(pdf_file, opts = {})
|
|
31
|
+
data, _status_code, _headers = validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post_with_http_info(pdf_file, opts)
|
|
32
|
+
data
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Validate a complete Factur-X PDF
|
|
36
|
+
# Validates a complete Factur-X PDF according to European and French standards. ## Applied validation standards - **EN 16931**: European semantic standard (directive 2014/55/EU) - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Factur-X / ZUGFeRD**: Franco-German specification - **Schematron**: XML business rules validation - **eIDAS**: European regulation on electronic identification (signatures) ## Checks performed ### 1. Factur-X XML extraction and validation **Checks performed:** - Presence of embedded XML file (`factur-x.xml` or `zugferd-invoice.xml`) - Automatic profile detection (MINIMUM, BASIC, EN16931, EXTENDED) - XML parsing with UTF-8 validation - GuidelineSpecifiedDocumentContextParameter/ID extraction **Schematron validation:** - Business rules for detected profile (MINIMUM: 45 rules, EN16931: 178 rules) - Cardinality of required elements - Calculation consistency (net, VAT, gross amounts, discounts) - Identifier formats (SIRET, intra-EU VAT, IBAN) - Standardized codes (ISO country codes, UN/ECE units, VAT codes) **What is verified:** - ✅ XML structure conforming to Cross Industry Invoice XSD - ✅ Correct UN/CEFACT namespace - ✅ European business rules (BR-xx) - ✅ French-specific rules (FR-xx) ### 2. PDF/A-3 compliance **Basic validation (metadata):** - Presence of `/Type` field set to `Catalog` - Metadata `pdfaid:part` = 3 (PDF/A-3) - Metadata `pdfaid:conformance` = B or U - PDF version >= 1.4 **Strict VeraPDF validation (if use_verapdf=True):** - 146+ ISO 19005-3 rules (PDF/A-3B) - Absence of forbidden content (JavaScript, multimedia, dynamic forms) - Correctly embedded fonts and subsets - Compliant color spaces (sRGB, DeviceGray) - Valid file structure (cross-reference table) - XMP metadata conforming to ISO 16684-1 **What is verified:** - ✅ Long-term archivable file (20+ years) - ✅ Guaranteed readability (embedded fonts) - ✅ Legal compliance (France, Germany, EU) ### 3. XMP metadata (eXtensible Metadata Platform) **Checks performed:** - Presence of `<?xpacket>` block with XMP metadata - `fx:` namespace for Factur-X: `urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#` - Required Factur-X fields: - `fx:ConformanceLevel`: Profile (MINIMUM, BASIC, EN16931, EXTENDED) - `fx:DocumentFileName`: Embedded XML name - `fx:DocumentType`: \"INVOICE\" - `fx:Version`: Factur-X version (1.0.07) **What is verified:** - ✅ Metadata conforming to ISO 16684-1 - ✅ Correct declared Factur-X profile - ✅ Supported Factur-X version ### 4. Electronic signatures **Detection and analysis:** - Presence of `/Sig` dictionaries in PDF - Signature type: PAdES (PDF Advanced Electronic Signature) - Information extraction: - Signer name (`/Name`) - Signing date (`/M`) - Signature reason (`/Reason`) - Signature location (`/Location`) - Signature type (approval, certification) **What is verified:** - ✅ Presence of signatures or seals - ✅ Number of signatures (single or multi-signature) - ℹ️ No cryptographic verification (requires certificates) ## Parameters - **pdf_file** (required): The Factur-X PDF file to validate - **profile** (optional): Expected profile. If absent, auto-detected from XML - **use_verapdf** (optional, default=false): Enable strict PDF/A validation with VeraPDF - `false`: Fast metadata validation (2-3 seconds) - `true`: Complete ISO 19005-3 validation (15-30 seconds, **recommended for production**) ## Detailed response ```json { \"isCompliant\": true, \"xml\": { \"present\": true, \"compliant\": true, \"profile\": \"EN16931\", \"errors\": [] }, \"pdfa\": { \"compliant\": true, \"version\": \"PDF/A-3B\", \"method\": \"verapdf\", \"errors\": [] }, \"xmp\": { \"present\": true, \"compliant\": true, \"metadata\": {...} }, \"signatures\": { \"present\": true, \"count\": 1, \"details\": [...] } } ``` ## Use cases - **Before sending**: Validate generated invoice before transmission to client - **On reception**: Verify compliance of invoice received from supplier - **Audit**: Check quality of invoice batches - **Legal compliance**: Ensure B2B/B2G obligations are met in France - **Debugging**: Identify issues in generation process - **Archiving**: Guarantee long-term validity (PDF/A-3) ## Processing time - Basic validation: 2-3 seconds - VeraPDF validation: 15-30 seconds (depends on PDF size)
|
|
37
|
+
# @param pdf_file [File] Factur-X PDF file to validate (.pdf format).
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @option opts [APIProfile] :profile
|
|
40
|
+
# @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation. (default to false)
|
|
41
|
+
# @option opts [Boolean] :skip_br_fr
|
|
42
|
+
# @return [Array<(PDFValidationResultAPI, Integer, Hash)>] PDFValidationResultAPI data, response status code and response headers
|
|
43
|
+
def validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post_with_http_info(pdf_file, opts = {})
|
|
44
|
+
if @api_client.config.debugging
|
|
45
|
+
@api_client.config.logger.debug 'Calling API: FacturXValidationApi.validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post ...'
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'pdf_file' is set
|
|
48
|
+
if @api_client.config.client_side_validation && pdf_file.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'pdf_file' when calling FacturXValidationApi.validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/api/v1/processing/validate-facturx-pdf'
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = opts[:query_params] || {}
|
|
56
|
+
|
|
57
|
+
# header parameters
|
|
58
|
+
header_params = opts[:header_params] || {}
|
|
59
|
+
# HTTP header 'Accept' (if needed)
|
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
61
|
+
# HTTP header 'Content-Type'
|
|
62
|
+
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
63
|
+
if !content_type.nil?
|
|
64
|
+
header_params['Content-Type'] = content_type
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = opts[:form_params] || {}
|
|
69
|
+
form_params['pdf_file'] = pdf_file
|
|
70
|
+
form_params['profile'] = opts[:'profile'] if !opts[:'profile'].nil?
|
|
71
|
+
form_params['use_verapdf'] = opts[:'use_verapdf'] if !opts[:'use_verapdf'].nil?
|
|
72
|
+
form_params['skip_br_fr'] = opts[:'skip_br_fr'] if !opts[:'skip_br_fr'].nil?
|
|
73
|
+
|
|
74
|
+
# http body (model)
|
|
75
|
+
post_body = opts[:debug_body]
|
|
76
|
+
|
|
77
|
+
# return_type
|
|
78
|
+
return_type = opts[:debug_return_type] || 'PDFValidationResultAPI'
|
|
79
|
+
|
|
80
|
+
# auth_names
|
|
81
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'HTTPBearer']
|
|
82
|
+
|
|
83
|
+
new_options = opts.merge(
|
|
84
|
+
:operation => :"FacturXValidationApi.validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post",
|
|
85
|
+
:header_params => header_params,
|
|
86
|
+
:query_params => query_params,
|
|
87
|
+
:form_params => form_params,
|
|
88
|
+
:body => post_body,
|
|
89
|
+
:auth_names => auth_names,
|
|
90
|
+
:return_type => return_type
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
94
|
+
if @api_client.config.debugging
|
|
95
|
+
@api_client.config.logger.debug "API called: FacturXValidationApi#validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
96
|
+
end
|
|
97
|
+
return data, status_code, headers
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Validate a Factur-X PDF (asynchronous with polling)
|
|
101
|
+
# Validates a Factur-X PDF asynchronously with polling system. ## How it works 1. **Submission**: PDF is queued for asynchronous validation 2. **Immediate return**: You receive a `task_id` (HTTP 202) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Advantages of asynchronous mode - **No timeout**: Ideal for large PDFs or VeraPDF validation (which can take several seconds) - **Scalability**: Validations are processed by dedicated Celery workers - **Status tracking**: Allows you to monitor validation progress - **Non-blocking**: Your client doesn't wait during validation ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when validation completes: ``` callback_url=https://your-server.com/webhook webhook_mode=download_url # Optional: get download URL instead of base64 ``` The webhook will POST a JSON payload with: - `event_type`: `validation.completed` or `validation.failed` - `data.is_compliant`: Whether the PDF is Factur-X compliant - `data.detected_profile`: The detected Factur-X profile - `X-Webhook-Signature` header for HMAC verification ## When to use this mode? - **VeraPDF validation enabled** (`use_verapdf=True`): Strict validation can take 2-10 seconds - **Large PDF files**: PDFs > 1 MB - **Batch processing**: Validating multiple invoices in parallel - **Asynchronous integration**: Your system supports polling ## Checks performed ### 1. Factur-X XML extraction and validation - Verifies presence of Factur-X compliant embedded XML file - Automatically detects profile used (MINIMUM, BASIC, EN16931, EXTENDED) - Validates XML against detected profile's Schematron rules ### 2. PDF/A compliance - **Without VeraPDF**: Basic metadata validation (fast, ~100ms) - **With VeraPDF**: Strict ISO 19005 validation (146+ rules, 2-10s) - Detects PDF/A version (PDF/A-1, PDF/A-3, etc.) - Detailed non-compliance reports ### 3. XMP metadata - Verifies presence of XMP metadata in PDF - Validates Factur-X metadata compliance (profile, version) - Extracts all available XMP metadata ### 4. Electronic signatures - Detects presence of electronic signatures or seals - Extracts information about each signature (signer, date, reason) - Counts number of signatures present ## Parameters - **pdf_file**: The Factur-X PDF file to validate - **profile**: Expected Factur-X profile (optional). If not specified, profile will be auto-detected from embedded XML file. - **use_verapdf**: Enable strict PDF/A validation with VeraPDF. ⚠️ **Warning**: VeraPDF can take 2-10 seconds depending on PDF size. Recommended only in asynchronous mode to avoid timeouts. ## Retrieving results After submission, use `GET /tasks/{task_id}/status` endpoint to retrieve the result. **Polling example**: ```python import requests import time # 1. Submit task response = requests.post(\"/validate-facturx-async\", files={\"pdf_file\": pdf_file}) task_id = response.json()[\"taskId\"] # 2. Poll every 2 seconds while True: status_response = requests.get(f\"/tasks/{task_id}/status\") status = status_response.json() if status[\"status\"] == \"SUCCESS\": result = status[\"result\"][\"validation_result\"] print(f\"Compliant: {result['is_compliant']}\") break elif status[\"status\"] == \"FAILURE\": print(f\"Error: {status['result']['errorMessage']}\") break time.sleep(2) # Wait 2 seconds before next check ``` ## Use cases - Validate invoices before sending with VeraPDF (strict validation) - Process invoice batches in parallel - Integrate validation into an asynchronous pipeline - Validate large PDFs without timeout risk
|
|
102
|
+
# @param pdf_file [File] Factur-X PDF file to validate (.pdf format).
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @option opts [APIProfile] :profile
|
|
105
|
+
# @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds. (default to false)
|
|
106
|
+
# @option opts [String] :callback_url
|
|
107
|
+
# @option opts [String] :webhook_mode Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')
|
|
108
|
+
# @return [TaskResponse]
|
|
109
|
+
def validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post(pdf_file, opts = {})
|
|
110
|
+
data, _status_code, _headers = validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post_with_http_info(pdf_file, opts)
|
|
111
|
+
data
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Validate a Factur-X PDF (asynchronous with polling)
|
|
115
|
+
# Validates a Factur-X PDF asynchronously with polling system. ## How it works 1. **Submission**: PDF is queued for asynchronous validation 2. **Immediate return**: You receive a `task_id` (HTTP 202) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Advantages of asynchronous mode - **No timeout**: Ideal for large PDFs or VeraPDF validation (which can take several seconds) - **Scalability**: Validations are processed by dedicated Celery workers - **Status tracking**: Allows you to monitor validation progress - **Non-blocking**: Your client doesn't wait during validation ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when validation completes: ``` callback_url=https://your-server.com/webhook webhook_mode=download_url # Optional: get download URL instead of base64 ``` The webhook will POST a JSON payload with: - `event_type`: `validation.completed` or `validation.failed` - `data.is_compliant`: Whether the PDF is Factur-X compliant - `data.detected_profile`: The detected Factur-X profile - `X-Webhook-Signature` header for HMAC verification ## When to use this mode? - **VeraPDF validation enabled** (`use_verapdf=True`): Strict validation can take 2-10 seconds - **Large PDF files**: PDFs > 1 MB - **Batch processing**: Validating multiple invoices in parallel - **Asynchronous integration**: Your system supports polling ## Checks performed ### 1. Factur-X XML extraction and validation - Verifies presence of Factur-X compliant embedded XML file - Automatically detects profile used (MINIMUM, BASIC, EN16931, EXTENDED) - Validates XML against detected profile's Schematron rules ### 2. PDF/A compliance - **Without VeraPDF**: Basic metadata validation (fast, ~100ms) - **With VeraPDF**: Strict ISO 19005 validation (146+ rules, 2-10s) - Detects PDF/A version (PDF/A-1, PDF/A-3, etc.) - Detailed non-compliance reports ### 3. XMP metadata - Verifies presence of XMP metadata in PDF - Validates Factur-X metadata compliance (profile, version) - Extracts all available XMP metadata ### 4. Electronic signatures - Detects presence of electronic signatures or seals - Extracts information about each signature (signer, date, reason) - Counts number of signatures present ## Parameters - **pdf_file**: The Factur-X PDF file to validate - **profile**: Expected Factur-X profile (optional). If not specified, profile will be auto-detected from embedded XML file. - **use_verapdf**: Enable strict PDF/A validation with VeraPDF. ⚠️ **Warning**: VeraPDF can take 2-10 seconds depending on PDF size. Recommended only in asynchronous mode to avoid timeouts. ## Retrieving results After submission, use `GET /tasks/{task_id}/status` endpoint to retrieve the result. **Polling example**: ```python import requests import time # 1. Submit task response = requests.post(\"/validate-facturx-async\", files={\"pdf_file\": pdf_file}) task_id = response.json()[\"taskId\"] # 2. Poll every 2 seconds while True: status_response = requests.get(f\"/tasks/{task_id}/status\") status = status_response.json() if status[\"status\"] == \"SUCCESS\": result = status[\"result\"][\"validation_result\"] print(f\"Compliant: {result['is_compliant']}\") break elif status[\"status\"] == \"FAILURE\": print(f\"Error: {status['result']['errorMessage']}\") break time.sleep(2) # Wait 2 seconds before next check ``` ## Use cases - Validate invoices before sending with VeraPDF (strict validation) - Process invoice batches in parallel - Integrate validation into an asynchronous pipeline - Validate large PDFs without timeout risk
|
|
116
|
+
# @param pdf_file [File] Factur-X PDF file to validate (.pdf format).
|
|
117
|
+
# @param [Hash] opts the optional parameters
|
|
118
|
+
# @option opts [APIProfile] :profile
|
|
119
|
+
# @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds. (default to false)
|
|
120
|
+
# @option opts [String] :callback_url
|
|
121
|
+
# @option opts [String] :webhook_mode Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')
|
|
122
|
+
# @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
|
|
123
|
+
def validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post_with_http_info(pdf_file, opts = {})
|
|
124
|
+
if @api_client.config.debugging
|
|
125
|
+
@api_client.config.logger.debug 'Calling API: FacturXValidationApi.validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post ...'
|
|
126
|
+
end
|
|
127
|
+
# verify the required parameter 'pdf_file' is set
|
|
128
|
+
if @api_client.config.client_side_validation && pdf_file.nil?
|
|
129
|
+
fail ArgumentError, "Missing the required parameter 'pdf_file' when calling FacturXValidationApi.validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post"
|
|
130
|
+
end
|
|
131
|
+
# resource path
|
|
132
|
+
local_var_path = '/api/v1/processing/validate-facturx-async'
|
|
133
|
+
|
|
134
|
+
# query parameters
|
|
135
|
+
query_params = opts[:query_params] || {}
|
|
136
|
+
|
|
137
|
+
# header parameters
|
|
138
|
+
header_params = opts[:header_params] || {}
|
|
139
|
+
# HTTP header 'Accept' (if needed)
|
|
140
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
141
|
+
# HTTP header 'Content-Type'
|
|
142
|
+
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
143
|
+
if !content_type.nil?
|
|
144
|
+
header_params['Content-Type'] = content_type
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# form parameters
|
|
148
|
+
form_params = opts[:form_params] || {}
|
|
149
|
+
form_params['pdf_file'] = pdf_file
|
|
150
|
+
form_params['profile'] = opts[:'profile'] if !opts[:'profile'].nil?
|
|
151
|
+
form_params['use_verapdf'] = opts[:'use_verapdf'] if !opts[:'use_verapdf'].nil?
|
|
152
|
+
form_params['callback_url'] = opts[:'callback_url'] if !opts[:'callback_url'].nil?
|
|
153
|
+
form_params['webhook_mode'] = opts[:'webhook_mode'] if !opts[:'webhook_mode'].nil?
|
|
154
|
+
|
|
155
|
+
# http body (model)
|
|
156
|
+
post_body = opts[:debug_body]
|
|
157
|
+
|
|
158
|
+
# return_type
|
|
159
|
+
return_type = opts[:debug_return_type] || 'TaskResponse'
|
|
160
|
+
|
|
161
|
+
# auth_names
|
|
162
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'HTTPBearer']
|
|
163
|
+
|
|
164
|
+
new_options = opts.merge(
|
|
165
|
+
:operation => :"FacturXValidationApi.validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post",
|
|
166
|
+
:header_params => header_params,
|
|
167
|
+
:query_params => query_params,
|
|
168
|
+
:form_params => form_params,
|
|
169
|
+
:body => post_body,
|
|
170
|
+
:auth_names => auth_names,
|
|
171
|
+
:return_type => return_type
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
175
|
+
if @api_client.config.debugging
|
|
176
|
+
@api_client.config.logger.debug "API called: FacturXValidationApi#validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
177
|
+
end
|
|
178
|
+
return data, status_code, headers
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Validate an existing Factur-X XML
|
|
182
|
+
# Validates a Factur-X XML file against Schematron business rules according to EN 16931 standard. ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific Factur-X rules - Arithmetic calculations and data consistency ## Profiles and validated rules ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - `BR-1`: Invoice total must equal sum of line totals + document-level amounts - `BR-CO-10`: Sum of VAT base amounts must equal invoice net total - `BR-16`: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - `FR-1`: Supplier SIRET must have 14 digits - `FR-2`: Customer SIRET must have 14 digits (if present) - `FR-5`: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT = Gross amounts - Sum of lines = Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002=SIREN, 0009=SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of errors (`failed-assert`) and warnings (`successful-report`) 4. **Report**: Structured list of non-conformities ## Responses **200 OK**: Compliant XML ```json { \"message\": \"XML is compliant with EN16931 profile\" } ``` **400 Bad Request**: Non-compliant XML ```json { \"detail\": [ \"[BR-1] Invoice total (120.00) does not match calculated sum (100.00 + 20.00)\", \"[FR-1] Supplier SIRET must contain exactly 14 digits\" ] } ``` ## Use cases - **Pre-validation**: Verify XML before PDF/A integration - **Debugging**: Precisely identify generation errors - **Testing**: Validate test or example XMLs - **Compliance**: Ensure European and French rules are met - **Development**: Quick testing without PDF generation ## Processing time - MINIMUM profile: ~0.5 second - EN16931 profile: ~1-2 seconds - EXTENDED profile: ~2-3 seconds
|
|
183
|
+
# @param xml_file [File] Factur-X XML file to validate (.xml format).
|
|
184
|
+
# @param [Hash] opts the optional parameters
|
|
185
|
+
# @option opts [APIProfile] :profile Validation profile (MINIMUM, BASIC, EN16931, EXTENDED).
|
|
186
|
+
# @option opts [Boolean] :skip_br_fr
|
|
187
|
+
# @return [ValidationSuccessResponse]
|
|
188
|
+
def validate_xml_api_v1_processing_validate_xml_post(xml_file, opts = {})
|
|
189
|
+
data, _status_code, _headers = validate_xml_api_v1_processing_validate_xml_post_with_http_info(xml_file, opts)
|
|
190
|
+
data
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Validate an existing Factur-X XML
|
|
194
|
+
# Validates a Factur-X XML file against Schematron business rules according to EN 16931 standard. ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific Factur-X rules - Arithmetic calculations and data consistency ## Profiles and validated rules ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - `BR-1`: Invoice total must equal sum of line totals + document-level amounts - `BR-CO-10`: Sum of VAT base amounts must equal invoice net total - `BR-16`: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - `FR-1`: Supplier SIRET must have 14 digits - `FR-2`: Customer SIRET must have 14 digits (if present) - `FR-5`: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT = Gross amounts - Sum of lines = Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002=SIREN, 0009=SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of errors (`failed-assert`) and warnings (`successful-report`) 4. **Report**: Structured list of non-conformities ## Responses **200 OK**: Compliant XML ```json { \"message\": \"XML is compliant with EN16931 profile\" } ``` **400 Bad Request**: Non-compliant XML ```json { \"detail\": [ \"[BR-1] Invoice total (120.00) does not match calculated sum (100.00 + 20.00)\", \"[FR-1] Supplier SIRET must contain exactly 14 digits\" ] } ``` ## Use cases - **Pre-validation**: Verify XML before PDF/A integration - **Debugging**: Precisely identify generation errors - **Testing**: Validate test or example XMLs - **Compliance**: Ensure European and French rules are met - **Development**: Quick testing without PDF generation ## Processing time - MINIMUM profile: ~0.5 second - EN16931 profile: ~1-2 seconds - EXTENDED profile: ~2-3 seconds
|
|
195
|
+
# @param xml_file [File] Factur-X XML file to validate (.xml format).
|
|
196
|
+
# @param [Hash] opts the optional parameters
|
|
197
|
+
# @option opts [APIProfile] :profile Validation profile (MINIMUM, BASIC, EN16931, EXTENDED).
|
|
198
|
+
# @option opts [Boolean] :skip_br_fr
|
|
199
|
+
# @return [Array<(ValidationSuccessResponse, Integer, Hash)>] ValidationSuccessResponse data, response status code and response headers
|
|
200
|
+
def validate_xml_api_v1_processing_validate_xml_post_with_http_info(xml_file, opts = {})
|
|
201
|
+
if @api_client.config.debugging
|
|
202
|
+
@api_client.config.logger.debug 'Calling API: FacturXValidationApi.validate_xml_api_v1_processing_validate_xml_post ...'
|
|
203
|
+
end
|
|
204
|
+
# verify the required parameter 'xml_file' is set
|
|
205
|
+
if @api_client.config.client_side_validation && xml_file.nil?
|
|
206
|
+
fail ArgumentError, "Missing the required parameter 'xml_file' when calling FacturXValidationApi.validate_xml_api_v1_processing_validate_xml_post"
|
|
207
|
+
end
|
|
208
|
+
# resource path
|
|
209
|
+
local_var_path = '/api/v1/processing/validate-xml'
|
|
210
|
+
|
|
211
|
+
# query parameters
|
|
212
|
+
query_params = opts[:query_params] || {}
|
|
213
|
+
|
|
214
|
+
# header parameters
|
|
215
|
+
header_params = opts[:header_params] || {}
|
|
216
|
+
# HTTP header 'Accept' (if needed)
|
|
217
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
218
|
+
# HTTP header 'Content-Type'
|
|
219
|
+
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
220
|
+
if !content_type.nil?
|
|
221
|
+
header_params['Content-Type'] = content_type
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# form parameters
|
|
225
|
+
form_params = opts[:form_params] || {}
|
|
226
|
+
form_params['xml_file'] = xml_file
|
|
227
|
+
form_params['profile'] = opts[:'profile'] if !opts[:'profile'].nil?
|
|
228
|
+
form_params['skip_br_fr'] = opts[:'skip_br_fr'] if !opts[:'skip_br_fr'].nil?
|
|
229
|
+
|
|
230
|
+
# http body (model)
|
|
231
|
+
post_body = opts[:debug_body]
|
|
232
|
+
|
|
233
|
+
# return_type
|
|
234
|
+
return_type = opts[:debug_return_type] || 'ValidationSuccessResponse'
|
|
235
|
+
|
|
236
|
+
# auth_names
|
|
237
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'HTTPBearer']
|
|
238
|
+
|
|
239
|
+
new_options = opts.merge(
|
|
240
|
+
:operation => :"FacturXValidationApi.validate_xml_api_v1_processing_validate_xml_post",
|
|
241
|
+
:header_params => header_params,
|
|
242
|
+
:query_params => query_params,
|
|
243
|
+
:form_params => form_params,
|
|
244
|
+
:body => post_body,
|
|
245
|
+
:auth_names => auth_names,
|
|
246
|
+
:return_type => return_type
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
250
|
+
if @api_client.config.debugging
|
|
251
|
+
@api_client.config.logger.debug "API called: FacturXValidationApi#validate_xml_api_v1_processing_validate_xml_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
252
|
+
end
|
|
253
|
+
return data, status_code, headers
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
end
|
|
@@ -0,0 +1,232 @@
|
|
|
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 - 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) ### ✅ Factur-X - Validation - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) ### ✍️ Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification ### 📋 Flux 6 - Invoice Lifecycle (CDAR) - **CDAR Messages**: Acknowledgements, invoice statuses - **PPF Statuses**: REFUSED (210), PAID (212) ### 📊 Flux 10 - E-Reporting - **Tax Declarations**: International B2B, B2C - **Flow Types**: 10.1 (B2B transactions), 10.2 (B2B payments), 10.3 (B2C transactions), 10.4 (B2C payments) ### 📡 AFNOR PDP/PA (XP Z12-013) - **Flow Service**: Submit and search flows to PDPs - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user ### 🏛️ Chorus Pro - **Public Sector Invoicing**: Complete API for Chorus Pro ### ⏳ Async Tasks - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **Webhooks**: Automatic notifications when tasks complete ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: contact@factpulse.fr
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.20.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module FactPulse
|
|
16
|
+
class FacturXPDFXMLVerificationApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get status of an asynchronous verification
|
|
23
|
+
# Retrieves the status and result of an asynchronous verification task. **Possible statuses:** - `PENDING`: Task waiting in queue - `STARTED`: Task currently running - `SUCCESS`: Task completed successfully (see `result`) - `FAILURE`: System error (unhandled exception) **Note:** The `result.status` field can be \"SUCCESS\" or \"ERROR\" independently of Celery status (which will always be SUCCESS if the task ran).
|
|
24
|
+
# @param task_id [String] Celery task ID returned by /verify-async endpoint
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [AsyncTaskStatus]
|
|
27
|
+
def get_verification_status_api_v1_verification_verify_async_task_id_status_get(task_id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_verification_status_api_v1_verification_verify_async_task_id_status_get_with_http_info(task_id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get status of an asynchronous verification
|
|
33
|
+
# Retrieves the status and result of an asynchronous verification task. **Possible statuses:** - `PENDING`: Task waiting in queue - `STARTED`: Task currently running - `SUCCESS`: Task completed successfully (see `result`) - `FAILURE`: System error (unhandled exception) **Note:** The `result.status` field can be \"SUCCESS\" or \"ERROR\" independently of Celery status (which will always be SUCCESS if the task ran).
|
|
34
|
+
# @param task_id [String] Celery task ID returned by /verify-async endpoint
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(AsyncTaskStatus, Integer, Hash)>] AsyncTaskStatus data, response status code and response headers
|
|
37
|
+
def get_verification_status_api_v1_verification_verify_async_task_id_status_get_with_http_info(task_id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: FacturXPDFXMLVerificationApi.get_verification_status_api_v1_verification_verify_async_task_id_status_get ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'task_id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && task_id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'task_id' when calling FacturXPDFXMLVerificationApi.get_verification_status_api_v1_verification_verify_async_task_id_status_get"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/api/v1/verification/verify-async/{task_id}/status'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s))
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'AsyncTaskStatus'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'HTTPBearer']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"FacturXPDFXMLVerificationApi.get_verification_status_api_v1_verification_verify_async_task_id_status_get",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: FacturXPDFXMLVerificationApi#get_verification_status_api_v1_verification_verify_async_task_id_status_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Verify PDF/XML Factur-X compliance (asynchronous)
|
|
86
|
+
# Verifies PDF/XML Factur-X compliance asynchronously. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. **Returns immediately** a task ID. Use `/verify-async/{task_id}/status` to retrieve the result. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency **Advantages over synchronous version:** - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when verification completes: ``` callback_url=https://your-server.com/webhook ``` The webhook will POST a JSON payload with: - `event_type`: `verification.completed` or `verification.failed` - `data.is_compliant`: Whether the PDF/XML are consistent - `data.compliance_score`: Compliance score (0-1) - `X-Webhook-Signature` header for HMAC verification
|
|
87
|
+
# @param pdf_file [File] Factur-X PDF file to verify
|
|
88
|
+
# @param [Hash] opts the optional parameters
|
|
89
|
+
# @option opts [Boolean] :force_ocr Force OCR usage even if PDF contains native text (default to false)
|
|
90
|
+
# @option opts [String] :callback_url
|
|
91
|
+
# @option opts [String] :webhook_mode Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')
|
|
92
|
+
# @return [TaskResponse]
|
|
93
|
+
def verify_pdf_async_api_v1_verification_verify_async_post(pdf_file, opts = {})
|
|
94
|
+
data, _status_code, _headers = verify_pdf_async_api_v1_verification_verify_async_post_with_http_info(pdf_file, opts)
|
|
95
|
+
data
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Verify PDF/XML Factur-X compliance (asynchronous)
|
|
99
|
+
# Verifies PDF/XML Factur-X compliance asynchronously. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. **Returns immediately** a task ID. Use `/verify-async/{task_id}/status` to retrieve the result. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency **Advantages over synchronous version:** - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when verification completes: ``` callback_url=https://your-server.com/webhook ``` The webhook will POST a JSON payload with: - `event_type`: `verification.completed` or `verification.failed` - `data.is_compliant`: Whether the PDF/XML are consistent - `data.compliance_score`: Compliance score (0-1) - `X-Webhook-Signature` header for HMAC verification
|
|
100
|
+
# @param pdf_file [File] Factur-X PDF file to verify
|
|
101
|
+
# @param [Hash] opts the optional parameters
|
|
102
|
+
# @option opts [Boolean] :force_ocr Force OCR usage even if PDF contains native text (default to false)
|
|
103
|
+
# @option opts [String] :callback_url
|
|
104
|
+
# @option opts [String] :webhook_mode Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')
|
|
105
|
+
# @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
|
|
106
|
+
def verify_pdf_async_api_v1_verification_verify_async_post_with_http_info(pdf_file, opts = {})
|
|
107
|
+
if @api_client.config.debugging
|
|
108
|
+
@api_client.config.logger.debug 'Calling API: FacturXPDFXMLVerificationApi.verify_pdf_async_api_v1_verification_verify_async_post ...'
|
|
109
|
+
end
|
|
110
|
+
# verify the required parameter 'pdf_file' is set
|
|
111
|
+
if @api_client.config.client_side_validation && pdf_file.nil?
|
|
112
|
+
fail ArgumentError, "Missing the required parameter 'pdf_file' when calling FacturXPDFXMLVerificationApi.verify_pdf_async_api_v1_verification_verify_async_post"
|
|
113
|
+
end
|
|
114
|
+
# resource path
|
|
115
|
+
local_var_path = '/api/v1/verification/verify-async'
|
|
116
|
+
|
|
117
|
+
# query parameters
|
|
118
|
+
query_params = opts[:query_params] || {}
|
|
119
|
+
|
|
120
|
+
# header parameters
|
|
121
|
+
header_params = opts[:header_params] || {}
|
|
122
|
+
# HTTP header 'Accept' (if needed)
|
|
123
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
124
|
+
# HTTP header 'Content-Type'
|
|
125
|
+
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
126
|
+
if !content_type.nil?
|
|
127
|
+
header_params['Content-Type'] = content_type
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# form parameters
|
|
131
|
+
form_params = opts[:form_params] || {}
|
|
132
|
+
form_params['pdf_file'] = pdf_file
|
|
133
|
+
form_params['force_ocr'] = opts[:'force_ocr'] if !opts[:'force_ocr'].nil?
|
|
134
|
+
form_params['callback_url'] = opts[:'callback_url'] if !opts[:'callback_url'].nil?
|
|
135
|
+
form_params['webhook_mode'] = opts[:'webhook_mode'] if !opts[:'webhook_mode'].nil?
|
|
136
|
+
|
|
137
|
+
# http body (model)
|
|
138
|
+
post_body = opts[:debug_body]
|
|
139
|
+
|
|
140
|
+
# return_type
|
|
141
|
+
return_type = opts[:debug_return_type] || 'TaskResponse'
|
|
142
|
+
|
|
143
|
+
# auth_names
|
|
144
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'HTTPBearer']
|
|
145
|
+
|
|
146
|
+
new_options = opts.merge(
|
|
147
|
+
:operation => :"FacturXPDFXMLVerificationApi.verify_pdf_async_api_v1_verification_verify_async_post",
|
|
148
|
+
:header_params => header_params,
|
|
149
|
+
:query_params => query_params,
|
|
150
|
+
:form_params => form_params,
|
|
151
|
+
:body => post_body,
|
|
152
|
+
:auth_names => auth_names,
|
|
153
|
+
:return_type => return_type
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
157
|
+
if @api_client.config.debugging
|
|
158
|
+
@api_client.config.logger.debug "API called: FacturXPDFXMLVerificationApi#verify_pdf_async_api_v1_verification_verify_async_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
159
|
+
end
|
|
160
|
+
return data, status_code, headers
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Verify PDF/XML Factur-X compliance (synchronous)
|
|
164
|
+
# Verifies compliance between the PDF and its embedded Factur-X XML. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency
|
|
165
|
+
# @param pdf_file [File] Factur-X PDF file to verify
|
|
166
|
+
# @param [Hash] opts the optional parameters
|
|
167
|
+
# @return [VerificationSuccessResponse]
|
|
168
|
+
def verify_pdf_sync_api_v1_verification_verify_post(pdf_file, opts = {})
|
|
169
|
+
data, _status_code, _headers = verify_pdf_sync_api_v1_verification_verify_post_with_http_info(pdf_file, opts)
|
|
170
|
+
data
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Verify PDF/XML Factur-X compliance (synchronous)
|
|
174
|
+
# Verifies compliance between the PDF and its embedded Factur-X XML. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency
|
|
175
|
+
# @param pdf_file [File] Factur-X PDF file to verify
|
|
176
|
+
# @param [Hash] opts the optional parameters
|
|
177
|
+
# @return [Array<(VerificationSuccessResponse, Integer, Hash)>] VerificationSuccessResponse data, response status code and response headers
|
|
178
|
+
def verify_pdf_sync_api_v1_verification_verify_post_with_http_info(pdf_file, opts = {})
|
|
179
|
+
if @api_client.config.debugging
|
|
180
|
+
@api_client.config.logger.debug 'Calling API: FacturXPDFXMLVerificationApi.verify_pdf_sync_api_v1_verification_verify_post ...'
|
|
181
|
+
end
|
|
182
|
+
# verify the required parameter 'pdf_file' is set
|
|
183
|
+
if @api_client.config.client_side_validation && pdf_file.nil?
|
|
184
|
+
fail ArgumentError, "Missing the required parameter 'pdf_file' when calling FacturXPDFXMLVerificationApi.verify_pdf_sync_api_v1_verification_verify_post"
|
|
185
|
+
end
|
|
186
|
+
# resource path
|
|
187
|
+
local_var_path = '/api/v1/verification/verify'
|
|
188
|
+
|
|
189
|
+
# query parameters
|
|
190
|
+
query_params = opts[:query_params] || {}
|
|
191
|
+
|
|
192
|
+
# header parameters
|
|
193
|
+
header_params = opts[:header_params] || {}
|
|
194
|
+
# HTTP header 'Accept' (if needed)
|
|
195
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
196
|
+
# HTTP header 'Content-Type'
|
|
197
|
+
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
198
|
+
if !content_type.nil?
|
|
199
|
+
header_params['Content-Type'] = content_type
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# form parameters
|
|
203
|
+
form_params = opts[:form_params] || {}
|
|
204
|
+
form_params['pdf_file'] = pdf_file
|
|
205
|
+
|
|
206
|
+
# http body (model)
|
|
207
|
+
post_body = opts[:debug_body]
|
|
208
|
+
|
|
209
|
+
# return_type
|
|
210
|
+
return_type = opts[:debug_return_type] || 'VerificationSuccessResponse'
|
|
211
|
+
|
|
212
|
+
# auth_names
|
|
213
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'HTTPBearer']
|
|
214
|
+
|
|
215
|
+
new_options = opts.merge(
|
|
216
|
+
:operation => :"FacturXPDFXMLVerificationApi.verify_pdf_sync_api_v1_verification_verify_post",
|
|
217
|
+
:header_params => header_params,
|
|
218
|
+
:query_params => query_params,
|
|
219
|
+
:form_params => form_params,
|
|
220
|
+
:body => post_body,
|
|
221
|
+
:auth_names => auth_names,
|
|
222
|
+
:return_type => return_type
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
226
|
+
if @api_client.config.debugging
|
|
227
|
+
@api_client.config.logger.debug "API called: FacturXPDFXMLVerificationApi#verify_pdf_sync_api_v1_verification_verify_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
228
|
+
end
|
|
229
|
+
return data, status_code, headers
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
end
|