Loading
Uniconta
  • Search
  • Uniconta
    • Functions
      • General ledger
      • Orders & Purchase
      • Inventory & Logistics
      • Project
      • Production
      • Dashboard
      • Business Rules
      • ODATA ikonCustomisation
      • See all →
    • Apps
      • Invoice App Create Invoices
      • Upload App Submit reciepts & expenses
      • Assistant App Project Management
      • Work App Time Tracking
      • Authenticator App Two-Factor Authentication
    • Integrations
      • Add-on Store
    • Download & Login
      • Download Uniconta
      • Web Login
  • Developers
    • Build & Integrate
      • Get API Key
      • Download for Developers
      • Documentation
    • Resources & Code
      • Samples
      • Add-on solutions and users
    • Partner Ecosystem
      • Become an integration partner
      • Partner Portal
  • Insights
    • News
      • Latest News
      • Release Notes
      • Customer Stories
    • Get started
      • Try Uniconta
      • Book a Demo
  • Contact
  • Get Uniconta
  • Contact us
  • Find a reseller
Free trial signup

Developers Unipedia

  • API
    • API
    • User defined fields
    • User defined tables
    • Saving a Session
    • Posting an Invoice
    • Post Invoice and get PDF
    • Localization
    • Attach physical voucher to entities
    • Server-Login User
    • How to find C# Property from Uniconta Label
    • Minimize network traffic and optimize speed
    • Export pictures from Uniconta
    • OIOUBL Document Mapping and Send (NemHandel)
  • Plugins
    • Plugins
    • Debug Uniconta Plugins
    • Refreshing UI with plugins
    • How to use Uniconta Plugin
    • Develop a user plugin
    • Business Rules – User Plugins
    • Event Handling
    • Global Script
    • How to capture menu events
    • How to open a form in Uniconta from Plugin
    • Open new content in a IContentPluginBase plugin
    • Adding plugin in a menu
    • How to add user parameter in plugin menu
    • How to create plugin with Devexpress Library
    • Synchronize Entity Support in form page
    • Develop a PageEventBase Plugin
    • Logging Exceptions on local machine
    • Create Custom Uniconta Pages From Github Code
    • Web frame integration
  • OData
    • CRUD operations in OData
    • ODATA REST API – Testing with Postman

OIOUBL Document Mapping and Send (NemHandel)

September 16th, 2025 September 17th, 2025 2 minutes
Print Friendly, PDF & Email

Uniconta’s API lets you programmatically inject any element values into an OIOUBL invoice/credit note and then send it via NemHandel—beyond the built-in tags available in the Uniconta client.

Namespace & Class

Namespace: Uniconta.API.DebtorCreditor
Class: NHRAPI

Constructors

public NHRAPI(BaseAPI api) // use an existing API object
public NHRAPI(Session session, Company company) // use a session + a company

You can initialise NHRAPI either with another API object or directly with a session and a company.


Generate Validated OIOUBL XML

Task<string> GetValidatedeDeliveryMappingDoc(DebtorInvoiceClient invoice, Dictionary<string,string> xmlPathAndValue)

Generates an OIOUBL document (as XML string) for the given invoice or credit note, inserting your custom values at the specified XML paths. The server validates the document before returning it.

Parameters

  • invoice: A DebtorInvoiceClient for the target document.

  • xmlPathAndValue: Dictionary where key = XML element path, value = element text.

When supplying keys in xmlPathAndValue, use ‘/’-separator for element paths.
Do not include the document root (Invoice or CreditNote) or Namespaces (cac: and cbc:).

So given this XML fragment:

<Invoice>
   <cac:AccountingSupplierParty>
      <cac:Party>
         <cac:PostalAddress>
             <cac:Country>
                 <cbc:IdentificationCode>DK</cbc:IdentificationCode>
             </cac:Country>
         </cac:PostalAddress>
      </cac:Party>
    </cac:AccountingSupplierParty>
</Invoice>
Write xml path like this: "AccountingSupplierParty/Party/PostalAddress/Country/IdentificationCode"


Return

  • string OIOUBL XML.

Error

  • If returned null, call {NHRAPI object}.LastError


Send OIOUBL XML

Task<ErrorCodes> SendOIOUBL(string xml)

Sends a OIOUBL XML document via NemHandel.

Parameters

  • xml: The OIOUBL XML to send (for example, the output from GetValidatedeDeliveryMappingDoc).

Return

  • ErrorCodes indicating the result of the send operation.

Error

  • {return result} != ErrorCodes.Succes


Full Example

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Uniconta.API.DebtorCreditor; // NHRAPI
using Uniconta.API.Service; // Session
using Uniconta.API.System; // CrudAPI 
using Uniconta.ClientTools.DataModel; // DebtorInvoiceClient
using Uniconta.Common; // ErrorCodes
using Uniconta.DataModel; // Company

class Program
{
    static async Task Main(string[] args)
    {
        // 1)  Create session, and get company (not included in example)
        Session session = null; // TODO: implement
        Company company = null; // TODO: implement
        // 2) Create API object
        var api = new NHRAPI(session, company);
        // 3) Define your XML path/value pairs
        var xmlPathAndValue = new Dictionary<string, string>
        {
            ["Note"] = "Thank you for your business",
            ["InvoiceLine/Note"] = "Handle with care",
            ["AccountingSupplierParty/Party/PostalAddress/Country/IdentificationCode"] = "DK",
            ["PaymentTerms/Note"] = "Net 14 days",
            ["OrderReference/ID"] = "PO-2025-0916"
        };
        // 4) Get a invoice ({filter} to be defined by you)
        var invoice = (await new CrudAPI(api).Query<DebtorInvoiceClient>(/*filter}*/)).FirstOrDefault();
        if (invoice == null)
        {
            Console.Error.WriteLine("Invoice not found.");
            return;
        }
        // 5) Generate the OIOUBL XML with your mappings
        string xml = await api.GetValidatedeDeliveryMappingDoc(invoice, xmlPathAndValue);
        // 6) Check if generation failed
        if (xml == null)
        {
            Console.Error.WriteLine($"GetValidatedeDeliveryMappingDoc failed: {api.LastError}");
            return;
        }
        // 7) Send via NemHandel
        ErrorCodes result = await api.SendOIOUBL(xml);
        // 8) Check the result
        if (result == ErrorCodes.Succes)
            Console.WriteLine("OIOUBL document sent successfully via NemHandel.");
        else
            Console.Error.WriteLine($"SendOIOUBL failed with: {result}");
    }
}

 

Categories: API, Developers Unipedia
Home » Developers Unipedia » OIOUBL Document Mapping and Send (NemHandel)

Get in touch with us

Uniconta

  • Uniconta
  • Modules
  • Downloads
  • Free trial signup
  • Subscription Terms
  • Privacy Policy
  • System Status

PARTNER

  • Resellers
  • For Developers
  • Uniconta API key application
  • Uniconta Partner info

Info

  • News
  • Updates
  • Customer cases
  • Video
  • IT Security
  • Backup procedure – global
  • About us

Support

  • Unipedia
  • API information
  • Contacts
© Uniconta  2026

facebook linkedin youtube

  • Visit a Country Site
    • Dansk
    • Uniconta GermanyDeutsch
    • Eesti
    • Uniconta GermanyÍslenska
    • Lietuva
    • Uniconta NetherlandsNederlands
    • Norsk
    • English