How to get charge id after creating a subscription using Stripe?

Well there is no straight-forward way to do this. There is however a hack to get charge_id for thatsubscription with out waiting for invoice.payment_succeeded callback.

This how I did in Ruby, you can treat this as a pseudo code. May be you can do this using PHP APIs

  # Lets not retrieve all the invoices
  #  use filter
  lower_limit_date = DateTime.strptime(that_subscription.start.to_s, '%s') - 1.hour
  upper_limit_date = 2.hours.from_now

  list_object_of_all_invoices_in_range = Stripe::Invoice.all(
          customer: customer_id,
          date: {
              gt: lower_limit_date.to_i, # Start TimeStamp
              lt: upper_limit_date.to_i # End TimeStamp

  particular_invoice =
      keep_if { |s| s[:subscription] == }.first

  stripe_charge_id = particular_invoice.charge # gives charge_id

See structure of ListObject for Invoices