返回MongoDB向指定组织开具的所有发票。此列表包括所有发票,无论发票状态如何。要使用此资源,请求的服务帐户或API密钥必须具有“组织计费查看者”、“组织计费管理员”或“组织所有者”角色。如果您有跨组织设置,并且具有“组织计费管理员”或“组织所有者”角色,则可以查看链接的发票。要计算发票的总欠金额 - 将每张发票的总欠金额相加。它可以计算为发票中包含的每笔付款的欠款金额之和。要计算付款的欠款金额 - 使用公式 totalBilledCents * unitPrice + salesTax - startingBalanceCents。
路径参数
-
唯一的 24-十六进制数字 string,用于标识包含项目的组织。使用
/orgs终结点检索经过身份验证的用户访问权限检索的所有组织。格式应符合以下模式:
^([a-f0-9]{24})$。
查询参数
-
指示应用程序是否将响应包装在
envelopeJSON 对象中的标志。某些 API 客户端无法访问 HTTP 响应标头或状态代码。要修复此问题,请在查询中设置 Envelope=true。返回结果列表的端点将结果对象用作 envelope。应用程序将状态参数添加到响应正文中。默认值为
false。 -
指示响应是否返回响应中的列项总数 (
totalCount) 的标志。默认值为
true。 -
响应每页返回的列项数。
最小值为
1,最大值为500。默认值为100。 -
显示响应返回的当前总对象集的页面编号。
最小值为
1。默认值为1。 -
指示响应正文是否应采用 prettyprint 格式的标记。
默认值为
false。Prettyprint -
标志,用于指示是否在
linkedInvoices字段中返回链接的发票。默认值为
true。 -
要检索的发票的状态。省略返回所有状态的发票。
取值为
PENDING、CLOSED、FORGIVEN、FAILED、PAID、FREE、PREPAID或INVOICED。 -
检索
startDates大于或等于fromDate的发票。如果省略,发票返回时间最早可追溯至startDate。 -
检索
endDates小于或等于toDate的发票。如果省略,发票返回时间将进一步延长至最晚endDate。 -
用于对返回的发票进行排序的字段。与
orderBy参数结合使用可控制结果的顺序。值为
START_DATE或END_DATE。默认值为END_DATE。 -
用于对返回的发票进行排序的字段。与
sortBy参数结合使用可控制结果的顺序。值为
desc或asc。默认值为desc。
curl \
--request GET 'https://cloud.mongodb.com/api/atlas/v1.0/orgs/4888442a3354817a7320eb61/invoices' \
--header "Authorization: Bearer $ACCESS_TOKEN"
{
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"results": [
{
"amountBilledCents": 42,
"amountPaidCents": 42,
"created": "2026-05-04T09:42:00Z",
"creditsCents": 42,
"endDate": "2026-05-04T09:42:00Z",
"id": "32b6e34b3d91647abb20e7b8",
"linkedInvoices": [
{}
],
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"salesTaxCents": 42,
"startDate": "2026-05-04T09:42:00Z",
"startingBalanceCents": 42,
"statusName": "PENDING",
"subtotalCents": 42,
"updated": "2026-05-04T09:42:00Z"
}
],
"totalCount": 42
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"error": 404,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"reason": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}