Salta al contingut
Log in

Camps JSON de factura a XML UBL (EN 16931 / Peppol BIS 3.0)

Aquesta guia detalla el mapeig entre els camps de la B2Brouter Invoice API, els corresponents Business Terms (BT) definits per l’estàndard europeu de facturació electrònica (EN 16931) i les rutes XML del model UBL 2.1 (incloent-hi Peppol BIS Billing 3.0).

BTBusiness TermCamp API (B2Brouter)XPath UBL
BT-1Número de facturainvoice.numbercbc:ID
BT-2Data d’emissióinvoice.datecbc:IssueDate
BT-3Codi de tipus de facturainvoice.type_codecbc:InvoiceTypeCode (o cbc:CreditNoteTypeCode)
BT-5Moneda del documentinvoice.currencycbc:DocumentCurrencyCode
BT-6Codi de moneda fiscalinvoice.contact.currencycbc:TaxCurrencyCode
BT-7Data del punt d’impostinvoice.tax_point_datecbc:TaxPointDate
BT-9Data de vencimentinvoice.due_datecbc:DueDate
BT-10Referència del compradorinvoice.buyer_referencecbc:BuyerReference
BT-19Centre de cost comptableinvoice.buyer_accounting_referencecbc:AccountingCost
BT-22Nota (capçalera)invoice.extra_infocbc:Note

Notes:

  • BT-6 només s’emet quan la moneda del contacte comprador és diferent de la moneda de la factura i existeixen imports fiscals en aquella moneda. Quan s’estableix, es renderitza un segon bloc cac:TaxTotal.
BTBusiness TermCamp API (B2Brouter)XPath UBL
BT-13Referència de comanda de comprainvoice.ponumbercac:OrderReference/cbc:ID
BT-14Referència de comanda de vendainvoice.sales_order_referencecac:OrderReference/cbc:SalesOrderID
BT-12Referència de contracteinvoice.contract_numbercac:ContractDocumentReference/cbc:ID
BT-15Referència d’albarà de recepcióinvoice.receiving_advice_referencecac:ReceiptDocumentReference/cbc:ID
BT-16Referència d’albarà d’expedicióinvoice.delivery_note_numbercac:DespatchDocumentReference/cbc:ID
BT-25Referència de factura precedentinvoice.amended_numbercac:BillingReference/cac:InvoiceDocumentReference/cbc:ID
BT-26Data de la factura precedentinvoice.amended_datecac:BillingReference/cac:InvoiceDocumentReference/cbc:IssueDate
BT-73Inici del període de facturacióinvoice.invoicing_period_startcac:InvoicePeriod/cbc:StartDate
BT-74Fi del període de facturacióinvoice.invoicing_period_endcac:InvoicePeriod/cbc:EndDate
BT-11Referència de projecteinvoice.file_referencecac:ProjectReference/cbc:ID
Referència de document originadorinvoice.lot_referencecac:OriginatorDocumentReference/cbc:ID

Notes:

  • Per a notes de crèdit, file_reference s’emet com a cac:AdditionalDocumentReference/cbc:ID en lloc de cac:ProjectReference/cbc:ID.

Aquest mapeig està descrit per a una factura emesa; si vols mapar una factura rebuda, intercanvia AccountingSupplierParty i AccountingCustomerParty.

Self-billing (IssuedSelfInvoice / ReceivedSelfInvoice): en self-billing, el comprador emet la factura en nom del proveïdor, de manera que els rols de les parts a l’XML s’inverteixen respecte dels camps de l’API.

