# `UblEx.Generator.SBDH`
[🔗](https://github.com/Octarion/ubl_ex/blob/v0.8.1/lib/ubl_ex/generator/sbdh.ex#L1)

Generate Standard Business Document Header (SBDH) wrappers for UBL documents.

SBDH is used in Peppol networks for routing and identification of business documents.

# `strip`

```elixir
@spec strip(String.t()) :: String.t()
```

Strip the StandardBusinessDocument/StandardBusinessDocumentHeader wrapper from UBL XML.

Some accounting software cannot process documents with SBDH wrappers. This function
extracts the inner UBL document (Invoice, CreditNote, or ApplicationResponse).

If the XML is not wrapped in an SBDH, it is returned unchanged.

## Example

    sbdh_xml = UblEx.generate_with_sbdh(document_data)
    plain_xml = UblEx.Generator.SBDH.strip(sbdh_xml)

# `wrap`

```elixir
@spec wrap(String.t(), map()) :: String.t()
```

Wrap UBL XML content with an SBDH header.

## Parameters

  * `ubl_xml` - The UBL XML content to wrap (as string)
  * `document_data` - Map containing:
    - `:type` - Document type (`:invoice`, `:credit`, `:application_response`)
    - `:number` or `:id` - Document identifier
    - `:date` - Document date
    - `:supplier` or `:sender` - Map with `:endpoint_id` and `:scheme`
    - `:customer` or `:receiver` - Map with `:endpoint_id` and `:scheme`
    - `:country` - Optional country code (defaults from supplier/sender)

## Example

    ubl_xml = UblEx.generate(document_data)
    sbdh_xml = UblEx.Generator.SBDH.wrap(ubl_xml, document_data)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
