Skip to main content
POST
/
rr
/
api
/
v1
/
contracts
/
{contract_id}
/
prepaid-commits
Create Prepaid Commit
curl --request POST \
  --url https://api.meetcampfire.com/rr/api/v1/contracts/{contract_id}/prepaid-commits \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "total_value": 0,
  "start_date": "2023-12-25",
  "entity": 123,
  "product": 123,
  "description": "<string>",
  "currency": "<string>",
  "exchange_rate": 0,
  "exchange_rate_book": 0,
  "discount_percentage": 50,
  "rate": 50000000000000,
  "expiration_date": "2023-12-25",
  "priority": -1,
  "subledger": 123,
  "auto_send_overage_invoices": true,
  "overage_invoice_start_month": "2023-12-25",
  "department": 123,
  "tags": "<string>"
}
'
import requests

url = "https://api.meetcampfire.com/rr/api/v1/contracts/{contract_id}/prepaid-commits"

payload = {
"name": "<string>",
"total_value": 0,
"start_date": "2023-12-25",
"entity": 123,
"product": 123,
"description": "<string>",
"currency": "<string>",
"exchange_rate": 0,
"exchange_rate_book": 0,
"discount_percentage": 50,
"rate": 50000000000000,
"expiration_date": "2023-12-25",
"priority": -1,
"subledger": 123,
"auto_send_overage_invoices": True,
"overage_invoice_start_month": "2023-12-25",
"department": 123,
"tags": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
total_value: 0,
start_date: '2023-12-25',
entity: 123,
product: 123,
description: '<string>',
currency: '<string>',
exchange_rate: 0,
exchange_rate_book: 0,
discount_percentage: 50,
rate: 50000000000000,
expiration_date: '2023-12-25',
priority: -1,
subledger: 123,
auto_send_overage_invoices: true,
overage_invoice_start_month: '2023-12-25',
department: 123,
tags: '<string>'
})
};

