Retorna uma fatura que o MongoDB emitiu para a organização especificada. Uma string única de 24 dígitos hexadecimais que identifica a fatura. Você pode optar por receber esta fatura em formato JSON ou CSV. Para usar esse recurso, a conta de serviço ou a chave de API solicitante deve ter a função de visualizador de faturamento da organização, administrador de faturamento da organização ou proprietário da organização. Se você tiver uma configuração de organização cruzada, você pode consultar uma fatura vinculada se tiver a função Administrador de faturamento da organização ou Proprietário da organização. Para calcular o valor total devido da fatura, some o valor total devido de cada pagamento incluído na fatura. Para calcular o valor devido do pagamento, use a fórmula totalBilledCents * unitPrice + salesTax - StartingBalanceCents.
parâmetros de caminho
-
String exclusiva de 24dígitos hexadecimais que identifica a organização que contém seus projetos. Use o endpoint /orgs para recuperar todas as organizações às quais o usuário autenticado tem acesso.
O formato deve corresponder ao seguinte padrão:
^([a-f0-9]{24})$. -
String única de 24 dígitos hexadecimais que identifica a fatura enviada à organização especificada. Normalmente, as cobranças são publicadas no dia seguinte.
O formato deve corresponder ao seguinte padrão:
^([a-f0-9]{24})$.
parâmetros de query
-
Sinalizador que indica se o aplicativo empacota a resposta em um objeto JSON
envelope. Alguns clientes de API não podem acessar os cabeçalhos de resposta HTTP ou o código de status. Para corrigir isso, defina envelope=true na consulta. Os endpoints que retornam uma lista de resultados usam o objeto de resultados como um envelope. O aplicativo adiciona o parâmetro de status ao corpo da resposta.O valor padrão é
false. -
Sinalizador que indica se o corpo da resposta deve estar no formato prettyprint.
O valor padrão é
false.Prettyprint
atlas api invoices getInvoice --help
import (
"os"
"context"
"log"
sdk "go.mongodb.org/atlas-sdk/v20230101001/admin"
)
func main() {
ctx := context.Background()
clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")
// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth
client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))
if err != nil {
log.Fatalf("Error: %v", err)
}
params = &sdk.GetOrgInvoiceApiParams{}
sdkResp, httpResp, err := client.InvoicesApi.
GetOrgInvoiceWithParams(ctx, params).
Execute()
}
curl --include --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/vnd.atlas.2023-01-01+json" \
-X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/{invoiceId}?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
--digest --include \
--header "Accept: application/vnd.atlas.2023-01-01+json" \
-X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/{invoiceId}?pretty=true"
Invoice Number,666acb8787ba43606905dcae,
Billing Period,"June 1, 2024 - July 1, 2024",
Organization Name,Test 2,
Organization ID,666acb8787ba43606905dcac,
Date,Usage Date,Description,Note,Organization Name,Organization ID,Project,Project ID,SKU,Region,Cluster,Replica Set,Config Server,Application,Unit,Unit Price,Quantity,Discount Percent,Amount
{
"amountBilledCents": 42,
"amountPaidCents": 42,
"created": "2026-05-04T09:42:00Z",
"creditsCents": 42,
"endDate": "2026-05-04T09:42:00Z",
"id": "32b6e34b3d91647abb20e7b8",
"lineItems": [
{
"clusterName": "string",
"created": "2026-05-04T09:42:00Z",
"discountCents": 42,
"endDate": "2026-05-04T09:42:00Z",
"groupId": "32b6e34b3d91647abb20e7b8",
"groupName": "string",
"note": "string",
"percentDiscount": 42.0,
"quantity": 42.0,
"sku": "string",
"startDate": "2026-05-04T09:42:00Z",
"stitchAppName": "string",
"tags": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
},
"tierLowerBound": 42.0,
"tierUpperBound": 42.0,
"totalPriceCents": 42,
"unit": "string",
"unitPriceDollars": 42.0
}
],
"linkedInvoices": [
{}
],
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"payments": [
{
"amountBilledCents": 42,
"amountPaidCents": 42,
"created": "2026-05-04T09:42:00Z",
"currency": "string",
"id": "32b6e34b3d91647abb20e7b8",
"salesTaxCents": 42,
"statusName": "NEW",
"subtotalCents": 42,
"unitPrice": "string",
"updated": "2026-05-04T09:42:00Z"
}
],
"refunds": [
{
"amountCents": 42,
"created": "2026-05-04T09:42:00Z",
"paymentId": "32b6e34b3d91647abb20e7b8",
"reason": "string"
}
],
"salesTaxCents": 42,
"startDate": "2026-05-04T09:42:00Z",
"startingBalanceCents": 42,
"statusName": "PENDING",
"subtotalCents": 42,
"updated": "2026-05-04T09:42:00Z"
}
{
"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"
}