BTBusiness TermCamp API (B2Brouter)XPath UBL
BT-34Endpoint ID del venedoraccount.pin_valuecac:AccountingSupplierParty/cac:Party/cbc:EndpointID @schemeID
BT-27Nom legal del venedoraccount.namecac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName
BT-31Identificador IVA del venedoraccount.tin_valuecac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID
BT-35Carrer del venedoraccount.addresscac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:StreetName
BT-36Carrer 2 del venedoraccount.address2cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:AdditionalStreetName
BT-37Ciutat del venedoraccount.citycac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CityName
BT-38Codi postal del venedoraccount.postalcodecac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:PostalZone
BT-39Província del venedoraccount.provincecac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity
BT-40País del venedoraccount.countrycac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode
BT-41Nom de contacte del venedoraccount.contact_personcac:AccountingSupplierParty/cac:Party/cac:Contact/cbc:Name
BT-42Telèfon del venedoraccount.phonecac:AccountingSupplierParty/cac:Party/cac:Contact/cbc:Telephone
BT-43Correu del venedoraccount.emailcac:AccountingSupplierParty/cac:Party/cac:Contact/cbc:ElectronicMail
BTBusiness TermCamp API (B2Brouter)XPath UBL
BT-49Endpoint ID del compradorinvoice.contact.pin_valuecac:AccountingCustomerParty/cac:Party/cbc:EndpointID @schemeID
BT-44Nom legal del compradorinvoice.contact.namecac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName
BT-45Nom comercial del compradorinvoice.contact.namecac:AccountingCustomerParty/cac:Party/cac:PartyName/cbc:Name
BT-48Identificador IVA del compradorinvoice.contact.tin_valuecac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID
BT-50Carrer del compradorinvoice.contact.addresscac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName
BT-51Carrer 2 del compradorinvoice.contact.address2cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:AdditionalStreetName
BT-52Ciutat del compradorinvoice.contact.citycac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName
BT-53Codi postal del compradorinvoice.contact.postalcodecac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:PostalZone
BT-54Província del compradorinvoice.contact.provincecac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity
BT-55País del compradorinvoice.contact.countrycac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode
BT-56Nom de contacte del compradorinvoice.contact.contact_personcac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Name
BT-57Telèfon del compradorinvoice.contact.phonecac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Telephone
BT-58Correu del compradorinvoice.contact.emailcac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail
BTBusiness TermCamp API (B2Brouter)XPath UBL
BT-72Data de lliuramentinvoice.delivery_datecac:Delivery/cbc:ActualDeliveryDate
BT-71ID de la ubicació de lliuramentinvoice.delivery_location_idcac:Delivery/cac:DeliveryLocation/cbc:ID
BT-75Carrer de lliuramentinvoice.delivery_addresscac:Delivery/cac:DeliveryLocation/cac:Address/cbc:StreetName
BT-76Carrer 2 de lliuramentinvoice.delivery_address2cac:Delivery/cac:DeliveryLocation/cac:Address/cbc:AdditionalStreetName
BT-77Ciutat de lliuramentinvoice.delivery_citycac:Delivery/cac:DeliveryLocation/cac:Address/cbc:CityName
BT-78Codi postal de lliuramentinvoice.delivery_postalcodecac:Delivery/cac:DeliveryLocation/cac:Address/cbc:PostalZone
BT-79Província de lliuramentinvoice.delivery_provincecac:Delivery/cac:DeliveryLocation/cac:Address/cbc:CountrySubentity
BT-80País de lliuramentinvoice.delivery_countrycac:Delivery/cac:DeliveryLocation/cac:Address/cac:Country/cbc:IdentificationCode
BT-70Nom de la part de lliuramentinvoice.delivery_party_namecac:Delivery/cac:DeliveryParty/cac:PartyName/cbc:Name
BTBusiness TermCamp API (B2Brouter)XPath UBL
BT-81Codi de mitjà de pagamentinvoice.payment_methodcac:PaymentMeans/cbc:PaymentMeansCode @listID='UNCL4461'
BT-82Text del mitjà de pagamentinvoice.payment_method_textcac:PaymentMeans/cbc:PaymentMeansCode @name
BT-83Informació de remesainvoice.remittance_informationcac:PaymentMeans/cbc:PaymentID
BT-84IBAN del compte del beneficiariinvoice.bank_account.ibancac:PaymentMeans/cac:PayeeFinancialAccount/cbc:ID
BT-84-0Número de compte del beneficiariinvoice.bank_account.numbercac:PaymentMeans/cac:PayeeFinancialAccount/cbc:ID
BT-85Nom del compte del beneficiariinvoice.bank_account.namecac:PaymentMeans/cac:PayeeFinancialAccount/cbc:Name
BT-86BIC del compte del beneficiariinvoice.bank_account.biccac:PaymentMeans/cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID
BT-87Número de compte de targetainvoice.card_account_attributes.account_numbercac:PaymentMeans/cac:CardAccount/cbc:PrimaryAccountNumberID
BT-87-0Nom del titular de la targetainvoice.card_account_attributes.holder_namecac:PaymentMeans/cac:CardAccount/cbc:HolderName
BT-88Xarxa de la targetainvoice.card_account_attributes.networkcac:PaymentMeans/cac:CardAccount/cbc:NetworkID
BT-20Termes de pagamentinvoice.payment_termscac:PaymentTerms/cbc:Note
BT-89Referència de mandatinvoice.mandate_reference_identifiercac:PaymentMeans/cac:PaymentMandate/cbc:ID
BT-90Referència del creditorinvoice.bank_assigned_creditor_referencecac:AccountingSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID @schemeID='SEPA'
BT-91IBAN del compte del deutorinvoice.contact_ibancac:PaymentMeans/cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID
BTBusiness TermCamp API (B2Brouter)XPath UBL
BT-106Total net de línies(calculat)cac:LegalMonetaryTotal/cbc:LineExtensionAmount
BT-109Import exempt d’impostos(calculat)cac:LegalMonetaryTotal/cbc:TaxExclusiveAmount
BT-107Total de descomptes(calculat)cac:LegalMonetaryTotal/cbc:AllowanceTotalAmount
BT-108Total de recàrrecs(calculat)cac:LegalMonetaryTotal/cbc:ChargeTotalAmount
BT-112Import amb impostos inclosos(calculat)cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount
BT-113Import total prepagatinvoice.payments_on_accountcac:LegalMonetaryTotal/cbc:PrepaidAmount
BT-114Import d’arrodoniment(des d’ajust de factura)cac:LegalMonetaryTotal/cbc:PayableRoundingAmount
BT-115Import pendent de pagamentinvoice.payable_amountcac:LegalMonetaryTotal/cbc:PayableAmount
BT-110Total IVA de la factura(calculat)cac:TaxTotal/cbc:TaxAmount
BT-116Base imposable per categoria IVA(calculat des de línies)cac:TaxTotal/cac:TaxSubtotal/cbc:TaxableAmount
BT-117Import d’impost per categoria IVA(calculat des de línies)cac:TaxTotal/cac:TaxSubtotal/cbc:TaxAmount
Import retingutinvoice.withheld_percentcac:AllowanceCharge/cbc:Amount
Motiu de retencióinvoice.amounts_withheld_reasoncac:AllowanceCharge/cbc:AllowanceChargeReason
BTBusiness TermCamp API (B2Brouter)XPath UBL
BT-92Import del descompteallowance_charges_attributes[]{allowance_charge_indicator: "allowance", amount: X}cac:AllowanceCharge[cbc:ChargeIndicator=false]/cbc:Amount
BT-93Base del descompte(calculada quan hi ha percentatge)cac:AllowanceCharge[cbc:ChargeIndicator=false]/cbc:BaseAmount
BT-94Percentatge del descompteallowance_charges_attributes[]{allowance_charge_indicator: "allowance", percentage: X}cac:AllowanceCharge[cbc:ChargeIndicator=false]/cbc:MultiplierFactorNumeric
BT-97Motiu del descompteallowance_charges_attributes[]{allowance_charge_indicator: "allowance", description: "..."}cac:AllowanceCharge[cbc:ChargeIndicator=false]/cbc:AllowanceChargeReason
BT-99Import del recàrrecallowance_charges_attributes[]{allowance_charge_indicator: "charge", amount: X}cac:AllowanceCharge[cbc:ChargeIndicator=true]/cbc:Amount
BT-100Base del recàrrec(calculada quan hi ha percentatge)cac:AllowanceCharge[cbc:ChargeIndicator=true]/cbc:BaseAmount
BT-101Percentatge del recàrrecallowance_charges_attributes[]{allowance_charge_indicator: "charge", percentage: X}cac:AllowanceCharge[cbc:ChargeIndicator=true]/cbc:MultiplierFactorNumeric
BT-104Motiu del recàrrecallowance_charges_attributes[]{allowance_charge_indicator: "charge", description: "..."}cac:AllowanceCharge[cbc:ChargeIndicator=true]/cbc:AllowanceChargeReason
BT-102Aplicar impost al descompte/recàrrecallowance_charges_attributes[]{apply_taxes: true}cac:AllowanceCharge/cac:TaxCategory