fetch('https://api.meetcampfire.com/rr/api/v1/contracts/{contract_id}/prepaid-commits', 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.meetcampfire.com/rr/api/v1/contracts/{contract_id}/prepaid-commits",
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([
'name' => '<string>',
'total_value' => 0,
'start_date' => '2023-12-25',
'entity' => 123,
'product' => 123,
'description' => '<string>',
'currency' => '<string>',
'exchange_rate' => 0,
'exchange_rate_book' => 0,
'discount_percentage' => 50,
'rate' => 50000000000000,
'expiration_date' => '2023-12-25',
'priority' => -1,
'subledger' => 123,
'auto_send_overage_invoices' => true,
'overage_invoice_start_month' => '2023-12-25',
'department' => 123,
'tags' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.meetcampfire.com/rr/api/v1/contracts/{contract_id}/prepaid-commits"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"total_value\": 0,\n \"start_date\": \"2023-12-25\",\n \"entity\": 123,\n \"product\": 123,\n \"description\": \"<string>\",\n \"currency\": \"<string>\",\n \"exchange_rate\": 0,\n \"exchange_rate_book\": 0,\n \"discount_percentage\": 50,\n \"rate\": 50000000000000,\n \"expiration_date\": \"2023-12-25\",\n \"priority\": -1,\n \"subledger\": 123,\n \"auto_send_overage_invoices\": true,\n \"overage_invoice_start_month\": \"2023-12-25\",\n \"department\": 123,\n \"tags\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<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://api.meetcampfire.com/rr/api/v1/contracts/{contract_id}/prepaid-commits")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"total_value\": 0,\n \"start_date\": \"2023-12-25\",\n \"entity\": 123,\n \"product\": 123,\n \"description\": \"<string>\",\n \"currency\": \"<string>\",\n \"exchange_rate\": 0,\n \"exchange_rate_book\": 0,\n \"discount_percentage\": 50,\n \"rate\": 50000000000000,\n \"expiration_date\": \"2023-12-25\",\n \"priority\": -1,\n \"subledger\": 123,\n \"auto_send_overage_invoices\": true,\n \"overage_invoice_start_month\": \"2023-12-25\",\n \"department\": 123,\n \"tags\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.meetcampfire.com/rr/api/v1/contracts/{contract_id}/prepaid-commits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"total_value\": 0,\n \"start_date\": \"2023-12-25\",\n \"entity\": 123,\n \"product\": 123,\n \"description\": \"<string>\",\n \"currency\": \"<string>\",\n \"exchange_rate\": 0,\n \"exchange_rate_book\": 0,\n \"discount_percentage\": 50,\n \"rate\": 50000000000000,\n \"expiration_date\": \"2023-12-25\",\n \"priority\": -1,\n \"subledger\": 123,\n \"auto_send_overage_invoices\": true,\n \"overage_invoice_start_month\": \"2023-12-25\",\n \"department\": 123,\n \"tags\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "contract": 123,
  "entity_name": "<string>",
  "product_name": "<string>",
  "name": "<string>",
  "total_value": 0,
  "remaining_value": 0,
  "start_date": "2023-12-25",
  "is_invoiced": true,
  "invoice": 123,
  "department_name": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "last_modified_at": "2023-11-07T05:31:56Z",
  "entity": 123,
  "product": 123,
  "description": "<string>",
  "currency": "<string>",
  "exchange_rate": 0,
  "exchange_rate_book": 0,
  "discount_percentage": 50,
  "rate": 50000000000000,
  "expiration_date": "2023-12-25",
  "priority": -1,
  "subledger": 123,
  "auto_send_overage_invoices": true,
  "overage_invoice_start_month": "2023-12-25",
  "department": 123,
  "tags": "<string>"
}

Authorizations

Authorization
string
header
required

Token-based authentication with required prefix "Token"

Path Parameters

contract_id
integer
required

Body

name
string
required
Maximum string length: 250
total_value
number<double>
required
Required range: -1000000000000000000 < x < 1000000000000000000
start_date
string<date>
required
entity
integer | null
product
integer | null
description
string | null
currency
string
Maximum string length: 3
exchange_rate
number<double> | null
Required range: -100000000000000 < x < 100000000000000
exchange_rate_book
number<double> | null
Required range: -100000000000000 < x < 100000000000000
discount_percentage
number<double>

Discount applied to gross usage (e.g. 20.00 for 20%)

Required range: 0 <= x <= 100
rate
number<double> | null

List price per unit. Prepaid usage = rate * (1 - discount%). Overage = rate (no discount).

Required range: 0 <= x < 100000000000000
expiration_date
string<date> | null
priority
integer

Drawdown order when multiple commits exist (lower = higher priority)

Required range: -2147483648 <= x <= 2147483647
subledger
integer | null
overage_invoice_cadence
enum<string>

How often overage/on-demand usage is invoiced

  • monthly - Monthly
  • quarterly - Quarterly
  • biannual - Bi Annualy
  • annual - Annual
  • one_time - One Time
  • custom - Custom
Available options:
monthly,
quarterly,
biannual,
annual,
one_time,
custom
auto_send_overage_invoices
boolean

Automatically send overage invoices when generated

overage_invoice_start_month
string<date> | null

Anchor date for overage billing cycles. Defaults to start_date.

department
integer | null
tags
string | null

Response

201 - application/json
id
integer
required
read-only
contract
integer
required
read-only
entity_name
string | null
required
read-only
product_name
string | null
required
read-only
name
string
required
Maximum string length: 250
total_value
number<double>
required
Required range: -1000000000000000000 < x < 1000000000000000000
remaining_value
number<double>
required
read-only
Required range: -1000000000000000000 < x < 1000000000000000000
start_date
string<date>
required
status
enum<string>
required
  • ACTIVE - Active
  • EXHAUSTED - Exhausted
  • EXPIRED - Expired
Available options:
ACTIVE,
EXHAUSTED,
EXPIRED
is_invoiced
boolean
required
read-only
invoice
integer | null
required
read-only
department_name
string | null
required
read-only
created_at
string<date-time> | null
required
read-only
last_modified_at
string<date-time> | null
required
read-only
entity
integer | null
product
integer | null
description
string | null
currency
string
Maximum string length: 3
exchange_rate
number<double> | null
Required range: -100000000000000 < x < 100000000000000
exchange_rate_book
number<double> | null
Required range: -100000000000000 < x < 100000000000000
discount_percentage
number<double>

Discount applied to gross usage (e.g. 20.00 for 20%)

Required range: 0 <= x <= 100
rate
number<double> | null

List price per unit. Prepaid usage = rate * (1 - discount%). Overage = rate (no discount).

Required range: 0 <= x < 100000000000000
expiration_date
string<date> | null
priority
integer

Drawdown order when multiple commits exist (lower = higher priority)

Required range: -2147483648 <= x <= 2147483647
subledger
integer | null
overage_invoice_cadence
enum<string>

How often overage/on-demand usage is invoiced

  • monthly - Monthly
  • quarterly - Quarterly
  • biannual - Bi Annualy
  • annual - Annual
  • one_time - One Time
  • custom - Custom
Available options:
monthly,
quarterly,
biannual,
annual,
one_time,
custom
auto_send_overage_invoices
boolean

Automatically send overage invoices when generated

overage_invoice_start_month
string<date> | null

Anchor date for overage billing cycles. Defaults to start_date.

department
integer | null
tags
string | null