Create Price
curl --request POST \
--url https://api.atlas.co/functions/v1/prices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product": "<string>",
"currency": "<string>",
"unit_amount": 123,
"type": "one_time",
"billing_scheme": "per_unit",
"recurring": {
"interval_count": 1
},
"tiers": [
{
"up_to": 123,
"unit_amount": 123,
"flat_amount": 123
}
],
"nickname": "<string>",
"is_active": true,
"metadata": {}
}
'import requests
url = "https://api.atlas.co/functions/v1/prices"
payload = {
"product": "<string>",
"currency": "<string>",
"unit_amount": 123,
"type": "one_time",
"billing_scheme": "per_unit",
"recurring": { "interval_count": 1 },
"tiers": [
{
"up_to": 123,
"unit_amount": 123,
"flat_amount": 123
}
],
"nickname": "<string>",
"is_active": True,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product: '<string>',
currency: '<string>',
unit_amount: 123,
type: 'one_time',
billing_scheme: 'per_unit',
recurring: {interval_count: 1},
tiers: [{up_to: 123, unit_amount: 123, flat_amount: 123}],
nickname: '<string>',
is_active: true,
metadata: {}
})
};
fetch('https://api.atlas.co/functions/v1/prices', 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://api.atlas.co/functions/v1/prices",
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([
'product' => '<string>',
'currency' => '<string>',
'unit_amount' => 123,
'type' => 'one_time',
'billing_scheme' => 'per_unit',
'recurring' => [
'interval_count' => 1
],
'tiers' => [
[
'up_to' => 123,
'unit_amount' => 123,
'flat_amount' => 123
]
],
'nickname' => '<string>',
'is_active' => true,
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.atlas.co/functions/v1/prices"
payload := strings.NewReader("{\n \"product\": \"<string>\",\n \"currency\": \"<string>\",\n \"unit_amount\": 123,\n \"type\": \"one_time\",\n \"billing_scheme\": \"per_unit\",\n \"recurring\": {\n \"interval_count\": 1\n },\n \"tiers\": [\n {\n \"up_to\": 123,\n \"unit_amount\": 123,\n \"flat_amount\": 123\n }\n ],\n \"nickname\": \"<string>\",\n \"is_active\": true,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.atlas.co/functions/v1/prices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product\": \"<string>\",\n \"currency\": \"<string>\",\n \"unit_amount\": 123,\n \"type\": \"one_time\",\n \"billing_scheme\": \"per_unit\",\n \"recurring\": {\n \"interval_count\": 1\n },\n \"tiers\": [\n {\n \"up_to\": 123,\n \"unit_amount\": 123,\n \"flat_amount\": 123\n }\n ],\n \"nickname\": \"<string>\",\n \"is_active\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.atlas.co/functions/v1/prices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product\": \"<string>\",\n \"currency\": \"<string>\",\n \"unit_amount\": 123,\n \"type\": \"one_time\",\n \"billing_scheme\": \"per_unit\",\n \"recurring\": {\n \"interval_count\": 1\n },\n \"tiers\": [\n {\n \"up_to\": 123,\n \"unit_amount\": 123,\n \"flat_amount\": 123\n }\n ],\n \"nickname\": \"<string>\",\n \"is_active\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "price",
"product": "<string>",
"active": true,
"currency": "<string>",
"unit_amount": 123,
"recurring": {
"interval": "<string>",
"interval_count": 123,
"usage_type": "<string>",
"aggregate_usage": "<string>"
},
"tiers": [
{}
],
"tiers_mode": "<string>",
"nickname": "<string>",
"metadata": {},
"created": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Prices
Create Price
POST
/
prices
Create Price
curl --request POST \
--url https://api.atlas.co/functions/v1/prices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product": "<string>",
"currency": "<string>",
"unit_amount": 123,
"type": "one_time",
"billing_scheme": "per_unit",
"recurring": {
"interval_count": 1
},
"tiers": [
{
"up_to": 123,
"unit_amount": 123,
"flat_amount": 123
}
],
"nickname": "<string>",
"is_active": true,
"metadata": {}
}
'import requests
url = "https://api.atlas.co/functions/v1/prices"
payload = {
"product": "<string>",
"currency": "<string>",
"unit_amount": 123,
"type": "one_time",
"billing_scheme": "per_unit",
"recurring": { "interval_count": 1 },
"tiers": [
{
"up_to": 123,
"unit_amount": 123,
"flat_amount": 123
}
],
"nickname": "<string>",
"is_active": True,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product: '<string>',
currency: '<string>',
unit_amount: 123,
type: 'one_time',
billing_scheme: 'per_unit',
recurring: {interval_count: 1},
tiers: [{up_to: 123, unit_amount: 123, flat_amount: 123}],
nickname: '<string>',
is_active: true,
metadata: {}
})
};
fetch('https://api.atlas.co/functions/v1/prices', 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://api.atlas.co/functions/v1/prices",
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([
'product' => '<string>',
'currency' => '<string>',
'unit_amount' => 123,
'type' => 'one_time',
'billing_scheme' => 'per_unit',
'recurring' => [
'interval_count' => 1
],
'tiers' => [
[
'up_to' => 123,
'unit_amount' => 123,
'flat_amount' => 123
]
],
'nickname' => '<string>',
'is_active' => true,
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.atlas.co/functions/v1/prices"
payload := strings.NewReader("{\n \"product\": \"<string>\",\n \"currency\": \"<string>\",\n \"unit_amount\": 123,\n \"type\": \"one_time\",\n \"billing_scheme\": \"per_unit\",\n \"recurring\": {\n \"interval_count\": 1\n },\n \"tiers\": [\n {\n \"up_to\": 123,\n \"unit_amount\": 123,\n \"flat_amount\": 123\n }\n ],\n \"nickname\": \"<string>\",\n \"is_active\": true,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.atlas.co/functions/v1/prices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product\": \"<string>\",\n \"currency\": \"<string>\",\n \"unit_amount\": 123,\n \"type\": \"one_time\",\n \"billing_scheme\": \"per_unit\",\n \"recurring\": {\n \"interval_count\": 1\n },\n \"tiers\": [\n {\n \"up_to\": 123,\n \"unit_amount\": 123,\n \"flat_amount\": 123\n }\n ],\n \"nickname\": \"<string>\",\n \"is_active\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.atlas.co/functions/v1/prices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product\": \"<string>\",\n \"currency\": \"<string>\",\n \"unit_amount\": 123,\n \"type\": \"one_time\",\n \"billing_scheme\": \"per_unit\",\n \"recurring\": {\n \"interval_count\": 1\n },\n \"tiers\": [\n {\n \"up_to\": 123,\n \"unit_amount\": 123,\n \"flat_amount\": 123\n }\n ],\n \"nickname\": \"<string>\",\n \"is_active\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "price",
"product": "<string>",
"active": true,
"currency": "<string>",
"unit_amount": 123,
"recurring": {
"interval": "<string>",
"interval_count": 123,
"usage_type": "<string>",
"aggregate_usage": "<string>"
},
"tiers": [
{}
],
"tiers_mode": "<string>",
"nickname": "<string>",
"metadata": {},
"created": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Authorizations
API key (sk_test_* or sk_live_*)
Body
application/json
Available options:
one_time, recurring Available options:
per_unit, tiered Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
graduated, volume Show child attributes
Show child attributes
Response
Price created
Available options:
price Available options:
one_time, recurring Available options:
per_unit, tiered Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I