Skip to content

Download Purchase

This endpoint allows downloading a specific B2B purchase invoice by its externalReference.

Call

The required data for this operation is the purchase invoice's external reference.

InvoicingClient client = new InvoicingClient();

...
Guid externalReference
Solmicro.DigitalHub.Global.Dtos.PurchaseInvoice result = client.DownloadPurchase(externalReference);
curl -X POST "https://apitest.solmicrosdh.com/v2.0/Invoicing/DownloadPurchase?externalReference=00000000-0000-0000-0000-000000000000" \
--cert /ruta/al/certificado.pfx \
--cert-type P12 \
--pass mypfxpassword \
-H "CompanyId: guid-unico-empresa" \
-H "InstallationId: guid-unico-instalacion"

Result

The result will be a PurchaseInvoice object containing the following information:

  • SeriesNumber: Invoice series and number.
  • DateAndTime: Invoice issue date.
  • Seller: Invoice issuer.
  • Buyer: Invoice recipient.
  • TransactionDate: Transaction date when it differs from the issue date.
  • IsSimplifiedSubstitution: Indicator of whether it is an F3 invoice type.
  • ThirdParty: Details of the third party issuing the invoice.
  • IsIssuedByThirdParties: Indication of whether the invoice is physically issued by a third party—because it is issued by another person on behalf of the taxpayer.
  • IsIssuedByRecipients: Indication of whether the invoice has been issued by the recipient.
  • IsCorrective: Indicates whether it is an R1 to R5 invoice type.
  • CorrectiveKey: Indicator for invoice type R1 to R5.
  • CorrectiveType: Corrective invoice type.
  • Correctives: List of invoices to be replaced or rectified.
  • Description: Description of the invoice subject.
  • TotalTaxBase: Total taxable base.
  • TotalTaxes: Total tax amount (sum of Output Tax and Equivalence Surcharge Tax).
  • Total: Total invoice amount.
  • Retention: Retention amount.
  • Details: Details of invoice items.
  • TaxableBases: Breakdown of tax concepts.
  • Properties: Properties.
  • FeeDiscounts: Fee discounts.
  • Advance: Advance payment amount.
  • Pay: Pay.
  • AdditionalData: Additional data.
  • Withholdings: List of withholdings.
if (result is not null)
{
    result.SeriesNumber
    result.DateAndTime
    ...
}
{
  "SeriesNumber": "string",
  "DateAndTime": "datetime",
  "Seller": {},
  "Buyer": {},
  "TransactionDate": "datetime",
  "IsSimplifiedSubstitution": boolean,
  "ThirdParty": {},
  "IsIssuedByThirdParties": boolean,
  "IsIssuedByRecipients": boolean,
  "IsCorrective": boolean,
  "CorrectiveKey": integer,
  "CorrectiveType": integer,
  "Correctives": [],
  "Description": "string",
  "TotalTaxBase": decimal,
  "TotalTaxes": decimal,
  "Total": decimal,
  "Retention": decimal,
  "Details": [],
  "TaxableBases": [],
  "Properties": [],
  "FeeDiscounts": [],
  "Advance": decimal,
  "Pay": {},
  "AdditionalData": {},
  "Withholdings": []
}