post https://api.chartmogul.com/v1/data_sources
Creates a data_source
object for importing data into ChartMogul.
Examples
curl -X POST "https://api.chartmogul.com/v1/data_sources" \
-u YOUR_API_KEY: \
-H "Content-Type: application/json" \
-d '{
"name": "In-house billing"
}'
ChartMogul::DataSource.create!(
name: 'In-house billing'
)
ChartMogul.DataSource.create(config, {
"name": "In-house billing"
});
<?php
ChartMogul\DataSource::create([
"name" => "In-house billing"
]);
?>
api.CreateDataSource("In-house billing")
chartmogul.DataSource.create(config, data={
"name": "In-house billing"
})
Result Format
{
"uuid": "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
"name": "In-house billing",
"system": "Custom",
"created_at": "2023-01-10T15:34:05.918Z",
"status": "idle"
}
#<ChartMogul::DataSource:0x007ff9f127d628
@name="In-house billing",
@uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
@status="idle",
@system="Custom",
@created_at=2023-01-10 15:34:05 UTC
>
{
"uuid": "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
"name": "In-house billing",
"system": "Custom",
"created_at": "2023-01-10T15:34:05Z",
"status": "idle"
}
ChartMogul\DataSource::__set_state(array(
"uuid" => "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
"status" => "idle",
"system" => "Custom",
"created_at" => "2023-01-10T15:34:05.585Z",
"name" => "In-house billing"
));
(*chartmogul.DataSource)(0xc042048380)({
UUID: (string) (len=39) "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
Name: (string) (len=16) "In-house billing",
CreatedAt: (string) (len=24) "2023-01-10T15:34:05.346Z",
Status: (string) (len=4) "idle",
System: (string) (len=10) "Custom"
})
<DataSource{
created_at=datetime.datetime(2023, 1, 10, 15, 34, 5, 513000, tzinfo=datetime.timezone.utc),
name='In-house billing',
status='idle',
system='Custom',
uuid='ds_fef05d54-47b4-431b-aed2-eb6b9e545430'}>
In the response, the JSON
object contains the following data:
uuid
— The UUID of thedata_source
object generated by ChartMogul.name
— The unique name of the data source as specified by you.system
— The type of system from which customer billing data is imported using this data source. For example,Stripe
,Recurly
,GoCardless
,Chargify
,Custom
, and so on.created_at
— The time when this data source was created in the ChartMogul system.status
— The current status of the data import into ChartMogul. For data sources based on integrations maintained by ChartMogul (ie.Stripe
,Braintree
, etc.), if there is no data then status will benever_imported
. If there is data that is being processed then status will beimporting
. If all data has been processed then status will beimport_complete
. For data sources based on ourCustom
data source, if data is currently being processed then status will beworking
and if there's no data being processed then status will beidle
.
Creating data sources for integrations maintained by ChartMogul
You can create data sources for integrations maintained by ChartMogul, ie. Stripe, Braintree, Recurly, Chargify and PayPal, directly within your ChartMogul account at Data platform > Home. You can use this endpoint only to create data sources that are based on our Custom data source.