Visual Basic 6.0 Stripe: Retrieve an Invoice

Back to Index

Retrieves the invoice with the given ID.


CURL Command

curl \

Visual Basic 6.0 Example

Dim rest As New ChilkatRest
Dim success As Long

'  URL:
Dim bTls As Long
bTls = 1
Dim port As Long
port = 443
Dim bAutoReconnect As Long
bAutoReconnect = 1
success = rest.Connect("",port,bTls,bAutoReconnect)
If (success <> 1) Then
    Debug.Print "ConnectFailReason: " & rest.ConnectFailReason
    Debug.Print rest.LastErrorText
    Exit Sub
End If

success = rest.SetAuthBasic("STRIPE_SECRET_KEY","")

Dim sbResponseBody As New ChilkatStringBuilder
success = rest.FullRequestNoBodySb("GET","/v1/invoices/in_1BnETLGswQrCoh0XR7p1RCtV",sbResponseBody)
If (success <> 1) Then
    Debug.Print rest.LastErrorText
    Exit Sub
End If

Dim jsonResponse As New ChilkatJsonObject
success = jsonResponse.LoadSb(sbResponseBody)

Dim id As String
Dim object As String
Dim amount_due As Long
Dim application_fee As Long
Dim attempt_count As Long
Dim attempted As Long
Dim billing As String
Dim charge As Long
Dim closed As Long
Dim currency As String
Dim customer As String
Dim date As Long
Dim description As Long
Dim discount As Long
Dim due_date As Long
Dim ending_balance As Long
Dim forgiven As Long
Dim linesHas_more As Long
Dim linesObject As String
Dim linesUrl As String
Dim livemode As Long
Dim next_payment_attempt As Long
Dim number As String
Dim paid As Long
Dim period_end As Long
Dim period_start As Long
Dim receipt_number As Long
Dim starting_balance As Long
Dim statement_descriptor As Long
Dim subscription As Long
Dim subtotal As Long
Dim tax As Long
Dim tax_percent As Long
Dim total As Long
Dim webhooks_delivered_at As Long
Dim i As Long
Dim count_i As Long
Dim amount As Long
Dim description_str As String
Dim discountable As Long
Dim periodStart As Long
Dim periodEnd As Long
Dim planId As String
Dim planObject As String
Dim planAmount As Long
Dim planCreated As Long
Dim planCurrency As String
Dim planInterval As String
Dim planInterval_count As Long
Dim planLivemode As Long
Dim planName As String
Dim planStatement_descriptor As Long
Dim planTrial_period_days As Long
Dim proration As Long
Dim quantity As Long
Dim subscription_item As String
Dim type As String

