Migration Guide v20250101 - v20251013

Migration Guide

Updating Your Integration

  1. Update Base URL: Change your API base URL from app.b2brouter.net or app-staging.b2brouter.net to api.b2brouter.net or api-staging.b2brouter.net respectively.

  2. Add Version Header: Include X-B2B-API-Version: 2025-10-13 header in all requests, or configure the default version in your group's API Key settings.

  3. Remove Format Extensions: Remove .json or .xml extensions from all endpoint paths. All responses are now JSON by default.

  4. Update Path Segments:

  • Replace /projects/ with /accounts/ in all paths
  • Replace /clients/ with /contacts/ in all paths
  • Remove /users/ prefix from code list endpoints
  • Remove /api/v1/ prefix from directory and tax report endpoints
  1. Update Pagination Handling: Update your code to read pagination data from the meta object instead of root-level properties:
// Old (v2025-01-01)
const totalCount = response.total_count;
const offset = response.offset;
const limit = response.limit;

// New (v2025-10-13)
const totalCount = response.meta.total_count;
const offset = response.meta.offset;
const limit = response.meta.limit;
  1. Update Property Names: Replace all references to client with contact in your request and response handling code:
// Old (v2025-01-01) - Request body
{
  "invoice": {
    "client_id": 123,
    // or
    "client": {
      "name": "Client Name",
      "taxcode": "9920:ESD29766391"
    }
  }
}

// New (v2025-10-13) - Request body
{
  "invoice": {
    "contact_id": 123,
    // or
    "contact": {
      "name": "Contact Name",
      "tin_scheme": "9920",
      "tin_value": "ESD29766391"
    }
  }
}

// Old (v2025-01-01) - Response body
{
  "invoice": {
    "id": 123,
    "client": { ... }
  }
}

// New (v2025-10-13) - Response body
{
  "invoice": {
    "id": 123,
    "contact": { ... }
  }
}
  1. Consolidate Invoice Listings: Replace separate invoice listing endpoints with the consolidated /accounts/{account}/invoices endpoint using the type parameter:
  • For received invoices: GET /accounts/{account}/invoices?type=ReceivedInvoice
  • For self-invoices: GET /accounts/{account}/invoices?type=IssuedSelfInvoice
  • For simplified invoices: GET /accounts/{account}/invoices?type=IssuedSimplifiedInvoice
  1. Update Tax Reports: Replace old deprecated tax report endpoints with the new consolidated endpoints under /accounts/{account}/tax_reports and /tax_reports/{id}. Check on New Tax Reports API for more details.

  2. Handle Full Responses: Update your code to handle full resource representations returned by PUT, DELETE, and POST operations instead of empty 204 responses.

  3. Remove XML Support: If your integration relied on XML responses, convert your code to handle JSON responses only.

  4. Update Deprecated Invoice Attributes: Replace deprecated invoice attributes with their standardized alternatives:

// Old (v2025-01-01) - Invoice attributes
{
  "invoice": {
    "contact_person": "John Doe",
    "state": "accepted",
    "customer_party_identification": "12345",
    "accounting_cost": "DEPT-001",
    "iban": "ES6000000000000000000000",
    "bic": "ABCDESMMXXX",
    "num_contracte": "CONTRACT-2024",
    "organ_gestor": "ORG-001",
    "oficina_comptable": "OFF-001"
  }
}

// New (v2025-10-13) - Use standardized attributes
{
  "invoice": {
    "customer_contact_person": "John Doe",
    // state removed - use POST /invoices/{id}/mark_as instead
    "contact": {
      "party_identification": "12345"
    },
    "buyer_accounting_reference": "DEPT-001",
    "bank_account": {
      "iban": "ES6000000000000000000000",
      "bic": "ABCDESMMXXX"
    },
    "contract_number": "CONTRACT-2024",
    "managing_unit": "ORG-001",
    "accounting_unit": "OFF-001"
  }
}
  1. Update Contact/Client Attributes: Replace deprecated contact attributes with their standardized alternatives:
// Old (v2025-01-01) - Contact attributes
{
  "contact": {
    "old_channel": "peppol",
    "taxcode": "9920:ESD29766391",
    "contact": "John Doe",
    "bank_account": "ES6000000000000000000000",
    "company_identifier": "A12345678",
    "transport_type": "peppol",
    "document_type": "xml.ubl.invoice.bis3",
    "posta_elettronica_certificata": "[email protected]",
    "codice_destinatario": "ABC1234"
  }
}

// New (v2025-10-13) - Use standardized attributes
{
  "contact": {
    "transport_type_code": "peppol",
    "tin_scheme": "9920",
    "tin_value": "ESD29766391",
    "contact_person": "John Doe",
    "bank_account_number": "ES6000000000000000000000",
    "cin_value": "A12345678",
    "transport_type_code": "peppol",
    "document_type_code": "xml.ubl.invoice.bis3",
    "certified_email": "[email protected]",
    "recipient_code": "ABC1234"
  }
}
  1. Update Invoice State Changes: Replace direct state attribute updates with the mark_as endpoint:
// Old (v2025-01-01) - Direct state update
PUT /invoices/{id}.json
{
  "invoice": {
    "state": "accepted"
  }
}

// New (v2025-10-13) - Use mark_as endpoint
POST /invoices/{id}/mark_as
{
  "state": "accepted"
}

Testing Your Migration

We recommend thoroughly testing your integration in the staging environment (api-staging.b2brouter.net) before deploying to production. The X-B2B-API-Version header allows you to test the new version without affecting your current integration.