Evo Voice

<back to all web services

GetBilling

Get the billing totals for the specified date range. Please note that we do not support getting billing at the hourly time granularity.

Requires Authentication
The following routes are available for this service:
GET/billing
import 'package:servicestack/servicestack.dart';

class BillingCustomerInfo implements IConvertible
{
    String? customerId;
    double? internationalCosts;
    bool? hasCallRecording;

    BillingCustomerInfo({this.customerId,this.internationalCosts,this.hasCallRecording});
    BillingCustomerInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        customerId = json['customerId'];
        internationalCosts = JsonConverters.toDouble(json['internationalCosts']);
        hasCallRecording = json['hasCallRecording'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'customerId': customerId,
        'internationalCosts': internationalCosts,
        'hasCallRecording': hasCallRecording
    };

    getTypeName() => "BillingCustomerInfo";
    TypeContext? context = _ctx;
}

class BillingInfo implements IConvertible
{
    List<BillingCustomerInfo>? customers;

    BillingInfo({this.customers});
    BillingInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        customers = JsonConverters.fromJson(json['customers'],'List<BillingCustomerInfo>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'customers': JsonConverters.toJson(customers,'List<BillingCustomerInfo>',context!)
    };

    getTypeName() => "BillingInfo";
    TypeContext? context = _ctx;
}

/**
* Get the billing totals for the specified date range. Please note that we do not support getting billing at the hourly time granularity.
*/
// @Api(Description="Get the billing totals for the specified date range. Please note that we do not support getting billing at the hourly time granularity.")
class GetBilling implements IConvertible
{
    /**
    * Your Evo Voice Account ID
    */
    // @ApiMember(Description="Your Evo Voice Account ID", IsRequired=true)
    String? accountId;

    /**
    * The start of the date range that you want to query for (we will only use the date portion, so it will include the entire day even if you specify a time as well)
    */
    // @ApiMember(Description="The start of the date range that you want to query for (we will only use the date portion, so it will include the entire day even if you specify a time as well)", IsRequired=true)
    String? startDate;

    /**
    * The end of the date range you want to query for (we will include this entire day in the billing)
    */
    // @ApiMember(Description="The end of the date range you want to query for (we will include this entire day in the billing)", IsRequired=true)
    String? endDate;

    /**
    * Specify this to filter to a specific customer.
    */
    // @ApiMember(Description="Specify this to filter to a specific customer.")
    String? customerId;

    GetBilling({this.accountId,this.startDate,this.endDate,this.customerId});
    GetBilling.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        accountId = json['accountId'];
        startDate = json['startDate'];
        endDate = json['endDate'];
        customerId = json['customerId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'accountId': accountId,
        'startDate': startDate,
        'endDate': endDate,
        'customerId': customerId
    };

    getTypeName() => "GetBilling";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'evovoice.io', types: <String, TypeInfo> {
    'BillingCustomerInfo': TypeInfo(TypeOf.Class, create:() => BillingCustomerInfo()),
    'BillingInfo': TypeInfo(TypeOf.Class, create:() => BillingInfo()),
    'List<BillingCustomerInfo>': TypeInfo(TypeOf.Class, create:() => <BillingCustomerInfo>[]),
    'GetBilling': TypeInfo(TypeOf.Class, create:() => GetBilling()),
});

Dart GetBilling DTOs

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

HTTP + CSV

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

GET /billing HTTP/1.1 
Host: evovoice.io 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"customers":[{"customerId":"String","internationalCosts":0,"hasCallRecording":false}]}