Preview Contract Schedule
curl --request POST \
--url https://api.dualentry.com/public/v1/contracts/actions/preview_schedule/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"custom_fields": [
{}
],
"memo": "",
"date": "2023-12-25",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"company_id": 123,
"customer_id": 123,
"name": "",
"currency_iso_4217_code": "USD",
"bill_to_address": "",
"billing_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"ship_to_address": "",
"shipping_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"obligations": [],
"term_id": 123,
"default_ar_account_id": 123,
"unbilled_receivable_account_id": 123,
"contract_template_id": 123,
"billing_start_date": "2023-12-25",
"billing_frequency": "monthly",
"billing_interval": 1,
"billing_anchor_weekday": 3,
"recognition_start_date": "2023-12-25",
"recognition_frequency": "monthly",
"recognition_interval": 1,
"recognition_anchor_weekday": 3,
"recognition_mode": "individual",
"contract_attachments": [],
"change_orders_attachments": [],
"payment": {
"type": "<string>",
"id": 123,
"body": "<string>",
"link": "<string>"
},
"prepared_invoices": [],
"revenue_recognitions": [],
"cutover_date": "2023-12-25",
"prior_recognized_amount": 1,
"default_early_termination_fee": 1,
"discount_value": 50
}
'import requests
url = "https://api.dualentry.com/public/v1/contracts/actions/preview_schedule/"
payload = {
"custom_fields": [{}],
"memo": "",
"date": "2023-12-25",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"company_id": 123,
"customer_id": 123,
"name": "",
"currency_iso_4217_code": "USD",
"bill_to_address": "",
"billing_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"ship_to_address": "",
"shipping_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"obligations": [],
"term_id": 123,
"default_ar_account_id": 123,
"unbilled_receivable_account_id": 123,
"contract_template_id": 123,
"billing_start_date": "2023-12-25",
"billing_frequency": "monthly",
"billing_interval": 1,
"billing_anchor_weekday": 3,
"recognition_start_date": "2023-12-25",
"recognition_frequency": "monthly",
"recognition_interval": 1,
"recognition_anchor_weekday": 3,
"recognition_mode": "individual",
"contract_attachments": [],
"change_orders_attachments": [],
"payment": {
"type": "<string>",
"id": 123,
"body": "<string>",
"link": "<string>"
},
"prepared_invoices": [],
"revenue_recognitions": [],
"cutover_date": "2023-12-25",
"prior_recognized_amount": 1,
"default_early_termination_fee": 1,
"discount_value": 50
}
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({
custom_fields: [{}],
memo: '',
date: '2023-12-25',
start_date: '2023-12-25',
end_date: '2023-12-25',
company_id: 123,
customer_id: 123,
name: '',
currency_iso_4217_code: 'USD',
bill_to_address: '',
billing_address: {
street: '<string>',
city: '<string>',
postal_code: '<string>',
state: '',
country: '',
second_line: '',
name: '<string>'
},
ship_to_address: '',
shipping_address: {
street: '<string>',
city: '<string>',
postal_code: '<string>',
state: '',
country: '',
second_line: '',
name: '<string>'
},
obligations: [],
term_id: 123,
default_ar_account_id: 123,
unbilled_receivable_account_id: 123,
contract_template_id: 123,
billing_start_date: '2023-12-25',
billing_frequency: 'monthly',
billing_interval: 1,
billing_anchor_weekday: 3,
recognition_start_date: '2023-12-25',
recognition_frequency: 'monthly',
recognition_interval: 1,
recognition_anchor_weekday: 3,
recognition_mode: 'individual',
contract_attachments: [],
change_orders_attachments: [],
payment: {type: '<string>', id: 123, body: JSON.stringify('<string>'), link: '<string>'},
prepared_invoices: [],
revenue_recognitions: [],
cutover_date: '2023-12-25',
prior_recognized_amount: 1,
default_early_termination_fee: 1,
discount_value: 50
})
};
fetch('https://api.dualentry.com/public/v1/contracts/actions/preview_schedule/', 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.dualentry.com/public/v1/contracts/actions/preview_schedule/",
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([
'custom_fields' => [
[
]
],
'memo' => '',
'date' => '2023-12-25',
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'company_id' => 123,
'customer_id' => 123,
'name' => '',
'currency_iso_4217_code' => 'USD',
'bill_to_address' => '',
'billing_address' => [
'street' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '',
'country' => '',
'second_line' => '',
'name' => '<string>'
],
'ship_to_address' => '',
'shipping_address' => [
'street' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '',
'country' => '',
'second_line' => '',
'name' => '<string>'
],
'obligations' => [
],
'term_id' => 123,
'default_ar_account_id' => 123,
'unbilled_receivable_account_id' => 123,
'contract_template_id' => 123,
'billing_start_date' => '2023-12-25',
'billing_frequency' => 'monthly',
'billing_interval' => 1,
'billing_anchor_weekday' => 3,
'recognition_start_date' => '2023-12-25',
'recognition_frequency' => 'monthly',
'recognition_interval' => 1,
'recognition_anchor_weekday' => 3,
'recognition_mode' => 'individual',
'contract_attachments' => [
],
'change_orders_attachments' => [
],
'payment' => [
'type' => '<string>',
'id' => 123,
'body' => '<string>',
'link' => '<string>'
],
'prepared_invoices' => [
],
'revenue_recognitions' => [
],
'cutover_date' => '2023-12-25',
'prior_recognized_amount' => 1,
'default_early_termination_fee' => 1,
'discount_value' => 50
]),
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://api.dualentry.com/public/v1/contracts/actions/preview_schedule/"
payload := strings.NewReader("{\n \"custom_fields\": [\n {}\n ],\n \"memo\": \"\",\n \"date\": \"2023-12-25\",\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"company_id\": 123,\n \"customer_id\": 123,\n \"name\": \"\",\n \"currency_iso_4217_code\": \"USD\",\n \"bill_to_address\": \"\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"obligations\": [],\n \"term_id\": 123,\n \"default_ar_account_id\": 123,\n \"unbilled_receivable_account_id\": 123,\n \"contract_template_id\": 123,\n \"billing_start_date\": \"2023-12-25\",\n \"billing_frequency\": \"monthly\",\n \"billing_interval\": 1,\n \"billing_anchor_weekday\": 3,\n \"recognition_start_date\": \"2023-12-25\",\n \"recognition_frequency\": \"monthly\",\n \"recognition_interval\": 1,\n \"recognition_anchor_weekday\": 3,\n \"recognition_mode\": \"individual\",\n \"contract_attachments\": [],\n \"change_orders_attachments\": [],\n \"payment\": {\n \"type\": \"<string>\",\n \"id\": 123,\n \"body\": \"<string>\",\n \"link\": \"<string>\"\n },\n \"prepared_invoices\": [],\n \"revenue_recognitions\": [],\n \"cutover_date\": \"2023-12-25\",\n \"prior_recognized_amount\": 1,\n \"default_early_termination_fee\": 1,\n \"discount_value\": 50\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://api.dualentry.com/public/v1/contracts/actions/preview_schedule/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"custom_fields\": [\n {}\n ],\n \"memo\": \"\",\n \"date\": \"2023-12-25\",\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"company_id\": 123,\n \"customer_id\": 123,\n \"name\": \"\",\n \"currency_iso_4217_code\": \"USD\",\n \"bill_to_address\": \"\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"obligations\": [],\n \"term_id\": 123,\n \"default_ar_account_id\": 123,\n \"unbilled_receivable_account_id\": 123,\n \"contract_template_id\": 123,\n \"billing_start_date\": \"2023-12-25\",\n \"billing_frequency\": \"monthly\",\n \"billing_interval\": 1,\n \"billing_anchor_weekday\": 3,\n \"recognition_start_date\": \"2023-12-25\",\n \"recognition_frequency\": \"monthly\",\n \"recognition_interval\": 1,\n \"recognition_anchor_weekday\": 3,\n \"recognition_mode\": \"individual\",\n \"contract_attachments\": [],\n \"change_orders_attachments\": [],\n \"payment\": {\n \"type\": \"<string>\",\n \"id\": 123,\n \"body\": \"<string>\",\n \"link\": \"<string>\"\n },\n \"prepared_invoices\": [],\n \"revenue_recognitions\": [],\n \"cutover_date\": \"2023-12-25\",\n \"prior_recognized_amount\": 1,\n \"default_early_termination_fee\": 1,\n \"discount_value\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v1/contracts/actions/preview_schedule/")
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 \"custom_fields\": [\n {}\n ],\n \"memo\": \"\",\n \"date\": \"2023-12-25\",\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"company_id\": 123,\n \"customer_id\": 123,\n \"name\": \"\",\n \"currency_iso_4217_code\": \"USD\",\n \"bill_to_address\": \"\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"obligations\": [],\n \"term_id\": 123,\n \"default_ar_account_id\": 123,\n \"unbilled_receivable_account_id\": 123,\n \"contract_template_id\": 123,\n \"billing_start_date\": \"2023-12-25\",\n \"billing_frequency\": \"monthly\",\n \"billing_interval\": 1,\n \"billing_anchor_weekday\": 3,\n \"recognition_start_date\": \"2023-12-25\",\n \"recognition_frequency\": \"monthly\",\n \"recognition_interval\": 1,\n \"recognition_anchor_weekday\": 3,\n \"recognition_mode\": \"individual\",\n \"contract_attachments\": [],\n \"change_orders_attachments\": [],\n \"payment\": {\n \"type\": \"<string>\",\n \"id\": 123,\n \"body\": \"<string>\",\n \"link\": \"<string>\"\n },\n \"prepared_invoices\": [],\n \"revenue_recognitions\": [],\n \"cutover_date\": \"2023-12-25\",\n \"prior_recognized_amount\": 1,\n \"default_early_termination_fee\": 1,\n \"discount_value\": 50\n}"
response = http.request(request)
puts response.read_body{
"allocations": [
{
"position": 123,
"item_id": 123,
"quantity": "<string>",
"rate": "<string>",
"line_amount": "<string>",
"standalone_selling_price": "<string>",
"allocation_ratio": "<string>",
"allocated_amount": "<string>",
"recognition_strategy": "straight_line"
}
],
"billing_schedules": [
{
"position": 123,
"item_id": 123,
"total_amount": "<string>",
"total_tax_amount": "<string>",
"schedule": [
{
"date": "2023-12-25",
"amount": "<string>",
"tax_amount": "<string>",
"status": "scheduled"
}
]
}
],
"recognition_schedules": [
{
"position": 123,
"item_id": 123,
"allocated_amount": "<string>",
"recognition_strategy": "straight_line",
"schedule": [
{
"date": "2023-12-25",
"quantity_to_deliver": "<string>",
"amount": "<string>",
"percentage": "<string>",
"cumulative_percentage": "<string>",
"status": "scheduled"
}
],
"usage_schedule": [
{
"date": "2023-12-25",
"estimated_qty_per_delivery": "<string>",
"actual_qty_delivered": "<string>",
"estimated_amount": "<string>",
"status": "scheduled"
}
]
}
],
"summary": [
{
"date": "2023-12-25",
"invoiced_revenue": "<string>",
"recognized_revenue": "<string>",
"deferred_revenue": "<string>",
"status": "scheduled"
}
],
"metrics": {
"mrr": "<string>",
"arr": "<string>",
"amount_invoiced": "<string>",
"invoices_paid": "<string>",
"revenue_recognized": "<string>",
"unbilled_revenue": "<string>",
"unrecognized_revenue": "<string>",
"deferred_revenue": "<string>",
"total_contract_value": "<string>",
"amount_invoiced_percentage": "<string>",
"invoices_paid_percentage": "<string>",
"revenue_recognized_percentage": "<string>",
"next_invoice_date": "2023-12-25",
"total_discount_amount": "0",
"total_tax_amount": "0"
},
"renewed_end_date": "2023-12-25",
"next_renewal_date": "2023-12-25",
"cutover_date": "2023-12-25",
"prior_recognized_amount": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}Contracts
Preview Contract Schedule (v1)
Preview contract billing and revenue recognition schedules without saving data.
POST
/
public
/
v1
/
contracts
/
actions
/
preview_schedule
/
Preview Contract Schedule
curl --request POST \
--url https://api.dualentry.com/public/v1/contracts/actions/preview_schedule/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"custom_fields": [
{}
],
"memo": "",
"date": "2023-12-25",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"company_id": 123,
"customer_id": 123,
"name": "",
"currency_iso_4217_code": "USD",
"bill_to_address": "",
"billing_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"ship_to_address": "",
"shipping_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"obligations": [],
"term_id": 123,
"default_ar_account_id": 123,
"unbilled_receivable_account_id": 123,
"contract_template_id": 123,
"billing_start_date": "2023-12-25",
"billing_frequency": "monthly",
"billing_interval": 1,
"billing_anchor_weekday": 3,
"recognition_start_date": "2023-12-25",
"recognition_frequency": "monthly",
"recognition_interval": 1,
"recognition_anchor_weekday": 3,
"recognition_mode": "individual",
"contract_attachments": [],
"change_orders_attachments": [],
"payment": {
"type": "<string>",
"id": 123,
"body": "<string>",
"link": "<string>"
},
"prepared_invoices": [],
"revenue_recognitions": [],
"cutover_date": "2023-12-25",
"prior_recognized_amount": 1,
"default_early_termination_fee": 1,
"discount_value": 50
}
'import requests
url = "https://api.dualentry.com/public/v1/contracts/actions/preview_schedule/"
payload = {
"custom_fields": [{}],
"memo": "",
"date": "2023-12-25",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"company_id": 123,
"customer_id": 123,
"name": "",
"currency_iso_4217_code": "USD",
"bill_to_address": "",
"billing_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"ship_to_address": "",
"shipping_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"obligations": [],
"term_id": 123,
"default_ar_account_id": 123,
"unbilled_receivable_account_id": 123,
"contract_template_id": 123,
"billing_start_date": "2023-12-25",
"billing_frequency": "monthly",
"billing_interval": 1,
"billing_anchor_weekday": 3,
"recognition_start_date": "2023-12-25",
"recognition_frequency": "monthly",
"recognition_interval": 1,
"recognition_anchor_weekday": 3,
"recognition_mode": "individual",
"contract_attachments": [],
"change_orders_attachments": [],
"payment": {
"type": "<string>",
"id": 123,
"body": "<string>",
"link": "<string>"
},
"prepared_invoices": [],
"revenue_recognitions": [],
"cutover_date": "2023-12-25",
"prior_recognized_amount": 1,
"default_early_termination_fee": 1,
"discount_value": 50
}
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({
custom_fields: [{}],
memo: '',
date: '2023-12-25',
start_date: '2023-12-25',
end_date: '2023-12-25',
company_id: 123,
customer_id: 123,
name: '',
currency_iso_4217_code: 'USD',
bill_to_address: '',
billing_address: {
street: '<string>',
city: '<string>',
postal_code: '<string>',
state: '',
country: '',
second_line: '',
name: '<string>'
},
ship_to_address: '',
shipping_address: {
street: '<string>',
city: '<string>',
postal_code: '<string>',
state: '',
country: '',
second_line: '',
name: '<string>'
},
obligations: [],
term_id: 123,
default_ar_account_id: 123,
unbilled_receivable_account_id: 123,
contract_template_id: 123,
billing_start_date: '2023-12-25',
billing_frequency: 'monthly',
billing_interval: 1,
billing_anchor_weekday: 3,
recognition_start_date: '2023-12-25',
recognition_frequency: 'monthly',
recognition_interval: 1,
recognition_anchor_weekday: 3,
recognition_mode: 'individual',
contract_attachments: [],
change_orders_attachments: [],
payment: {type: '<string>', id: 123, body: JSON.stringify('<string>'), link: '<string>'},
prepared_invoices: [],
revenue_recognitions: [],
cutover_date: '2023-12-25',
prior_recognized_amount: 1,
default_early_termination_fee: 1,
discount_value: 50
})
};
fetch('https://api.dualentry.com/public/v1/contracts/actions/preview_schedule/', 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.dualentry.com/public/v1/contracts/actions/preview_schedule/",
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([
'custom_fields' => [
[
]
],
'memo' => '',
'date' => '2023-12-25',
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'company_id' => 123,
'customer_id' => 123,
'name' => '',
'currency_iso_4217_code' => 'USD',
'bill_to_address' => '',
'billing_address' => [
'street' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '',
'country' => '',
'second_line' => '',
'name' => '<string>'
],
'ship_to_address' => '',
'shipping_address' => [
'street' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '',
'country' => '',
'second_line' => '',
'name' => '<string>'
],
'obligations' => [
],
'term_id' => 123,
'default_ar_account_id' => 123,
'unbilled_receivable_account_id' => 123,
'contract_template_id' => 123,
'billing_start_date' => '2023-12-25',
'billing_frequency' => 'monthly',
'billing_interval' => 1,
'billing_anchor_weekday' => 3,
'recognition_start_date' => '2023-12-25',
'recognition_frequency' => 'monthly',
'recognition_interval' => 1,
'recognition_anchor_weekday' => 3,
'recognition_mode' => 'individual',
'contract_attachments' => [
],
'change_orders_attachments' => [
],
'payment' => [
'type' => '<string>',
'id' => 123,
'body' => '<string>',
'link' => '<string>'
],
'prepared_invoices' => [
],
'revenue_recognitions' => [
],
'cutover_date' => '2023-12-25',
'prior_recognized_amount' => 1,
'default_early_termination_fee' => 1,
'discount_value' => 50
]),
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://api.dualentry.com/public/v1/contracts/actions/preview_schedule/"
payload := strings.NewReader("{\n \"custom_fields\": [\n {}\n ],\n \"memo\": \"\",\n \"date\": \"2023-12-25\",\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"company_id\": 123,\n \"customer_id\": 123,\n \"name\": \"\",\n \"currency_iso_4217_code\": \"USD\",\n \"bill_to_address\": \"\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"obligations\": [],\n \"term_id\": 123,\n \"default_ar_account_id\": 123,\n \"unbilled_receivable_account_id\": 123,\n \"contract_template_id\": 123,\n \"billing_start_date\": \"2023-12-25\",\n \"billing_frequency\": \"monthly\",\n \"billing_interval\": 1,\n \"billing_anchor_weekday\": 3,\n \"recognition_start_date\": \"2023-12-25\",\n \"recognition_frequency\": \"monthly\",\n \"recognition_interval\": 1,\n \"recognition_anchor_weekday\": 3,\n \"recognition_mode\": \"individual\",\n \"contract_attachments\": [],\n \"change_orders_attachments\": [],\n \"payment\": {\n \"type\": \"<string>\",\n \"id\": 123,\n \"body\": \"<string>\",\n \"link\": \"<string>\"\n },\n \"prepared_invoices\": [],\n \"revenue_recognitions\": [],\n \"cutover_date\": \"2023-12-25\",\n \"prior_recognized_amount\": 1,\n \"default_early_termination_fee\": 1,\n \"discount_value\": 50\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://api.dualentry.com/public/v1/contracts/actions/preview_schedule/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"custom_fields\": [\n {}\n ],\n \"memo\": \"\",\n \"date\": \"2023-12-25\",\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"company_id\": 123,\n \"customer_id\": 123,\n \"name\": \"\",\n \"currency_iso_4217_code\": \"USD\",\n \"bill_to_address\": \"\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"obligations\": [],\n \"term_id\": 123,\n \"default_ar_account_id\": 123,\n \"unbilled_receivable_account_id\": 123,\n \"contract_template_id\": 123,\n \"billing_start_date\": \"2023-12-25\",\n \"billing_frequency\": \"monthly\",\n \"billing_interval\": 1,\n \"billing_anchor_weekday\": 3,\n \"recognition_start_date\": \"2023-12-25\",\n \"recognition_frequency\": \"monthly\",\n \"recognition_interval\": 1,\n \"recognition_anchor_weekday\": 3,\n \"recognition_mode\": \"individual\",\n \"contract_attachments\": [],\n \"change_orders_attachments\": [],\n \"payment\": {\n \"type\": \"<string>\",\n \"id\": 123,\n \"body\": \"<string>\",\n \"link\": \"<string>\"\n },\n \"prepared_invoices\": [],\n \"revenue_recognitions\": [],\n \"cutover_date\": \"2023-12-25\",\n \"prior_recognized_amount\": 1,\n \"default_early_termination_fee\": 1,\n \"discount_value\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v1/contracts/actions/preview_schedule/")
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 \"custom_fields\": [\n {}\n ],\n \"memo\": \"\",\n \"date\": \"2023-12-25\",\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"company_id\": 123,\n \"customer_id\": 123,\n \"name\": \"\",\n \"currency_iso_4217_code\": \"USD\",\n \"bill_to_address\": \"\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"obligations\": [],\n \"term_id\": 123,\n \"default_ar_account_id\": 123,\n \"unbilled_receivable_account_id\": 123,\n \"contract_template_id\": 123,\n \"billing_start_date\": \"2023-12-25\",\n \"billing_frequency\": \"monthly\",\n \"billing_interval\": 1,\n \"billing_anchor_weekday\": 3,\n \"recognition_start_date\": \"2023-12-25\",\n \"recognition_frequency\": \"monthly\",\n \"recognition_interval\": 1,\n \"recognition_anchor_weekday\": 3,\n \"recognition_mode\": \"individual\",\n \"contract_attachments\": [],\n \"change_orders_attachments\": [],\n \"payment\": {\n \"type\": \"<string>\",\n \"id\": 123,\n \"body\": \"<string>\",\n \"link\": \"<string>\"\n },\n \"prepared_invoices\": [],\n \"revenue_recognitions\": [],\n \"cutover_date\": \"2023-12-25\",\n \"prior_recognized_amount\": 1,\n \"default_early_termination_fee\": 1,\n \"discount_value\": 50\n}"
response = http.request(request)
puts response.read_body{
"allocations": [
{
"position": 123,
"item_id": 123,
"quantity": "<string>",
"rate": "<string>",
"line_amount": "<string>",
"standalone_selling_price": "<string>",
"allocation_ratio": "<string>",
"allocated_amount": "<string>",
"recognition_strategy": "straight_line"
}
],
"billing_schedules": [
{
"position": 123,
"item_id": 123,
"total_amount": "<string>",
"total_tax_amount": "<string>",
"schedule": [
{
"date": "2023-12-25",
"amount": "<string>",
"tax_amount": "<string>",
"status": "scheduled"
}
]
}
],
"recognition_schedules": [
{
"position": 123,
"item_id": 123,
"allocated_amount": "<string>",
"recognition_strategy": "straight_line",
"schedule": [
{
"date": "2023-12-25",
"quantity_to_deliver": "<string>",
"amount": "<string>",
"percentage": "<string>",
"cumulative_percentage": "<string>",
"status": "scheduled"
}
],
"usage_schedule": [
{
"date": "2023-12-25",
"estimated_qty_per_delivery": "<string>",
"actual_qty_delivered": "<string>",
"estimated_amount": "<string>",
"status": "scheduled"
}
]
}
],
"summary": [
{
"date": "2023-12-25",
"invoiced_revenue": "<string>",
"recognized_revenue": "<string>",
"deferred_revenue": "<string>",
"status": "scheduled"
}
],
"metrics": {
"mrr": "<string>",
"arr": "<string>",
"amount_invoiced": "<string>",
"invoices_paid": "<string>",
"revenue_recognized": "<string>",
"unbilled_revenue": "<string>",
"unrecognized_revenue": "<string>",
"deferred_revenue": "<string>",
"total_contract_value": "<string>",
"amount_invoiced_percentage": "<string>",
"invoices_paid_percentage": "<string>",
"revenue_recognized_percentage": "<string>",
"next_invoice_date": "2023-12-25",
"total_discount_amount": "0",
"total_tax_amount": "0"
},
"renewed_end_date": "2023-12-25",
"next_renewal_date": "2023-12-25",
"cutover_date": "2023-12-25",
"prior_recognized_amount": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}Headers
Optional. A unique value (a UUID works well) identifying this operation. If the request is repeated with the same key, the original response is replayed instead of the operation running again, so a retry cannot create a duplicate record. Results are replayable for 48 hours. Reusing a key with a different request body returns 422.
Maximum string length:
255Body
application/json
Available options:
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XAG, XAU, XCD, XDR, XOF, XPD, XPF, XPT, YER, ZAR, ZMW, ZWL Response
OK
Was this page helpful?