Create subscription
curl --request POST \
--url https://platform.runonatlas.com/external/subscriptions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"startDate": "2021-01-01T00:00:00.000Z",
"autoChargeInvoice": false,
"autoSyncInvoice": true,
"autoSendInvoice": true,
"customerId": "atlas-internal-customer-id-123",
"planId": "atlas-internal-plan-id-123",
"currency": "USD",
"endDate": "2021-12-31T00:00:00.000Z",
"netTerms": "net30",
"allowCustomerChanges": true,
"paymentGateway": "Stripe",
"invoiceGenerationStartDate": "2021-01-01T00:00:00.000Z"
}
'import requests
url = "https://platform.runonatlas.com/external/subscriptions"
payload = {
"startDate": "2021-01-01T00:00:00.000Z",
"autoChargeInvoice": False,
"autoSyncInvoice": True,
"autoSendInvoice": True,
"customerId": "atlas-internal-customer-id-123",
"planId": "atlas-internal-plan-id-123",
"currency": "USD",
"endDate": "2021-12-31T00:00:00.000Z",
"netTerms": "net30",
"allowCustomerChanges": True,
"paymentGateway": "Stripe",
"invoiceGenerationStartDate": "2021-01-01T00:00:00.000Z"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2021-01-01T00:00:00.000Z',
autoChargeInvoice: false,
autoSyncInvoice: true,
autoSendInvoice: true,
customerId: 'atlas-internal-customer-id-123',
planId: 'atlas-internal-plan-id-123',
currency: 'USD',
endDate: '2021-12-31T00:00:00.000Z',
netTerms: 'net30',
allowCustomerChanges: true,
paymentGateway: 'Stripe',
invoiceGenerationStartDate: '2021-01-01T00:00:00.000Z'
})
};
fetch('https://platform.runonatlas.com/external/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://platform.runonatlas.com/external/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'startDate' => '2021-01-01T00:00:00.000Z',
'autoChargeInvoice' => false,
'autoSyncInvoice' => true,
'autoSendInvoice' => true,
'customerId' => 'atlas-internal-customer-id-123',
'planId' => 'atlas-internal-plan-id-123',
'currency' => 'USD',
'endDate' => '2021-12-31T00:00:00.000Z',
'netTerms' => 'net30',
'allowCustomerChanges' => true,
'paymentGateway' => 'Stripe',
'invoiceGenerationStartDate' => '2021-01-01T00:00:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform.runonatlas.com/external/subscriptions"
payload := strings.NewReader("{\n \"startDate\": \"2021-01-01T00:00:00.000Z\",\n \"autoChargeInvoice\": false,\n \"autoSyncInvoice\": true,\n \"autoSendInvoice\": true,\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"planId\": \"atlas-internal-plan-id-123\",\n \"currency\": \"USD\",\n \"endDate\": \"2021-12-31T00:00:00.000Z\",\n \"netTerms\": \"net30\",\n \"allowCustomerChanges\": true,\n \"paymentGateway\": \"Stripe\",\n \"invoiceGenerationStartDate\": \"2021-01-01T00:00:00.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://platform.runonatlas.com/external/subscriptions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2021-01-01T00:00:00.000Z\",\n \"autoChargeInvoice\": false,\n \"autoSyncInvoice\": true,\n \"autoSendInvoice\": true,\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"planId\": \"atlas-internal-plan-id-123\",\n \"currency\": \"USD\",\n \"endDate\": \"2021-12-31T00:00:00.000Z\",\n \"netTerms\": \"net30\",\n \"allowCustomerChanges\": true,\n \"paymentGateway\": \"Stripe\",\n \"invoiceGenerationStartDate\": \"2021-01-01T00:00:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.runonatlas.com/external/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2021-01-01T00:00:00.000Z\",\n \"autoChargeInvoice\": false,\n \"autoSyncInvoice\": true,\n \"autoSendInvoice\": true,\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"planId\": \"atlas-internal-plan-id-123\",\n \"currency\": \"USD\",\n \"endDate\": \"2021-12-31T00:00:00.000Z\",\n \"netTerms\": \"net30\",\n \"allowCustomerChanges\": true,\n \"paymentGateway\": \"Stripe\",\n \"invoiceGenerationStartDate\": \"2021-01-01T00:00:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2021-01-01T00:00:00.000Z",
"id": "atlas-internal-subscription-id-123",
"startDate": "2021-01-01T00:00:00.000Z",
"status": "active",
"updatedAt": "2021-01-01T00:00:00.000Z",
"allowCustomerChanges": true,
"autoChargeInvoice": false,
"autoSyncInvoice": true,
"autoSendInvoice": true,
"paymentGateway": "Stripe",
"isTrial": false,
"customerId": "atlas-internal-customer-id-123",
"planId": "atlas-internal-plan-id-123",
"merchantId": "atlas-internal-merchant-id-123",
"billingCadence": "monthly",
"currency": "USD",
"endDate": "2021-12-31T00:00:00.000Z",
"netTerms": "net30",
"chargeForUsageBasedPricesDuringTrial": false
}Subscriptions
Create subscription
Create a subscription.
POST
/
external
/
subscriptions
Create subscription
curl --request POST \
--url https://platform.runonatlas.com/external/subscriptions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"startDate": "2021-01-01T00:00:00.000Z",
"autoChargeInvoice": false,
"autoSyncInvoice": true,
"autoSendInvoice": true,
"customerId": "atlas-internal-customer-id-123",
"planId": "atlas-internal-plan-id-123",
"currency": "USD",
"endDate": "2021-12-31T00:00:00.000Z",
"netTerms": "net30",
"allowCustomerChanges": true,
"paymentGateway": "Stripe",
"invoiceGenerationStartDate": "2021-01-01T00:00:00.000Z"
}
'import requests
url = "https://platform.runonatlas.com/external/subscriptions"
payload = {
"startDate": "2021-01-01T00:00:00.000Z",
"autoChargeInvoice": False,
"autoSyncInvoice": True,
"autoSendInvoice": True,
"customerId": "atlas-internal-customer-id-123",
"planId": "atlas-internal-plan-id-123",
"currency": "USD",
"endDate": "2021-12-31T00:00:00.000Z",
"netTerms": "net30",
"allowCustomerChanges": True,
"paymentGateway": "Stripe",
"invoiceGenerationStartDate": "2021-01-01T00:00:00.000Z"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2021-01-01T00:00:00.000Z',
autoChargeInvoice: false,
autoSyncInvoice: true,
autoSendInvoice: true,
customerId: 'atlas-internal-customer-id-123',
planId: 'atlas-internal-plan-id-123',
currency: 'USD',
endDate: '2021-12-31T00:00:00.000Z',
netTerms: 'net30',
allowCustomerChanges: true,
paymentGateway: 'Stripe',
invoiceGenerationStartDate: '2021-01-01T00:00:00.000Z'
})
};
fetch('https://platform.runonatlas.com/external/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://platform.runonatlas.com/external/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'startDate' => '2021-01-01T00:00:00.000Z',
'autoChargeInvoice' => false,
'autoSyncInvoice' => true,
'autoSendInvoice' => true,
'customerId' => 'atlas-internal-customer-id-123',
'planId' => 'atlas-internal-plan-id-123',
'currency' => 'USD',
'endDate' => '2021-12-31T00:00:00.000Z',
'netTerms' => 'net30',
'allowCustomerChanges' => true,
'paymentGateway' => 'Stripe',
'invoiceGenerationStartDate' => '2021-01-01T00:00:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform.runonatlas.com/external/subscriptions"
payload := strings.NewReader("{\n \"startDate\": \"2021-01-01T00:00:00.000Z\",\n \"autoChargeInvoice\": false,\n \"autoSyncInvoice\": true,\n \"autoSendInvoice\": true,\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"planId\": \"atlas-internal-plan-id-123\",\n \"currency\": \"USD\",\n \"endDate\": \"2021-12-31T00:00:00.000Z\",\n \"netTerms\": \"net30\",\n \"allowCustomerChanges\": true,\n \"paymentGateway\": \"Stripe\",\n \"invoiceGenerationStartDate\": \"2021-01-01T00:00:00.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://platform.runonatlas.com/external/subscriptions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2021-01-01T00:00:00.000Z\",\n \"autoChargeInvoice\": false,\n \"autoSyncInvoice\": true,\n \"autoSendInvoice\": true,\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"planId\": \"atlas-internal-plan-id-123\",\n \"currency\": \"USD\",\n \"endDate\": \"2021-12-31T00:00:00.000Z\",\n \"netTerms\": \"net30\",\n \"allowCustomerChanges\": true,\n \"paymentGateway\": \"Stripe\",\n \"invoiceGenerationStartDate\": \"2021-01-01T00:00:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.runonatlas.com/external/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2021-01-01T00:00:00.000Z\",\n \"autoChargeInvoice\": false,\n \"autoSyncInvoice\": true,\n \"autoSendInvoice\": true,\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"planId\": \"atlas-internal-plan-id-123\",\n \"currency\": \"USD\",\n \"endDate\": \"2021-12-31T00:00:00.000Z\",\n \"netTerms\": \"net30\",\n \"allowCustomerChanges\": true,\n \"paymentGateway\": \"Stripe\",\n \"invoiceGenerationStartDate\": \"2021-01-01T00:00:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2021-01-01T00:00:00.000Z",
"id": "atlas-internal-subscription-id-123",
"startDate": "2021-01-01T00:00:00.000Z",
"status": "active",
"updatedAt": "2021-01-01T00:00:00.000Z",
"allowCustomerChanges": true,
"autoChargeInvoice": false,
"autoSyncInvoice": true,
"autoSendInvoice": true,
"paymentGateway": "Stripe",
"isTrial": false,
"customerId": "atlas-internal-customer-id-123",
"planId": "atlas-internal-plan-id-123",
"merchantId": "atlas-internal-merchant-id-123",
"billingCadence": "monthly",
"currency": "USD",
"endDate": "2021-12-31T00:00:00.000Z",
"netTerms": "net30",
"chargeForUsageBasedPricesDuringTrial": false
}Authorizations
Body
application/json
Response
The subscription that has been created.

