B2B Ecommerce

Invoicing API for B2B Ecommerce

Order confirmed = professional invoice issued automatically

Integrate automatic invoicing into your B2B online store. Every order generates a professional invoice compliant with Spanish regulations, with no manual intervention. Simplify operations and improve the experience for your business customers.

Why does B2B ecommerce need automatic invoicing?

When you sell to businesses, a professional invoice isn't optional. It's a legal and operational requirement that defines the buying experience.

Immediate legal obligation

In B2B sales, your customers need the invoice to record the purchase in their accounting. Without a regulation-compliant invoice, they can't deduct VAT or justify the expense. It's not an extra — it's part of the product.

Speed of issuance

Your customers expect the invoice when the order is confirmed or shipped. Any delay generates support tickets, emails and frustration. Automation eliminates waiting and reduces customer support load.

VeriFactu and Spanish regulation compliance

Every invoice must include a digital fingerprint, sequential numbering, correct VAT breakdown, and comply with VeriFactu. Doing this manually for each order is error-prone and audit-risky.

Business scalability

If you grow from 10 to 100 daily orders, issuing invoices manually becomes a bottleneck. Automation lets you scale sales without scaling your admin team.

Credit notes and returns management

In B2B, returns and adjustments are frequent. You need to issue credit notes automatically when an order is cancelled or modified. Without automation, it's accounting chaos.

ERP and accounting integration

Your customers and team need to import invoices into ERP systems. The API lets you export structured data (JSON, XML) for direct integrations with management software.

How the integration works with your online store

A direct flow that connects with your ecommerce platform (Shopify, WooCommerce, custom) and your payment gateway.

1

B2B customer places an order

The customer adds products to the cart, completes checkout with their tax details (Tax ID, company name, address) and confirms the purchase.

  • Your store validates the Tax ID automatically if you integrate with the BeeL. API
  • You register client_id in BeeL. if it's a first purchase
  • You store the order ID for idempotency
2

Payment gateway confirms the transaction

Stripe, Redsys or your payment processor confirms the charge was successful. You receive the payment confirmed webhook.

  • The webhook includes payment_id and order_id
  • Your system marks the order as 'paid'
  • You prepare the invoice data (line items, amounts, VAT)
3

Your system calls POST /invoices

Automatically, your backend sends the order data to the BeeL. API to issue the invoice. You include X-Idempotency-Key using the order_id to prevent duplicates.

  • You send client_id, product line items, prices, VAT
  • BeeL. validates the data and issues the regulation-compliant invoice
  • You receive the invoice_id and generated PDF
4

PDF sent to the customer by email

BeeL. automatically sends the invoice PDF to the customer's email. You can customize it with your logo and branding. The customer receives it in seconds.

  • Email with professional A4 format PDF attached
  • Includes your logo, your tax details and the customer's
  • Full compliance with VeriFactu and AEAT
5

Order shipped or ready for pickup

With the invoice issued, you proceed to ship or prepare the order. The customer already has their tax documentation ready for accounting.

  • Your logistics system processes the shipment
  • Customer can download the invoice from their account area (if you integrate the link)
  • Invoices accessible via API GET /invoices for reporting

Key benefits for your B2B ecommerce

Beyond time savings, you improve the business customer experience and reduce compliance risks.

Zero manual intervention

From the moment the customer pays to when they receive their invoice, everything is automatic. Your team doesn't touch a single invoice — they focus on selling and serving.

Guaranteed tax compliance

VeriFactu, VAT, income tax, mandatory sequential numbering... all managed by BeeL. You forget about regulatory updates.

Automatic credit notes

If an order is cancelled or returned, you issue a credit note with one API call. The system automatically links it to the original invoice.

Unlimited scalability

10 orders or 10,000 per day, the operational cost of invoicing stays the same. The API handles volume without degrading performance or requiring more resources.

Frequently asked questions about B2B ecommerce invoicing

Can I issue the invoice before shipping the order?

Yes, in fact it's the most common approach. You issue the invoice when payment is confirmed, regardless of when the order ships. The customer needs the invoice for their accounting, not to receive the physical product.

Does the API automatically validate Tax IDs?

Yes. When creating a customer via POST /clients, BeeL. validates the Spanish NIF/CIF format. This reduces errors in your invoices and ensures tax data is correct before issuing.

What if my store uses WooCommerce or Shopify?

You can integrate the API with any platform. If you use WooCommerce, you create a hook on the woocommerce_payment_complete event. For Shopify, you use orders/paid webhooks. You send the data to the API from your backend or an intermediary service (Zapier, n8n, custom).

How do I handle products with different VAT rates?

When creating products in BeeL. (POST /products), you assign the VAT rate to each one (21%, 10%, 4%, exempt). When you issue the invoice, BeeL. automatically calculates the correct VAT breakdown by rate. If you sell books (4%), food (10%) and electronics (21%) in the same order, the breakdown is automatic.

Can I customize the PDF invoice design?

Yes. From the BeeL. dashboard you can upload your logo, customize colors and text. Invoices generated via API automatically use your custom template. No need to design PDFs manually or manage generation libraries.

Ready to automate your invoicing?

Integrate BeeL.'s API and start invoicing in minutes.