Menu

Expand

This documentation is for the SendGrid Web API v2

To access all the latest features and upcoming developments, please see our v3 API.

Rate this page:

Invoice Retrieval

Retrieve your invoice information.

Retrieve Invoice Numbers

Return an array of invoice numbers from your account.

URI Parameter Required Requirements Description
start_date No Must be in YYYY-mm-dd format. This is the start date to begin your invoice search from.
end_date No Must be in YYYY-mm-dd format and also include a start_date in the API call. This is the end date you wish to end your invoice search from.
status No Must be paid, unpaid, refunded, deferred, or canceled This is used to specify what kind of invoice you would like returned.

These are Reseller only APIs. For more information, see Reseller Overview.

Call

POST https://api.sendgrid.com/api/billing.list.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&status=pai

Response

[
  {
    "number": "2010010001"
  },
  {
    "number": "2010010002"
  }
]

Call

POST https://api.sendgrid.com/api/billing.list.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&status=pai

Response

<invoices>
   <invoice>
      <number>2010010001</number>
   </invoice>
   <invoice>
      <number>2010010002</number>
   </invoice>
</invoices>

Retrieve Invoices

Return an array of invoices.

URI Parameter Required Requirements Description
start_date No Must be in YYYY-mm-dd format. This is the start date to begin your invoice search from.
end_date No Must be in YYYY-mm-dd format and also include a start_date in the API call. This is the end date you wish to end your invoice search from.
status No Must be paid, unpaid, refunded, deferred, or canceled This is used to specify what kind of invoice you would like returned.

Call

POST https://api.sendgrid.com/api/billing.get.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&status=pai

Response

{
  "number": "2010010001",
  "package": "Basic Package",
  "credits": 10000000,
  "date_invoiced": "2010-01-01 00:00:00",
  "status": "Paid",
  "amount": 100,
  "additional_charges": 0,
  "overage": 10,
  "type": "Recurring Bill",
  "prorated": 0,
  "start_date": "2009-12-01",
  "end_date": "2009-12-31",
  "final_amount": 110
}

Call

POST https://api.sendgrid.com/api/billing.get.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&status=pai

Response

<invoices>
   <invoice>
      <number>2010010001</number>
      <package>Basic Package</package>
      <credits>10000000</credits>
      <date_invoiced>2010-01-01 00:00:00</date_invoiced>
      <status>Paid</status>
      <amount>100</amount>
      <additional_charges>0</additional_charges>
      <overage>10</overage>
      <type>Recurring Bill</type>
      <prorated>0</prorated>
      <start_date>2009-12-01</start_date>
      <end_date>2009-12-31</end_date>
      <final_amount>110</final_amount>
   </invoice>
</invoices>
Rate this page:

Need some help?

We all do sometimes. Get help now from the Twilio SendGrid Support Team.

Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.

Loading Code Sample...
        
        
        

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        thanks-feedback-gif