Tots els atributs següents són propietats dels objectes de invoice.invoice_lines_attributes[].

BTBusiness TermCamp API (línia)XPath UBL
BT-126ID de línia de facturapositioncac:InvoiceLine/cbc:ID
BT-129Quantitat facturadaquantitycac:InvoiceLine/cbc:InvoicedQuantity
BT-130Quantitat facturada (unitat)unitcac:InvoiceLine/cbc:InvoicedQuantity @unitCode
BT-131Import total de líniaextension_amountcac:InvoiceLine/cbc:LineExtensionAmount
BT-146Import del preupricecac:InvoiceLine/cac:Price/cbc:PriceAmount
BT-153Nom de l’articledescriptioncac:InvoiceLine/cac:Item/cbc:Name
BT-154Descripció de l’articlenotescac:InvoiceLine/cac:Item/cbc:Description
BT-155ID de l’article del venedorarticle_codecac:InvoiceLine/cac:Item/cac:SellersItemIdentification/cbc:ID
BT-156ID de l’article del compradorarticle_code_buyercac:InvoiceLine/cac:Item/cac:BuyersItemIdentification/cbc:ID
BT-157ID estàndard de l’articlearticle_code2cac:InvoiceLine/cac:Item/cac:StandardItemIdentification/cbc:ID @schemeID
BT-157-1Esquema de l’ID estàndardarticle_code2_schemecac:InvoiceLine/cac:Item/cac:StandardItemIdentification/cbc:ID @schemeID
BT-158Codi de classificacióclassification_codecac:InvoiceLine/cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode @listID
BT-158-1Esquema del codi de classificacióclassification_code_schemecac:InvoiceLine/cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode @listID
BT-151Categoria IVA per líniataxes_attributes[].categorycac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID
BT-152Percentatge IVA per líniataxes_attributes[].percentcac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent
BT-120Motiu d’exempció fiscaltaxes_attributes[].commentcac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:TaxExemptionReason
BT-160Nom de propietat addicionaladditional_item_properties_attributes[].namecac:InvoiceLine/cac:Item/cac:AdditionalItemProperty/cbc:Name
BT-161Valor de propietat addicionaladditional_item_properties_attributes[].valuecac:InvoiceLine/cac:Item/cac:AdditionalItemProperty/cbc:Value
BT-133Referència comptable del compradorcontact_referencecac:InvoiceLine/cbc:AccountingCost
BT-134Inici del període de líniainvoicing_period_startcac:InvoiceLine/cac:InvoicePeriod/cbc:StartDate
BT-135Fi del període de líniainvoicing_period_endcac:InvoiceLine/cac:InvoicePeriod/cbc:EndDate
BT-136Import de descompte de líniaallowance_charges_attributes[]{allowance_charge_indicator: "allowance", amount: X}cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator=false]/cbc:Amount
BT-138Percentatge de descompte de líniaallowance_charges_attributes[]{allowance_charge_indicator: "allowance", percentage: X}cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator=false]/cbc:MultiplierFactorNumeric
BT-139Motiu del descompte de líniaallowance_charges_attributes[]{allowance_charge_indicator: "allowance", description: "..."}cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator=false]/cbc:AllowanceChargeReason
BT-141Import de recàrrec de líniaallowance_charges_attributes[]{allowance_charge_indicator: "charge", amount: X}cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator=true]/cbc:Amount
BT-143Percentatge de recàrrec de líniaallowance_charges_attributes[]{allowance_charge_indicator: "charge", percentage: X}cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator=true]/cbc:MultiplierFactorNumeric
BT-144Motiu del recàrrec de líniaallowance_charges_attributes[]{allowance_charge_indicator: "charge", description: "..."}cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator=true]/cbc:AllowanceChargeReason
BT-128Referència de comanda (línia)invoice_lines_attributes[].ponumbercac:InvoiceLine/cac:DocumentReference/cbc:ID
BT-132Referència de línia de comandainvoice_lines_attributes[].sequence_numbercac:InvoiceLine/cac:OrderLineReference/cbc:LineID