Reporting API – Payment Terms
Introduction
The Reporting API is a collection of endpoints that you can use to get data for reporting and billing purposes on the platform. The Payment Terms endpoint specifically allows you to retrieve payment terms information filtered by various parameters such as tenant ID, organization ID, and date ranges. This endpoint provides comprehensive data about payment terms for organizations within the reseller channel structure. Additionally, payment terms data is now integrated into Invoice Consolidations and Invoice Headers APIs to provide enhanced reporting capabilities.
In this article:
- Payment Terms in Reporting API v1
- Payment Terms in UI
- Payment Terms in Invoice Consolidations API
- Payment Terms in Invoice Headers API
Payment Terms in Reporting API v1
The API v1 includes a dedicated endpoint to retrieve payment terms data for organizations. This endpoint provides detailed information about payment terms including organization details, payment term values, and associated metadata.
The endpoint is:
GET /api/v1/reporting/organizations/{requesterId}/payment-terms
Parameters
Below you can find the set of parameters that you can use with the endpoint.
Parameter | Type | Optional? | Description |
---|---|---|---|
tenantId | guid | Yes | When provided, PaymentTerms are filtered where tenantId = tenantId from request and TenantId is Indirect Reseller under RequesterId channel. When not set, PaymentTerms are filtered where tenantId is in list of Indirect Reseller under RequesterId channel. |
organizationId | guid | Yes | When provided, filters from PaymentTerms where OrganizationId = OrganizationId from request. |
includeNonActive | bool | Yes | Include non-active organizations, true/false. Note - by default only active organizations are returned. |
includeHistorical | bool | Yes | Include non-active paymentTerms, true/false. Note - by default only active paymentTerms are returned. |
createdDateFrom | date | Yes | Format: yyyy-MM-dd. When provided, filters from PaymentTerms where CreatedOnUtc = createdDateFrom from request. |
createdDateTill | date | Yes | Format: yyyy-MM-dd. When provided and createdDateFrom is empty, filters from PaymentTerms where CreatedOnUtc <= createdDateTill from" request. |
updatedDateFrom | date | Yes | Format: yyyy-MM-dd. When provided, filters from PaymentTerms where LastUpdatedOnUtc = updatedDateFrom from request. |
updatedDateTill | date | Yes |
Format: yyyy-MM-dd. When provided, filters from PaymentTerms where LastUpdatedOnUtc <= updatedDateTill from request. |
Example request
Below is an example of how to structure your API request:
GET api/v1/reporting/organizations/{requesterId}/payment-terms?sasKey={sasKey}&tenantId={tenantId}&includeHistorical=true
Example response
Below, you can find an example response structure:
The response includes comprehensive organization and payment term information with the following key fields:
- PaymentTermId: Unique identifier for the payment term (or NULL if not found)
- TenantId: Identifier from organization chain
- OrganizationTier: Shows "Indirect" if TenantId = requesterId or ResellerType = 0 (End Customer), else "Direct"
- OrganizationPaymentTermInDays: Payment term value in days from PaymentTerms if found, else from ProfileResellers default
- IsDefaultPaymentTerm: FALSE if payment term found, else TRUE
Documentation Reference
For detailed API documentation and examples, visit:
Reporting API v1: Payment Terms
Developer Portal: Payment Terms
Payment Terms in UI
The described Reporting API endpoint corresponds to the implemented UI feature: Payment Terms.
This integration allows users to access the same payment terms data through both the API and the user interface, ensuring consistency across different access methods.
The API response fields directly map to the corresponding UI display elements as outlined in the following table:
API Field | UI Display |
---|---|
OrganizationStatus | Status |
TenantOrganizationShortName | Organizations |
OrganizationErpId | ERP ID |
OrganizationId | Organization ID |
OrganizationCountryName | Country |
OrganizationTier | Tier |
OrganizationPaymentTermInDays | Payment Terms (Days) |
IsDefaultPaymentTerm | Default Payment Terms |
LastUpdatedOnUtc | Updated On |
LastUpdatedByFullName | Updated By |
Payment Terms in Invoice Consolidations API
The Invoice Consolidations API has been extended to include payment terms information, providing comprehensive data for invoice consolidation reporting and billing purposes.
Endpoint
GET /api/v2/reporting/requesters/{requesterId}/invoice-consolidations
UI Mapping
The API response fields directly correspond to the following UI display elements:
API Field | UI Display |
---|---|
PaymentReceivingWayId | N/A |
PaymentReceivingWay | Invoices → Payment method |
PaymentTermInDays | Invoices → Payment Terms |
Documentation Reference
For detailed API documentation and examples, visit:
Reporting API v2: Invoice Consolidations
Payment Terms in Invoice Headers API
Payment terms information has been integrated into both v1 and v2 Invoice Headers APIs to provide consistent payment data across all invoice-related endpoints.
v1 Invoice Headers API
Endpoints
-
GET /api/v1/reporting/invoices/invoice-headers/{requesterId}
-
GET /api/v1/reporting/invoices/invoice-headers/{requesterId}/preview
Enhanced Response Fields
Both endpoints now include the PaymentTermInDays field sourced from Invoices.PaymentTermValueDays
.
/api/v1/reporting/invoices/invoice-headers/{requesterId}:
/api/v1/reporting/invoices/invoice-headers/{requesterId}/preview:
Documentation References
- Main endpoint: Reporting API v1: Get Invoice Headers
- Preview endpoint: Reporting API v1: Get Invoice Headers/Preview
v2 Invoice Headers API
Endpoints
-
GET /api/v2/reporting/requesters/{requesterId}/invoices/headers
-
GET /api/v2/reporting/requesters/{requesterId}/partners/{partnerId}/invoices/headers
Enhanced Response Fields
Both v2 endpoints include the PaymentTermInDays field sourced from Invoices.PaymentTermValueDays
.
/api/v2/reporting/requesters/{requesterId}/invoices/headers:
/api/v2/reporting/requesters/{requesterId}/partners/{partnerId}/invoices/headers:
UI Mapping
The PaymentTermInDays field corresponds to Payment Terms in the UI.
Documentation References
- Requester endpoint: Reporting API v2: Get Requester Invoice Headers
- Partner endpoint: Reporting API v2: Get Partner Invoice Headers
Limitations
The API returns payment terms data based on the reseller channel structure. Organizations must be within the requester's channel hierarchy to be included in the results. Historical payment terms are only included when the includeHistorical parameter is set to true.
For Invoice Consolidations and Invoice Headers APIs, all new payment terms fields are returned without breaking existing consumers of the API. Data accuracy and consistency are maintained with the database for the given requesterId.
Summary
This article explained how to retrieve payment terms details using the v1 Reporting API and access payment terms information through extended Invoice Consolidations and Invoice Headers APIs. The Payment Terms endpoint provides comprehensive information about organizations and their associated payment terms within the reseller channel structure. The optional parameters allow for precise filtering by tenant, organization, dates, and inclusion of non-active or historical records. The integration of payment terms data across multiple API endpoints ensures consistent access to payment information for reporting and billing purposes.
Related Content
Was this article helpful?
Articles in this section
- Reporting API - overview
- Reporting API - Requesting Access
- Reporting API - Data Model
- Reporting API - How to map your Invoice Data
- Reporting API - Detailed Invoice Line Items
- Reporting API - How to identify Organizations in your Sales Channel
- Reporting API - Currencies within the Invoices
- Reporting API : Preview invoices in status 'New'
- Reporting API - Using updatedDate Filters
- Reporting API - Viewing Vendor Invoice Row JSONs via API
Add comment
Please sign in to leave a comment.