ChartMogul
ChartMogul is a real-time analytics and reporting tool for businesses with subscription billing.
Data integration: Skyvia supports importing data to and from ChartMogul, exporting ChartMogul data to CSV files, replicating ChartMogul data to relational databases, and synchronizing ChartMogul data with other cloud apps and relational databases.
Backup: Skyvia Backup does not support ChartMogul.
Query: Skyvia Query supports ChartMogul.
Establishing Connection
To create a connection to ChartMogul, you need to specify the API Key.
Getting Credentials
To get the ChartMogul API Key, perform the following steps:
- Log in to ChartMogul.
-
Click on the user icon in the bottom left corner and select Admin.
-
Select the ChartMogul owner in the users list and scroll down to the API Keys block.
- Copy the API Key.
Creating Connection
Enter the obtained API Key to the corresponding box in the Connection Editor.
Connector Specifics
Object Peculiarities
PlanGroups
The PlanIds values are not returned in the query results by default. However, when importing data to the PlanGroups object, you must map the PlanIds field.
You must provide the PlanIds values in the array format:["id1","id2"]
, where the Id1 and Id2 are the Uuid values of the Plans object.
Customers
You can add custom fields in the Customers object. Custom field names and values are stored in JSON format in the Attributes_Custom field.
To successfully insert data to the custom fields, you must map the Attributes_Custom field and pass its value in JSON format. You must specify custom field type, name and value:
- type - the custom field data type (valid data types for ChartMogul are String, Integer, Decimal, Timestamp и Boolean).
- key - custom field name. If the field name was not used before, the new custom field would be created automatically.
- value - the custom field value.
For example, [{"type": "String", "key": "field_name", "value": "custom_field_value"}]
,
To successfully update custom field records, you must map the Attributes_CustomUpdate field. You must specify the custom field name to update and its value in JSON format.
For example, {"field_name":"updated_custom_field_value"}
.
You can update only the records where the custom fields already exist. Custom fields can be added, updated, or deleted via stored procedures.
Contacts
To successfully insert and update custom fields in the Contacts object, you must map the Custom field in JSON format.
For example, [{"key":"field_name","value":"field_value"}]
.
You can insert and update records in the existing fields already created in ChartMogul UI.
SubscriptionEvents
To successfully insert data to the SubscriptionEvents object, you must map the required fields CustomerExternalId, EventType, EventDate, EffectiveDate and additional fields depending on the EventType value:
- SubscriptionId field is required for all event types except Retracted.
- RetractedEventId is required for the Retracted event type.
- Plan, Currency, and Amount are required for the Started, Start(Scheduled), Updated and Updated(Scheduled) event types.
Invoices
Invoices object stores complex structured data. Invoices can have several lines stored as nested JSON objects in the LineItems and Transactions fields.
For user convenience, invoice lines are also available as separate records in InvoiceLineItems and InvoiceTransactions objects. They allow you to view these lines in a tabular form with Query, export them to CSV with Export, import them from ChartMogul to a cloud application or database, where these lines should be stored in a separate table, etc.
To successfully import data to the nested invoice lines, you can use our Nested Objects mapping feature in Import. For this, you need to select the Nested Objects checkbox in the integration. Then, in the mapping settings, you can map the fields of invoice lines or transaction items.
Metrics
All the objects from the Metrics API group (AllKeyMetrics, MonthlyRecurringRevenue, AnnualizedRunRate, AverageRevenuePerAccount, AverageSalePrice, CustomerCount, CustomerChurnRate, MRRChurnRate, and CustomerLifetimeValue) have StartDate and EndDate fields, which can be used for filtering.
If you don’t use filters by dates when querying, then the StartDate is set to 01 January 2020, and the EndDate is set to the current date by default.
You can also use the Interval field for filtering. If you don’t use the filter by Interval when querying, its value is set to month by default. You can set another filter for this field depending on the object:
- AllKeyMetrics object — day, week or month.
- MonthlyRecurringRevenue, AnnualizedRunRate, AverageRevenuePerAccount, CustomerCount objects — day, week, month or quarter.
- AverageSalePrice — month or quarter.
We recommend using filters to limit the data volume for saving API calls number.
DML Operations Support
Operation | Object |
---|---|
INSERT, UPDATE, DELETE | Customers, PlanGroups, Plans, SubscriptionEvents |
INSERT, DELETE | DataSources, Invoices |
INSERT | InvoiceTransactions |
Incremental Replication and Synchronization
Skyvia supports Replication with Incremental Updates for DataSources and SubscriptionEvents objects. Replication tracks only the new records for the DataSources object.
Skyvia supports Synchronization for the SubscriptionEvents object.
Stored procedures
Skyvia represents part of the supported ChartMogul features as stored procedures. You can call a stored procedure, for example, as a text of the command in the ExecuteCommand action in a Target component of a Data Flow or in Query.
AddCustomAttributesToCustomer
To add a new custom field into the existing records in the Customers object, use the command
call AddCustomAttributesToCustomer(:customer_uuid, :type,:key,:value)
PARAMETER NAME | DESCRIPTION |
---|---|
Customer_uuid | The ChartMogul UUID of the customer to add custom field to |
Type | Custom field data type (valid values are string, integer, decimal, timestamp, and boolean) |
Key | Custom field name |
Value | Custom field value |
UpdateCustomAttributesOfCustomer
To update custom fields and their values, use the command
call UpdateCustomAttributesOfCustomer(:customer_uuid, :custom)
PARAMETER NAME | DESCRIPTION |
---|---|
Customer_uuid | The ChartMogul UUID of the customer to add custom field to |
Custom | Existing field name and its new value in the {“key”:”value”} format |
RemoveCustomAttributesFromCustomer
To remove custom field from the Customers record, use command
call RemoveCustomAttributesFromCustomer(:customer_uuid, :custom)
PARAMETER NAME | DESCRIPTION |
---|---|
Customer_uuid | The ChartMogul UUID of the customer to add custom field to |
Custom | Custom field name to be deleted in the following format: ["field_name"] |
To remove several fields in a row, specify their names separated by commas, for example ["field1","field2"...]
.
Supported Actions
Skyvia supports all the common actions for ChartMogul.