import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/reconciliation"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/reconciliation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/cloud-cost/reconciliation \
--header 'Authorization: Bearer <token>'{
"month": "<string>",
"month_closed": true,
"period_hours": 123,
"generated_at": "2023-11-07T05:31:56Z",
"credentials": [
{
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"credential_name": "<string>",
"credential_outside_projects": true,
"provider": "<string>",
"state": "absent",
"imports": [
{
"source": "api",
"source_document_id": "<string>",
"state": "complete",
"lines_state": "complete",
"reason": "<string>",
"currency": "<string>",
"line_count": 123,
"attempted_at": "2023-11-07T05:31:56Z",
"succeeded_at": "2023-11-07T05:31:56Z",
"counted": true
}
],
"currency": "<string>",
"currencies_mixed": true,
"invoice_minor": 123,
"tax_minor": 123,
"credit_minor": 123,
"matched_minor": 123,
"unmatched_minor": 123,
"estimate_minor": 123,
"estimate_complete": true,
"estimate_fx": {
"from": "<string>",
"to": "<string>",
"rate": 123,
"rate_from_usd": 123,
"as_of": "2023-11-07T05:31:56Z",
"basis": "captured"
},
"difference_pct": 123,
"difference_reason": "<string>",
"difference_coverage": {
"clusters_covered": 123,
"clusters_named": 123,
"matched_minor": 123,
"estimate_minor": 123,
"invoice_share_pct": 123,
"hours_share_pct": 123
},
"unplaced_priced_minor": 123,
"difference_caveat": "<string>",
"clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"invoice_minor": 123,
"line_count": 123,
"estimate_minor": 123,
"metered_hours": 123,
"estimated_hours": 123,
"lifetime_hours": 123,
"period_hours": 123,
"in_coverage": true
}
],
"unmatched_lines": [
{
"line_key": "<string>",
"external_id": "<string>",
"external_id_kind": "<string>",
"category": "<string>",
"description": "<string>",
"amount_minor": 123,
"currency": "<string>"
}
],
"unmatched_line_count": 123,
"unmatched_truncated": true,
"invoice_withheld": true,
"same_invoice_as": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"scope": {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_name": "<string>",
"all_projects": true,
"partial": true
}
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Get the provider invoice reconciliation for a month
What each cloud credential’s provider billed for a month against what the metering estimated for the same clusters. Lines stay in the provider’s currency; the estimate is converted at the stated rate. A credential with no imported document is absent, a failed import says so, a line nothing places on a cluster is listed with its amount, and a difference is stated only when the provider’s figures are final and the clusters the metering fully covered hold at least half of the invoice; it is over those clusters, never the whole invoice, and difference_coverage says what share of the invoice and of the hours they hold. A caller limited to some projects (a token pinned to a project, or a member who only holds roles on projects) is still shown a credential outside those projects whose invoice bills one of its clusters, since that cost is its own, but not which credential it is (credential_outside_projects). Bearer-PAT twin of the browser route of the same name under /org.
import requests
url = "https://platform.ankra.app/api/v1/org/cloud-cost/reconciliation"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/cloud-cost/reconciliation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/cloud-cost/reconciliation \
--header 'Authorization: Bearer <token>'{
"month": "<string>",
"month_closed": true,
"period_hours": 123,
"generated_at": "2023-11-07T05:31:56Z",
"credentials": [
{
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"credential_name": "<string>",
"credential_outside_projects": true,
"provider": "<string>",
"state": "absent",
"imports": [
{
"source": "api",
"source_document_id": "<string>",
"state": "complete",
"lines_state": "complete",
"reason": "<string>",
"currency": "<string>",
"line_count": 123,
"attempted_at": "2023-11-07T05:31:56Z",
"succeeded_at": "2023-11-07T05:31:56Z",
"counted": true
}
],
"currency": "<string>",
"currencies_mixed": true,
"invoice_minor": 123,
"tax_minor": 123,
"credit_minor": 123,
"matched_minor": 123,
"unmatched_minor": 123,
"estimate_minor": 123,
"estimate_complete": true,
"estimate_fx": {
"from": "<string>",
"to": "<string>",
"rate": 123,
"rate_from_usd": 123,
"as_of": "2023-11-07T05:31:56Z",
"basis": "captured"
},
"difference_pct": 123,
"difference_reason": "<string>",
"difference_coverage": {
"clusters_covered": 123,
"clusters_named": 123,
"matched_minor": 123,
"estimate_minor": 123,
"invoice_share_pct": 123,
"hours_share_pct": 123
},
"unplaced_priced_minor": 123,
"difference_caveat": "<string>",
"clusters": [
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"invoice_minor": 123,
"line_count": 123,
"estimate_minor": 123,
"metered_hours": 123,
"estimated_hours": 123,
"lifetime_hours": 123,
"period_hours": 123,
"in_coverage": true
}
],
"unmatched_lines": [
{
"line_key": "<string>",
"external_id": "<string>",
"external_id_kind": "<string>",
"category": "<string>",
"description": "<string>",
"amount_minor": 123,
"currency": "<string>"
}
],
"unmatched_line_count": 123,
"unmatched_truncated": true,
"invoice_withheld": true,
"same_invoice_as": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"scope": {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_name": "<string>",
"all_projects": true,
"partial": true
}
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Authorizations
Query Parameters
Response
Successful response
Per cloud credential and UTC month, what the provider billed (imported invoice lines, in the provider's own currency) against what the metering estimated for the clusters those lines are placed on. Nothing unknown reads as agreement.