REST API for Partner Invoicing
The REST API provides JSON-based endpoints for managing partners in your IPPN network.
TL;DR - Quick Start
# 1. Add a partner (full body on the Add Partner page)
curl -X POST https://bo.magnifinance.com/api/v1.1/partner \
-H "Content-Type: application/json" \
-H "email: ippn-api@yourcompany.pt" \
-H "token: your-ippn-token" \
-d '{"CompanyTaxId": "599138645", "CompanyLegalName": "Partner Company, Lda.", ...}'
# 2. Get the partner's token, once access is granted (needs your password too)
curl 'https://bo.magnifinance.com/api/v1.1/partner/accessTokens?partnerTaxId=599138645' \
-H "email: ippn-api@yourcompany.pt" \
-H "token: your-ippn-token" \
-H "password: your-ippn-password"
# 3. Use the partner's token to create invoices
curl -X POST https://bo.magnifinance.com/api/v1.1/document \
-H "email: ippn-api@yourcompany.pt" \
-H "token: PARTNER_TOKEN" \
-d '{"IsToClose": true, ...}'
Try it in Postman
Every endpoint on this page is in the IPPN REST Postman collection, with sample bodies filled in and the calls in kick-off order. Import it, set email, token, password and partnerTaxId in its Variables tab and press Send. How to use it.
Or paste this URL in Postman's Import:
https://developer.magnifinance.com/ippn/postman/ippn-rest.json
Base URL
https://bo.magnifinance.com/api/v1.1
Available Endpoints
| Endpoint | Description |
|---|---|
| Add Partner | Register a new partner in your network |
| Get Partner Access Tokens | Obtain tokens to act on behalf of a partner |
| TaxId Validation | Check a partner's tax id before adding it (in the Finance section, Tax Compliance) |
Workflow
- Add a partner using Add Partner with their Tax ID and company name
- Wait for the partnership to be granted - A partner that already uses MagniFinance receives an email and must accept. One that isn't registered yet is created and linked to your account automatically, a few times per business day. The state is visible only in the web interface; until it's granted, Get Partner Access Tokens returns
NoPartnerFoundWithTaxId. - Get their token using Get Partner Access Tokens
- Create documents using the Create Document endpoint with the partner's token
Authentication
Include these headers in every request:
| Header | Description |
|---|---|
email | Your IPPN account API email |
token | Your IPPN subscription token |
When creating documents on behalf of a partner, use the partner's token instead of your own.
Web Interface
You can also manage partners through the MagniFinance web interface: Config -> IPPN -> Partnership Management