Skip to content

REST API Reference

Pull invoice data from TaprNext via REST API for integration with your systems.

Generate an API key by navigating to Settings > API Keys, clicking Generate Key, and securely storing the credentials. Include authentication in requests using:

Authorization: token api_key:api_secret

For OAuth applications, register your app in Settings > OAuth Apps, implement the OAuth 2.0 flow, and use the access token in requests.

https://your-site.tapr.ch/api/
GET /api/resource/Purchase Invoice

Supported query parameters include filters for JSON conditions, fields to specify returned data, limit_page_length for results per page, limit_start for pagination offset, and order_by for sorting.

Example request retrieves invoices filtered by approval status with specified fields like vendor and total amount.

GET /api/resource/Purchase Invoice/{name}

Returns full invoice information including items, taxes, and metadata.

PUT /api/resource/Purchase Invoice/{name}

Update status after posting to your ERP system with fields like erp_reference, erp_posting_date, and erp_posting_status.

  • GET /api/resource/Vendor - Retrieve vendor information
  • GET /api/resource/Purchase Order - Access purchase orders with optional status filtering

Filters use the format: [["field", "operator", "value"]]

Operators include: = (equals), != (not equals), >, < (comparison), >=, <= (inclusive comparison), like (contains with % wildcard), in (list membership), and between (range).

  • Approved invoices exceeding €1000: [["status","=","Approved"],["grand_total",">",1000]]
  • Invoices from specific vendor: [["vendor","=","Acme Corp"]]
  • Date range filtering: [["posting_date",">=","2024-01-01"],["posting_date","<=","2024-01-31"]]

For large result sets, use limit_page_length=20&limit_start=0 for the first page, incrementing limit_start by 20 for subsequent pages.

  • Requests per minute: 100
  • Burst (per second): 20
  • Response timeout: 30 seconds

Response headers include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.

import requests
API_BASE = "https://your-site.tapr.ch/api"
API_KEY = "api_key:api_secret"
def get_approved_invoices():
response = requests.get(
f"{API_BASE}/resource/Purchase Invoice",
headers={"Authorization": f"token {API_KEY}"},
params={
"filters": '[["status","=","Approved"]]',
"fields": '["name","vendor","grand_total","items"]'
}
)
return response.json()["data"]
def mark_as_posted(invoice_name, erp_reference):
response = requests.put(
f"{API_BASE}/resource/Purchase Invoice/{invoice_name}",
headers={"Authorization": f"token {API_KEY}"},
json={
"erp_reference": erp_reference,
"erp_posting_status": "Posted"
}
)
return response.status_code == 200
const axios = require('axios');
const API_BASE = 'https://your-site.tapr.ch/api';
const API_KEY = 'api_key:api_secret';
async function getApprovedInvoices() {
const response = await axios.get(
`${API_BASE}/resource/Purchase Invoice`,
{
headers: { Authorization: `token ${API_KEY}` },
params: {
filters: JSON.stringify([['status', '=', 'Approved']]),
fields: JSON.stringify(['name', 'vendor', 'grand_total'])
}
}
);
return response.data.data;
}
  1. Poll efficiently to avoid unnecessary requests
  2. Use filters to retrieve only required data
  3. Implement pagination for large datasets
  4. Apply exponential backoff for retry logic
  5. Update invoice status after successful ERP posting