Revenue policies
Archive revenue policy
Archive a revenue policy so it matches no new contract; contracts already assessed under it keep their assessment.
POST
/
v1
/
accounting
/
revenue-policies
/
{id}
/
archive
Archive revenue policy
curl --request POST \
--url https://api.hyperline.co/v1/accounting/revenue-policies/{id}/archive \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperline.co/v1/accounting/revenue-policies/{id}/archive"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hyperline.co/v1/accounting/revenue-policies/{id}/archive', 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.hyperline.co/v1/accounting/revenue-policies/{id}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hyperline.co/v1/accounting/revenue-policies/{id}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.hyperline.co/v1/accounting/revenue-policies/{id}/archive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/accounting/revenue-policies/{id}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "rpol_3fJ8kZx1Lq9a2B",
"ledger_id": "led_8Hq2nZ0kLm4x1P",
"name": "Enterprise contracts",
"description": "<string>",
"priority": 10,
"match_conditions": {
"customer_ids": [
"<string>"
],
"currencies": [
"EUR"
],
"countries": [
"FR"
],
"product_ids": [
"<string>"
],
"customer_segment_ids": [
"seg_7Gk2Lm9xQ1z4Ha"
],
"custom_property_filters": [
{
"custom_field_id": "cfi_9xQ1z4Ha7Gk2Lm",
"values": [
"enterprise"
]
}
]
},
"published_version": {
"id": "rpv_7Gk2Lm9xQ1z4Ha",
"version": 1,
"status": "draft",
"effective_from": "2026-01-01T00:00:00Z",
"config": {
"eligibility": {
"collectability": "assumed"
},
"obligations": {
"mappings": [
{
"key": "platform",
"name": "<string>",
"kind": "service_period",
"treatment": "allocated",
"granularity": "day",
"product_ids": [
"<string>"
]
}
],
"unmapped_products": "own_obligation"
},
"allocation": {
"method": "relative_ssp",
"catalog_price_fallback": true,
"discounts": "proportional"
},
"recognition": {
"consumption": {
"breakage": "recognize_at_expiry"
},
"default_accounts": {
"deferred_revenue_ledger_account_id": "<string>",
"unbilled_revenue_ledger_account_id": "<string>"
}
},
"review": {
"mode": "exceptions_and_overrides"
},
"modifications": {
"amendment": "prospective",
"cancellation": "prospective"
}
},
"published_at": "2024-12-20T16:04:11Z",
"published_by_user_id": "<string>",
"created_at": "2024-12-20T16:04:11Z"
},
"draft_version": {
"id": "rpv_7Gk2Lm9xQ1z4Ha",
"version": 1,
"status": "draft",
"effective_from": "2026-01-01T00:00:00Z",
"config": {
"eligibility": {
"collectability": "assumed"
},
"obligations": {
"mappings": [
{
"key": "platform",
"name": "<string>",
"kind": "service_period",
"treatment": "allocated",
"granularity": "day",
"product_ids": [
"<string>"
]
}
],
"unmapped_products": "own_obligation"
},
"allocation": {
"method": "relative_ssp",
"catalog_price_fallback": true,
"discounts": "proportional"
},
"recognition": {
"consumption": {
"breakage": "recognize_at_expiry"
},
"default_accounts": {
"deferred_revenue_ledger_account_id": "<string>",
"unbilled_revenue_ledger_account_id": "<string>"
}
},
"review": {
"mode": "exceptions_and_overrides"
},
"modifications": {
"amendment": "prospective",
"cancellation": "prospective"
}
},
"published_at": "2024-12-20T16:04:11Z",
"published_by_user_id": "<string>",
"created_at": "2024-12-20T16:04:11Z"
},
"assessment_count": 123,
"archived_at": "2024-12-20T16:04:11Z",
"created_at": "2024-12-20T16:04:11Z",
"versions": [
{
"id": "rpv_7Gk2Lm9xQ1z4Ha",
"version": 1,
"status": "draft",
"effective_from": "2026-01-01T00:00:00Z",
"config": {
"eligibility": {
"collectability": "assumed"
},
"obligations": {
"mappings": [
{
"key": "platform",
"name": "<string>",
"kind": "service_period",
"treatment": "allocated",
"granularity": "day",
"product_ids": [
"<string>"
]
}
],
"unmapped_products": "own_obligation"
},
"allocation": {
"method": "relative_ssp",
"catalog_price_fallback": true,
"discounts": "proportional"
},
"recognition": {
"consumption": {
"breakage": "recognize_at_expiry"
},
"default_accounts": {
"deferred_revenue_ledger_account_id": "<string>",
"unbilled_revenue_ledger_account_id": "<string>"
}
},
"review": {
"mode": "exceptions_and_overrides"
},
"modifications": {
"amendment": "prospective",
"cancellation": "prospective"
}
},
"published_at": "2024-12-20T16:04:11Z",
"published_by_user_id": "<string>",
"created_at": "2024-12-20T16:04:11Z"
}
]
}{
"message": "<string>"
}Authorizations
Response
Was this page helpful?
⌘I
Archive revenue policy
curl --request POST \
--url https://api.hyperline.co/v1/accounting/revenue-policies/{id}/archive \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperline.co/v1/accounting/revenue-policies/{id}/archive"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hyperline.co/v1/accounting/revenue-policies/{id}/archive', 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.hyperline.co/v1/accounting/revenue-policies/{id}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hyperline.co/v1/accounting/revenue-policies/{id}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.hyperline.co/v1/accounting/revenue-policies/{id}/archive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/accounting/revenue-policies/{id}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "rpol_3fJ8kZx1Lq9a2B",
"ledger_id": "led_8Hq2nZ0kLm4x1P",
"name": "Enterprise contracts",
"description": "<string>",
"priority": 10,
"match_conditions": {
"customer_ids": [
"<string>"
],
"currencies": [
"EUR"
],
"countries": [
"FR"
],
"product_ids": [
"<string>"
],
"customer_segment_ids": [
"seg_7Gk2Lm9xQ1z4Ha"
],
"custom_property_filters": [
{
"custom_field_id": "cfi_9xQ1z4Ha7Gk2Lm",
"values": [
"enterprise"
]
}
]
},
"published_version": {
"id": "rpv_7Gk2Lm9xQ1z4Ha",
"version": 1,
"status": "draft",
"effective_from": "2026-01-01T00:00:00Z",
"config": {
"eligibility": {
"collectability": "assumed"
},
"obligations": {
"mappings": [
{
"key": "platform",
"name": "<string>",
"kind": "service_period",
"treatment": "allocated",
"granularity": "day",
"product_ids": [
"<string>"
]
}
],
"unmapped_products": "own_obligation"
},
"allocation": {
"method": "relative_ssp",
"catalog_price_fallback": true,
"discounts": "proportional"
},
"recognition": {
"consumption": {
"breakage": "recognize_at_expiry"
},
"default_accounts": {
"deferred_revenue_ledger_account_id": "<string>",
"unbilled_revenue_ledger_account_id": "<string>"
}
},
"review": {
"mode": "exceptions_and_overrides"
},
"modifications": {
"amendment": "prospective",
"cancellation": "prospective"
}
},
"published_at": "2024-12-20T16:04:11Z",
"published_by_user_id": "<string>",
"created_at": "2024-12-20T16:04:11Z"
},
"draft_version": {
"id": "rpv_7Gk2Lm9xQ1z4Ha",
"version": 1,
"status": "draft",
"effective_from": "2026-01-01T00:00:00Z",
"config": {
"eligibility": {
"collectability": "assumed"
},
"obligations": {
"mappings": [
{
"key": "platform",
"name": "<string>",
"kind": "service_period",
"treatment": "allocated",
"granularity": "day",
"product_ids": [
"<string>"
]
}
],
"unmapped_products": "own_obligation"
},
"allocation": {
"method": "relative_ssp",
"catalog_price_fallback": true,
"discounts": "proportional"
},
"recognition": {
"consumption": {
"breakage": "recognize_at_expiry"
},
"default_accounts": {
"deferred_revenue_ledger_account_id": "<string>",
"unbilled_revenue_ledger_account_id": "<string>"
}
},
"review": {
"mode": "exceptions_and_overrides"
},
"modifications": {
"amendment": "prospective",
"cancellation": "prospective"
}
},
"published_at": "2024-12-20T16:04:11Z",
"published_by_user_id": "<string>",
"created_at": "2024-12-20T16:04:11Z"
},
"assessment_count": 123,
"archived_at": "2024-12-20T16:04:11Z",
"created_at": "2024-12-20T16:04:11Z",
"versions": [
{
"id": "rpv_7Gk2Lm9xQ1z4Ha",
"version": 1,
"status": "draft",
"effective_from": "2026-01-01T00:00:00Z",
"config": {
"eligibility": {
"collectability": "assumed"
},
"obligations": {
"mappings": [
{
"key": "platform",
"name": "<string>",
"kind": "service_period",
"treatment": "allocated",
"granularity": "day",
"product_ids": [
"<string>"
]
}
],
"unmapped_products": "own_obligation"
},
"allocation": {
"method": "relative_ssp",
"catalog_price_fallback": true,
"discounts": "proportional"
},
"recognition": {
"consumption": {
"breakage": "recognize_at_expiry"
},
"default_accounts": {
"deferred_revenue_ledger_account_id": "<string>",
"unbilled_revenue_ledger_account_id": "<string>"
}
},
"review": {
"mode": "exceptions_and_overrides"
},
"modifications": {
"amendment": "prospective",
"cancellation": "prospective"
}
},
"published_at": "2024-12-20T16:04:11Z",
"published_by_user_id": "<string>",
"created_at": "2024-12-20T16:04:11Z"
}
]
}{
"message": "<string>"
}
