对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。

获取组织的待处理发票

基本 URL: https://cloud.mongodb.com/api/public/v1.0

GET /orgs/{ORG-ID}/invoices/pending
名称
类型
说明

ORG-ID

字符串

组织的唯一标识符。

以下查询参数为可选参数:

名称
类型
必要性
说明
默认

pageNum

数字

Optional

从一开始的整数,用于返回结果的一部分。

1

itemsPerPage

数字

Optional

每页要返回的项目数,最多 500 个。

100

pretty

布尔

Optional

false

envelope

布尔

Optional

指示是否将响应包装在信封中的标志。

某些 API 客户端无法访问 HTTP 响应标头或状态代码。要修复此问题,在查询中设置 envelope : true。

对于返回结果列表的端点,content 对象是一个信封。Cloud Manager 将 status 字段添加到响应正文。

false

backupJobsEnabledOnly

布尔

Optional

指示是否从响应中排除未启用备份数据库的守护进程的标志。 将其设置为false以包含将backupJobsEnabled标志设置为false的守护进程配置。

true

此端点不使用 HTTP 请求正文参数。

如果将查询元素envelope设置为true ,则响应将由content对象包装。

HTTP 响应返回一个 JSON document,其中包含以下对象:

名称
类型
说明

amountBilledCents

数字

此发票的账单金额,计算公式为subtotalCents + salesTaxCents - startupBalanceCents

amountPaidCents

数字

为此发票支付的金额。

created

字符串

Timestamp in ISO 8601 date and time format in UTC when this invoice was created.

creditsCents

数字

MongoDB 存入的金额,以美分为单位。

endDate

字符串

Timestamp in ISO 8601 date and time format in UTC when the billing period for this invoice ended.

groupId

字符串

与发票关联的项目的唯一标识符。 不会出现在所有发票上。

id

字符串

此发票的唯一标识符。

lineItems

对象数组

发票中的行项目。 此信息也可在Cloud Manager用户界面“发票”页面的Usage Details部分找到。

大量中的每个对象都包含以下字段:

  • clusterName: 产生费用的集群名称。

  • created: Timestamp in ISO 8601 date and time format in UTC when the line item was posted to the invoice.

  • endDate: Timestamp in ISO 8601 date and time format in UTC when the period for which the line item applies ended.

  • discountCents: 折扣金额,以美分计算。在适用时显示。

  • groupId: 行项所关联的项目 ID。

  • note: 关于行项目的备注。

  • percentDiscount: 折扣百分比。在适用时显示。

  • quantity: 行项的单位数量(如 GB 或小时)。

  • replicaSetName: 行项所关联的副本集的名称。

  • sku: 明细项目的说明。这可能是实例类型、支持费用、高级安全等等。

  • startDate: Timestamp in ISO 8601 date and time format in UTC when the period for which the line item applies began.

  • totalPriceCents: 行项的总价格,以美分计。等于

    unitPriceDollars * quantity * 100
  • unitPriceDollars: 商品的费用,以美元计算。

links

对象数组

指向子资源和/或相关资源的一个或多个链接。URL 之间的关系类型在 Web 链接规范 中进行了解释。

orgId

字符串

收到此发票的组织的唯一标识符。

payments

对象数组

应用于发票的付款。 payments大量中的对象包括以下字段:

  • amountBilledCents: 发票金额,以美分表示。

  • amountPaidCents: 客户数支付的金额,以美元美分计。

  • created: Timestamp in ISO 8601 date and time format in UTC of the date the payment was recorded.

  • id: 付款的唯一标识符。

  • salesTaxCents:已支付的销售税金额,以美元美分计。

  • statusName: 支付状态。

    • CANCELLED: 付款已取消。

    • FAILED: 尝试对信用卡收费失败。

    • FORGIVEN: 支付已创建,但随后被免除。

    • NEW: 已创建付款,但尚未尝试向信用卡收费。

    • PAID: 付款已成功。

  • subtotalCents: 所有正值发票明细项的总金额,以美分计。

  • updated: Timestamp in ISO 8601 date and time format in UTC that the object was last updated.

refunds

对象数组

发票退款。 refunds数组中的对象包括以下字段:

  • amountCents: 退款金额,以美分计。

  • created: Timestamp in ISO 8601 date and time format in UTC of the date the refund was recorded.

  • reason: 退款原因。

  • paymentId: 付款的唯一标识符。

salesTaxCents

数字

对subtotalCents征收的税额。

startDate

字符串

Timestamp in ISO 8601 date and time format in UTC of the starting date for this invoice.

statusName

字符串

此发票的状态。 接受的值为:

  • CLOSED: 订阅周期的所有费用均已确定,余额大于零,且尚未向客户数收费。

  • FAILED: 尝试通过信用卡收取应付金额失败。

  • FORGIVEN: 已向客户数收取费用,但该费用已被免除。

  • FREE: 结果金额为零,因此客户数无需付费。

  • PAID: 资金已转移至 MongoDB, Inc.

  • PENDING: 包括当前订阅周期的费用。一个客户在这种状态下不应拥有多张发票。

  • PREPAID: 客户数使用的是预付套餐,因此不会对客户数收费。

subtotalCents

数字

所有正发票行项目的总和(以美元美分为单位)。

updated

字符串

Timestamp in ISO 8601 date and time format in UTC when the invoice was last updated.

curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --include \ --request GET "https://cloud.mongodb.com/api/public/v1.0/orgs/{ORG-ID}/invoices/pending

注意

在以下示例响应中,为便于查看, lineItems数组已被截断。

{ "amountBilledCents" : 0, "amountPaidCents" : 0, "created" : "2018-06-01T04:05:10Z", "endDate" : "2018-07-01T00:00:00Z", "id" : "{INVOICE-ID}", "lineItems" : [ { "clusterName" : "{CLUSTER-NAME}", "created" : "2018-06-19T04:06:14Z", "endDate" : "2018-06-19T00:00:00Z", "groupId" : "{PROJECT-ID}", "quantity" : 12.0, "replicaSetName": "rs0", "sku" : "CLOUD_MANAGER_BASIC", "startDate" : "2018-06-18T00:00:00Z", "totalPriceCents" : 31, "unitPriceDollars" : 0.026 }, ... , { "clusterName" : "{CLUSTER-NAME}", "created" : "2018-06-19T04:06:14Z", "endDate" : "2018-06-19T00:00:00Z", "groupId" : "{PROJECT-ID}", "quantity" : 1.0, "replicaSetName": "rs0", "sku" : "BACKUP_STORAGE", "startDate" : "2018-06-18T00:00:00Z", "totalPriceCents" : 4, "unitPriceDollars" : 0.0351 } ], "links" : [ { "href" : "https://cloud-dev.mongodb.com/api/public/v1.0/orgs/{ORG-ID}", "rel" : "http://mms.mongodb.com/org" }, { "href" : "https://cloud-dev.mongodb.com/api/public/v1.0/orgs/{ORG-ID}/invoices/{INVOICE-ID}", "rel" : "self" } ], "orgId" : "{ORG-ID}", "payments" : [ ], "refunds" : [ ], "salesTaxCents" : 0, "startDate" : "2018-06-01T00:00:00Z", "startingBalanceCents" : 0, "statusName" : "PENDING", "subtotalCents" : 0, "updated" : "2018-06-01T04:05:10Z"}