Trendsic Platform Service

<back to all web services

RunBillingSystemRequest

The following routes are available for this service:
POST/v1/billing/run/system
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RunBillingSystemTenantResult:
    tenant_id: Optional[str] = None
    billing_run_i_d: int = 0
    started: bool = False
    message: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RunBillingSystemResponse:
    response_status: Optional[ResponseStatus] = None
    tenants_swept: int = 0
    runs_started: int = 0
    reclaimed: int = 0
    results: List[RunBillingSystemTenantResult] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RunBillingSystemRequest:
    run_type: Optional[str] = None
    period_key: Optional[str] = None
    tenant_id: Optional[str] = None
    reclaim_stale_minutes: int = 0

Python RunBillingSystemRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/billing/run/system HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	RunType: String,
	PeriodKey: String,
	TenantId: 00000000000000000000000000000000,
	ReclaimStaleMinutes: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	TenantsSwept: 0,
	RunsStarted: 0,
	Reclaimed: 0,
	Results: 
	[
		{
			TenantId: 00000000000000000000000000000000,
			BillingRunID: 0,
			Started: False,
			Message: String
		}
	]
}