Navigation

Get One Organization Invoice

The Atlas API uses HTTP Digest Authentication. Provide your Atlas username and API key as the username and password when constructing the HTTP request.

For complete documentation on configuring API access for an Atlas project, see Configure Atlas API Access.

Base URL: https://cloud.mongodb.com/api/atlas/v1.0

Resource

GET /orgs/{ORG-ID}/invoices/{INVOICE-ID}

Request Path Parameters

Name Type Description
ORG-ID string Unique identifier of the organization.
INVOICE-ID string Unique identifier of the invoice. Charges are typically posted the next day.

Request Query Parameters

This endpoint may use any of the HTTP request query parameters available to all Atlas API resources. These are all optional.

Name Type Description Default
pretty boolean Display response in a prettyprint format. false
envelope boolean Specifies whether or not to wrap the response in an envelope. false

Request Body Parameters

This endpoint does not use HTTP request body parameters.

Response

If you set the query element envelope to true, the response is wrapped by the content object.

The HTTP response returns a JSON document that includes the following objects:

Name Type Description
amountBilledCents number Amount billed in this invoice, calculated as subtotalCents + salesTaxCents - startingBalanceCents
amountPaidCents number Amount paid for this invoice.
created string Timestamp in ISO 8601 date and time format in UTC when this invoice was created.
creditsCents number Amount credited by MongoDB, in USD cents.
endDate string Timestamp in ISO 8601 date and time format in UTC when the billing period for this invoice ended.
groupId string Unique identifier of the project with which the invoice is associated. Does not appear on all invoices.
id string Unique identifier for this invoice.
lineItems object array

Line items in the invoice. This information is also found in the Usage Details section of the Invoice page in the Atlas UI.

Each object in the array includes the following fields:

Item Description
clusterName The name of the cluster that incurred the charge
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 Amount discounted, in USD cents. Displays when applicable.
groupId ID of the project with which the line item is associated.
note Note regarding the line item.
percentDiscount Percent of discount. Displays when applicable.
quantity Number of units of the line item (e.g. GB, hours, etc.).
sku Description of the line item. This could be the instance type, a support charge, advanced security, etc.
startDate Timestamp in ISO 8601 date and time format in UTC when the period for which the line item applies began.
stitchAppName Name of the MongoDB Stitch app associated with the line item.
totalPriceCents

Total price for the line item, in USD cents. Equal to

 unitPriceDollars * quantity * 100
unitPriceDollars Cost of the item, in dollars.
links object array One or more links to sub-resources and/or related resources. The relation-types between URLs are explained in the Web Linking Specification.
orgId string Unique identifier for the organization that received this invoice.
payments object array

Payments applied to the invoice. Objects in the payments array include the following fields:

Field Description
amountBilledCents The amount of the invoice, in USD cents.
amountPaidCents The amount that the customer paid, in USD cents.
created Timestamp in ISO 8601 date and time format in UTC of the date the payment was recorded.
id Unique identifier of the payment.
salesTaxCents Amount of sales tax paid, in USD cents.
statusName

State of the payment.

Status Description
CANCELLED The payment has been cancelled.
FAILED The attempt to charge the credit card failed.
FORGIVEN The payment was created, but was subsequently forgiven.
NEW The payment has been created, but no attempt has been made to charge the credit card.
PAID The payment was successful.
subtotalCents Sum of all positive invoice line items, in USD cents.
updated Timestamp in ISO 8601 date and time format in UTC that the object was last updated.
refunds object array

Refunds issued for the invoice. Objects in the refunds array include the following fields:

Field Description
amountCents The amount of the refund, in USD cents.
created Timestamp in ISO 8601 date and time format in UTC of the date the refund was recorded.
reason Reason for the refund.
paymentId Unique identifier of the payment.
salesTaxCents number Amount of taxes levied on subtotalCents.
startDate string Timestamp in ISO 8601 date and time format in UTC of the starting date for this invoice.
statusName string

State of this invoice. Accepted values are:

Status Description
CLOSED All charges for the subscription cycle have been finalized, the balance is more than zero, and the customer has not been charged yet.
FAILED An attempt to charge the credit card for the amount due failed.
FORGIVEN The customer has been charged, but the charge has been forgiven.
FREE The amount turned out to be zero, so the customer is not charged.
PAID The funds have been transferred to MongoDB, Inc.
PENDING Includes charges for the current subscription cycle. A customer should never have more than one invoice in this state.
PREPAID The customer is on a prepaid plan, so the customer is not charged.
subtotalCents number Sum of all positive invoice line items in USD cents.
updated string Timestamp in ISO 8601 date and time format in UTC when the invoice was last updated.

Example Request

curl --user "{USERNAME}:{APIKEY}" --digest \
 --header "Accept: application/json" \
 --include \
 --request GET "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/invoices/{INVOICE-ID}"

Example Response

Note

In the following sample response, the lineItems array has been truncated for ease of viewing.

{
  "amountBilledCents" : 240,
  "amountPaidCents" : 240,
  "created" : "2018-04-01T06:14:31Z",
  "endDate" : "2018-05-01T00:00:00Z",
  "id" : "{INVOICE-ID}",
  "lineItems" : [ {
    "clusterName" : "{CLUSTER-NAME}",
    "created" : "2018-05-01T04:05:31Z",
    "endDate" : "2018-05-01T00:00:00Z",
    "groupId" : "{PROJECT-ID}",
    "quantity" : 72.0,
    "sku" : "ATLAS_INSTANCE_M0",
    "startDate" : "2018-04-30T00:00:00Z",
    "totalPriceCents" : 0,
    "unitPriceDollars" : 0.0
  }, {
    "clusterName" : "{CLUSTER-NAME}",
    "created" : "2018-04-30T04:05:19Z",
    "endDate" : "2018-04-30T00:00:00Z",
    "groupId" : "{PROJECT-ID}",
    "quantity" : 72.0,
    "sku" : "ATLAS_INSTANCE_M0",
    "startDate" : "2018-04-29T00:00:00Z",
    "totalPriceCents" : 0,
    "unitPriceDollars" : 0.0
  },
  ... ,
  {
    "clusterName" : "{CLUSTER-NAME}",
    "created" : "2018-04-02T06:05:07Z",
    "endDate" : "2018-04-02T00:00:00Z",
    "groupId" : "{PROJECT-ID}",
    "quantity" : 72.0,
    "sku" : "ATLAS_INSTANCE_M0",
    "startDate" : "2018-04-01T00:00:00Z",
    "totalPriceCents" : 0,
    "unitPriceDollars" : 0.0
  } ],
  "links" : [ {
    "href" : "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}",
    "rel" : "http://mms.mongodb.com/org"
  }, {
    "href" : "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/invoices/{INVOICE-ID}",
    "rel" : "self"
  } ],
  "orgId" : "{ORG-ID}",
  "payments" : [ {
    "amountBilledCents" : 240,
    "amountPaidCents" : 240,
    "created" : "2018-05-01T04:05:14Z",
    "id" : "{PAYMENT-ID}",
    "salesTaxCents" : 19,
    "statusName" : "PAID",
    "subtotalCents" : 221,
    "updated" : "2018-05-01T07:00:46Z"
  } ],
  "refunds" : [ ],
  "salesTaxCents" : 19,
  "startDate" : "2018-04-01T00:00:00Z",
  "startingBalanceCents" : 0,
  "statusName" : "PAID",
  "subtotalCents" : 221,
  "updated" : "2018-05-01T07:00:46Z"