Create a Source

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'
});
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 
  @uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
  @name="In-house billing", 
  @system="Custom",
  @created_at=2023-01-10 15:34:05 UTC,
  @status="idle",
>
{
  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",
  "name" => "In-house billing",
  "system" => "Custom",
  "created_at" => "2023-01-10T15:34:05.585Z",
  "status" => "idle",
));
(*chartmogul.DataSource)(0xc042048380)({
  UUID: (string) (len=39) "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
  Name: (string) (len=16) "In-house billing",
  System: (string) (len=10) "Custom",
  CreatedAt: (string) (len=24) "2023-01-10T15:34:05.346Z",
  Status: (string) (len=4) "idle",
})
<DataSource{
    uuid='ds_fef05d54-47b4-431b-aed2-eb6b9e545430',
    name='In-house billing',
    system='Custom',
    created_at=datetime.datetime(2023, 1, 10, 15, 34, 5, 513000, tzinfo=datetime.timezone.utc),
    status='idle',
}>

The response object contains the following data:

KeyDescription
uuidThe generated ChartMogul UUID for the created source.
nameThe name of the source, as specified.
systemThe system type. This is always Custom, since this endpoint only creates custom endpoints. The key exists to be consistent with the "Retrieving a Source" endpoint.
created_atThe time when this source was created in ChartMogul.
statusThe current data import status. Since the source created using the endpoint is always of type Custom, and the source has just been created, this will be idle. If data is currently being processed, then this would be working. See the "Retrieving a Source" endpoint for values for other types of sources.

📘

Creating sources for integrations

To create a source for one or more integrations maintained by ChartMogul, such as Stripe, Braintree, Recurly, or PayPal, use the ChartMogul UI. To do so, choose "Data & Config", then "Sources", and then click "ADD SOURCE".

Language