id = jsonResponse.StringOf("id")
object = jsonResponse.StringOf("object")
amount_due = jsonResponse.IntOf("amount_due")
application_fee = jsonResponse.IsNullOf("application_fee")
attempt_count = jsonResponse.IntOf("attempt_count")
attempted = jsonResponse.BoolOf("attempted")
billing = jsonResponse.StringOf("billing")
charge = jsonResponse.IsNullOf("charge")
closed = jsonResponse.BoolOf("closed")
currency = jsonResponse.StringOf("currency")
customer = jsonResponse.StringOf("customer")
date = jsonResponse.IntOf("date")
description = jsonResponse.IsNullOf("description")
discount = jsonResponse.IsNullOf("discount")
due_date = jsonResponse.IsNullOf("due_date")
ending_balance = jsonResponse.IsNullOf("ending_balance")
forgiven = jsonResponse.BoolOf("forgiven")
linesHas_more = jsonResponse.BoolOf("lines.has_more")
linesObject = jsonResponse.StringOf("lines.object")
linesUrl = jsonResponse.StringOf("lines.url")
livemode = jsonResponse.BoolOf("livemode")
next_payment_attempt = jsonResponse.IntOf("next_payment_attempt")
number = jsonResponse.StringOf("number")
paid = jsonResponse.BoolOf("paid")
period_end = jsonResponse.IntOf("period_end")
period_start = jsonResponse.IntOf("period_start")
receipt_number = jsonResponse.IsNullOf("receipt_number")
starting_balance = jsonResponse.IntOf("starting_balance")
statement_descriptor = jsonResponse.IsNullOf("statement_descriptor")
subscription = jsonResponse.IsNullOf("subscription")
subtotal = jsonResponse.IntOf("subtotal")
tax = jsonResponse.IsNullOf("tax")
tax_percent = jsonResponse.IsNullOf("tax_percent")
total = jsonResponse.IntOf("total")
webhooks_delivered_at = jsonResponse.IsNullOf("webhooks_delivered_at")
i = 0
count_i = jsonResponse.SizeOfArray("")
Do While i < count_i
    jsonResponse.I = i
    id = jsonResponse.StringOf("[i].id")
    object = jsonResponse.StringOf("[i].object")
    amount = jsonResponse.IntOf("[i].amount")
    currency = jsonResponse.StringOf("[i].currency")
    description_str = jsonResponse.StringOf("[i].description")
    discountable = jsonResponse.BoolOf("[i].discountable")
    livemode = jsonResponse.BoolOf("[i].livemode")
    periodStart = jsonResponse.IntOf("[i].period.start")
    periodEnd = jsonResponse.IntOf("[i].period.end")
    planId = jsonResponse.StringOf("[i]")
    planObject = jsonResponse.StringOf("[i].plan.object")
    planAmount = jsonResponse.IntOf("[i].plan.amount")
    planCreated = jsonResponse.IntOf("[i].plan.created")
    planCurrency = jsonResponse.StringOf("[i].plan.currency")
    planInterval = jsonResponse.StringOf("[i].plan.interval")
    planInterval_count = jsonResponse.IntOf("[i].plan.interval_count")
    planLivemode = jsonResponse.BoolOf("[i].plan.livemode")
    planName = jsonResponse.StringOf("[i]")
    planStatement_descriptor = jsonResponse.IsNullOf("[i].plan.statement_descriptor")
    planTrial_period_days = jsonResponse.IsNullOf("[i].plan.trial_period_days")
    proration = jsonResponse.BoolOf("[i].proration")
    quantity = jsonResponse.IntOf("[i].quantity")
    subscription = jsonResponse.IsNullOf("[i].subscription")
    subscription_item = jsonResponse.StringOf("[i].subscription_item")
    type = jsonResponse.StringOf("[i].type")
    i = i + 1

Sample JSON Response Body

  "id": "in_1BnETLGswQrCoh0XR7p1RCtV",
  "object": "invoice",
  "amount_due": 0,
  "application_fee": null,
  "attempt_count": 0,
  "attempted": false,
  "billing": "charge_automatically",
  "charge": null,
  "closed": false,
  "currency": "usd",
  "customer": "cus_CBbg9PmQ9sLbmo",
  "date": 1516662783,
  "description": null,
  "discount": null,
  "due_date": null,
  "ending_balance": null,
  "forgiven": false,
  "lines": {
    "data": [
        "id": "sub_CBbgnZGMJwa9ta",
        "object": "line_item",
        "amount": 999,
        "currency": "usd",
        "description": "1x Silver Express (at $9.99)",
        "discountable": true,
        "livemode": true,
        "metadata": {},
        "period": {
          "start": 1521760383,
          "end": 1524438783
        "plan": {
          "id": "gold",
          "object": "plan",
          "amount": 2000,
          "created": 1516662783,
          "currency": "usd",
          "interval": "month",
          "interval_count": 1,
          "livemode": false,
          "metadata": {},
          "name": "T-shirt",
          "statement_descriptor": null,
          "trial_period_days": null
        "proration": false,
        "quantity": 1,
        "subscription": null,
        "subscription_item": "si_CBbgiJ7hAAGzMF",
        "type": "subscription"
    "has_more": false,
    "object": "list",
    "url": "/v1/invoices/in_1BnETLGswQrCoh0XR7p1RCtV/lines"
  "livemode": false,
  "metadata": {},
  "next_payment_attempt": 1516666383,
  "number": "36eba31eaa-0001",
  "paid": false,
  "period_end": 1516662783,
  "period_start": 1516662783,
  "receipt_number": null,
  "starting_balance": 0,
  "statement_descriptor": null,
  "subscription": null,
  "subtotal": 0,
  "tax": null,
  "tax_percent": null,
  "total": 0,
  "webhooks_delivered_at": null