usage_credits

Demo app for the 💳✨ usage_credits gem

The basics: get and spend credits

 

Subscribe to a plan: Buy credit packs: Get arbitrary bonuses: Spend credits:

Ledger status

Date Amount Category Expiration
Nov 23, 7:29 PM +10 credits subscription_credits first_cycle expires in 29 days
Nov 23, 7:29 PM +10 credits subscription_credits first_cycle expires in 29 days
Nov 23, 7:29 PM +10 credits credit_pack_purchase –
Nov 23, 7:30 PM +10 credits credit_pack_purchase –
Nov 23, 7:30 PM +1000 credits credit_pack_purchase –
Nov 23, 7:30 PM +1000 credits credit_pack_purchase –
Nov 23, 7:30 PM +5100 credits credit_pack_purchase –
Nov 23, 7:30 PM +5100 credits credit_pack_purchase –
Nov 23, 7:30 PM +10 credits signup_bonus signup –
Nov 23, 7:30 PM +10 credits signup_bonus signup –
Nov 23, 7:30 PM +20 credits referral_bonus referral –
Nov 23, 7:30 PM +20 credits referral_bonus referral –
Nov 23, 7:30 PM +10 credits bonus expiring_bonus_credits 🗑️ expired
Nov 23, 7:30 PM +10 credits bonus expiring_bonus_credits 🗑️ expired
Nov 23, 8:33 PM +5100 credits credit_pack_purchase –
Nov 23, 8:37 PM +10 credits bonus expiring_bonus_credits 🗑️ expired
Nov 23, 8:41 PM +10 credits credit_pack_purchase –
Nov 23, 8:48 PM +20 credits referral_bonus referral –
Nov 23, 8:51 PM +10 credits signup_bonus signup –
Nov 23, 8:56 PM +1000 credits credit_pack_purchase –
Nov 23, 11:31 PM +10 credits subscription_credits first_cycle expires in 29 days
Nov 24, 11:34 AM +1000 credits credit_pack_purchase –
Nov 24, 11:34 AM +5100 credits credit_pack_purchase –
Nov 24, 11:34 AM +5100 credits credit_pack_purchase –

Payment records (pay gem)

The user has paid $1193.97 total

Pay::Charge (12)
# {
                        :id => 4285,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "1EjU2OhOagRWvmnP5_nk-",
                    :amount => 4900,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "starter",
               "credits" => 1000,
         "bonus_credits" => 0,
           "price_cents" => 4900,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-23 19:30:04.975187000 UTC +00:00,
                :updated_at => 2026-11-23 19:30:04.975187000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 4294,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "3aYCr_oUhhZZD-Re0JNzM",
                    :amount => 19900,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "pro",
               "credits" => 5000,
         "bonus_credits" => 100,
           "price_cents" => 19900,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-24 11:34:56.532951000 UTC +00:00,
                :updated_at => 2026-11-24 11:34:56.532951000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 4288,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "72O9BORNRhD_KVKZZ-YtB",
                    :amount => 19900,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "pro",
               "credits" => 5000,
         "bonus_credits" => 100,
           "price_cents" => 19900,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-23 19:30:10.757694000 UTC +00:00,
                :updated_at => 2026-11-23 19:30:10.757694000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 4286,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "P3afdBb-IygNLctmnWDLN",
                    :amount => 4900,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "starter",
               "credits" => 1000,
         "bonus_credits" => 0,
           "price_cents" => 4900,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-23 19:30:06.706449000 UTC +00:00,
                :updated_at => 2026-11-23 19:30:06.706449000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 4293,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "P8rbiSqinQC_14LH9-mFk",
                    :amount => 19900,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "pro",
               "credits" => 5000,
         "bonus_credits" => 100,
           "price_cents" => 19900,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-24 11:34:48.422003000 UTC +00:00,
                :updated_at => 2026-11-24 11:34:48.422003000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 4289,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "USloNs6ZlC2rZEUkrqQKD",
                    :amount => 19900,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "pro",
               "credits" => 5000,
         "bonus_credits" => 100,
           "price_cents" => 19900,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-23 20:33:30.098044000 UTC +00:00,
                :updated_at => 2026-11-23 20:33:30.098044000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 4291,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "WzgRylfaCQj30bD4cCx6r",
                    :amount => 4900,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "starter",
               "credits" => 1000,
         "bonus_credits" => 0,
           "price_cents" => 4900,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-23 20:56:44.249537000 UTC +00:00,
                :updated_at => 2026-11-23 20:56:44.249537000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 4283,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "X3TP-X0jGQWvsZWGtxqch",
                    :amount => 99,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "tiny",
               "credits" => 10,
         "bonus_credits" => 0,
           "price_cents" => 99,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-23 19:29:57.236698000 UTC +00:00,
                :updated_at => 2026-11-23 19:29:57.236698000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 4292,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "jbVgVc8TpL_CDRlC3j_mo",
                    :amount => 4900,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "starter",
               "credits" => 1000,
         "bonus_credits" => 0,
           "price_cents" => 4900,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-24 11:34:46.508385000 UTC +00:00,
                :updated_at => 2026-11-24 11:34:46.508385000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 4287,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "pqAlaqcc9qE7UCgSGqgGC",
                    :amount => 19900,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "pro",
               "credits" => 5000,
         "bonus_credits" => 100,
           "price_cents" => 19900,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-23 19:30:08.178029000 UTC +00:00,
                :updated_at => 2026-11-23 19:30:08.178029000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 4290,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "r71ngAAASO6g2HH960fgT",
                    :amount => 99,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "tiny",
               "credits" => 10,
         "bonus_credits" => 0,
           "price_cents" => 99,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-23 20:41:34.314899000 UTC +00:00,
                :updated_at => 2026-11-23 20:41:34.314899000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 4284,
               :customer_id => 5917,
           :subscription_id => nil,
              :processor_id => "zHxSt3hpa79daEeMj5IGm",
                    :amount => 99,
                  :currency => nil,
    :application_fee_amount => nil,
           :amount_refunded => nil,
                  :metadata => {
         "purchase_type" => "credit_pack",
             "pack_name" => "tiny",
               "credits" => 10,
         "bonus_credits" => 0,
           "price_cents" => 99,
        "price_currency" => "USD"
    },
                      :data => {
        "payment_method_type" => "card",
                      "brand" => "Fake",
                      "last4" => 1234,
                  "exp_month" => 11,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-11-23 19:30:02.314735000 UTC +00:00,
                :updated_at => 2026-11-23 19:30:02.314735000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
Pay::Subscription (3)
# {
                         "id" => 1904,
                "customer_id" => 5917,
                       "name" => "default",
               "processor_id" => "3KpkMiQB1EOwi_ffKOEpT",
             "processor_plan" => "abcdef123456",
                   "quantity" => 1,
                     "status" => "active",
       "current_period_start" => nil,
         "current_period_end" => nil,
              "trial_ends_at" => nil,
                    "ends_at" => nil,
                    "metered" => nil,
             "pause_behavior" => nil,
            "pause_starts_at" => nil,
           "pause_resumes_at" => nil,
    "application_fee_percent" => nil,
                   "metadata" => {
                   "purchase_type" => "credit_subscription",
               "subscription_name" => "test_plan",
              "fulfillment_period" => "1 month",
              "credits_per_period" => 10,
            "signup_bonus_credits" => 0,
                   "trial_credits" => 0,
                "rollover_enabled" => false,
        "expire_credits_on_cancel" => false,
        "credit_expiration_period" => nil,
                        "metadata" => {}
    },
                       "data" => nil,
             "stripe_account" => nil,
          "payment_method_id" => nil,
                 "created_at" => 2026-11-23 19:29:51.102019000 UTC +00:00,
                 "updated_at" => 2026-11-23 19:29:51.102019000 UTC +00:00,
                       "type" => "Pay::FakeProcessor::Subscription",
                    "prorate" => true
}
# {
                         "id" => 1905,
                "customer_id" => 5917,
                       "name" => "default",
               "processor_id" => "F_GQ_dwq87oJ0PGEAZXNb",
             "processor_plan" => "abcdef123456",
                   "quantity" => 1,
                     "status" => "active",
       "current_period_start" => nil,
         "current_period_end" => nil,
              "trial_ends_at" => nil,
                    "ends_at" => nil,
                    "metered" => nil,
             "pause_behavior" => nil,
            "pause_starts_at" => nil,
           "pause_resumes_at" => nil,
    "application_fee_percent" => nil,
                   "metadata" => {
                   "purchase_type" => "credit_subscription",
               "subscription_name" => "test_plan",
              "fulfillment_period" => "1 month",
              "credits_per_period" => 10,
            "signup_bonus_credits" => 0,
                   "trial_credits" => 0,
                "rollover_enabled" => false,
        "expire_credits_on_cancel" => false,
        "credit_expiration_period" => nil,
                        "metadata" => {}
    },
                       "data" => nil,
             "stripe_account" => nil,
          "payment_method_id" => nil,
                 "created_at" => 2026-11-23 23:31:07.569122000 UTC +00:00,
                 "updated_at" => 2026-11-23 23:31:07.569122000 UTC +00:00,
                       "type" => "Pay::FakeProcessor::Subscription",
                    "prorate" => true
}
# {
                         "id" => 1903,
                "customer_id" => 5917,
                       "name" => "default",
               "processor_id" => "LXna2d-puNlO_SzzWAaf2",
             "processor_plan" => "abcdef123456",
                   "quantity" => 1,
                     "status" => "active",
       "current_period_start" => nil,
         "current_period_end" => nil,
              "trial_ends_at" => nil,
                    "ends_at" => nil,
                    "metered" => nil,
             "pause_behavior" => nil,
            "pause_starts_at" => nil,
           "pause_resumes_at" => nil,
    "application_fee_percent" => nil,
                   "metadata" => {
                   "purchase_type" => "credit_subscription",
               "subscription_name" => "test_plan",
              "fulfillment_period" => "1 month",
              "credits_per_period" => 10,
            "signup_bonus_credits" => 0,
                   "trial_credits" => 0,
                "rollover_enabled" => false,
        "expire_credits_on_cancel" => false,
        "credit_expiration_period" => nil,
                        "metadata" => {}
    },
                       "data" => nil,
             "stripe_account" => nil,
          "payment_method_id" => nil,
                 "created_at" => 2026-11-23 19:29:49.356090000 UTC +00:00,
                 "updated_at" => 2026-11-23 19:29:49.356090000 UTC +00:00,
                       "type" => "Pay::FakeProcessor::Subscription",
                    "prorate" => true
}

Model records

UsageCredits::Fulfillment (15)
# {
                          :id => 6185,
                   :wallet_id => 5925,
                 :source_type => "Pay::Subscription",
                   :source_id => 1903,
    :credits_last_fulfillment => 10,
            :fulfillment_type => "subscription",
           :last_fulfilled_at => 2026-11-23 19:29:49.358998000 UTC +00:00,
         :next_fulfillment_at => 2026-12-23 19:29:49.356090000 UTC +00:00,
          :fulfillment_period => "1 month",
                    :stops_at => nil,
                    :metadata => {
        "subscription_id" => 1903,
                   "plan" => "abcdef123456"
    },
                  :created_at => 2026-11-23 19:29:49.359413000 UTC +00:00,
                  :updated_at => 2026-11-23 19:29:49.359413000 UTC +00:00
}
# {
                          :id => 6186,
                   :wallet_id => 5925,
                 :source_type => "Pay::Subscription",
                   :source_id => 1904,
    :credits_last_fulfillment => 10,
            :fulfillment_type => "subscription",
           :last_fulfilled_at => 2026-11-23 19:29:51.106001000 UTC +00:00,
         :next_fulfillment_at => 2026-12-23 19:29:51.102019000 UTC +00:00,
          :fulfillment_period => "1 month",
                    :stops_at => nil,
                    :metadata => {
        "subscription_id" => 1904,
                   "plan" => "abcdef123456"
    },
                  :created_at => 2026-11-23 19:29:51.106481000 UTC +00:00,
                  :updated_at => 2026-11-23 19:29:51.106481000 UTC +00:00
}
# {
                          :id => 6187,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4283,
    :credits_last_fulfillment => 10,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-23 19:29:57.241092000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4283,
              "purchased_at" => "2026-11-23T19:29:57.236Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "tiny",
                   "credits" => 10,
             "bonus_credits" => 0,
               "price_cents" => 99,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-23 19:29:57.241450000 UTC +00:00,
                  :updated_at => 2026-11-23 19:29:57.241450000 UTC +00:00
}
# {
                          :id => 6188,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4284,
    :credits_last_fulfillment => 10,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-23 19:30:02.319335000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4284,
              "purchased_at" => "2026-11-23T19:30:02.314Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "tiny",
                   "credits" => 10,
             "bonus_credits" => 0,
               "price_cents" => 99,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-23 19:30:02.319761000 UTC +00:00,
                  :updated_at => 2026-11-23 19:30:02.319761000 UTC +00:00
}
# {
                          :id => 6189,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4285,
    :credits_last_fulfillment => 1000,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-23 19:30:04.978724000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4285,
              "purchased_at" => "2026-11-23T19:30:04.975Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "starter",
                   "credits" => 1000,
             "bonus_credits" => 0,
               "price_cents" => 4900,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-23 19:30:04.979153000 UTC +00:00,
                  :updated_at => 2026-11-23 19:30:04.979153000 UTC +00:00
}
# {
                          :id => 6190,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4286,
    :credits_last_fulfillment => 1000,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-23 19:30:06.711526000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4286,
              "purchased_at" => "2026-11-23T19:30:06.706Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "starter",
                   "credits" => 1000,
             "bonus_credits" => 0,
               "price_cents" => 4900,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-23 19:30:06.711948000 UTC +00:00,
                  :updated_at => 2026-11-23 19:30:06.711948000 UTC +00:00
}
# {
                          :id => 6191,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4287,
    :credits_last_fulfillment => 5100,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-23 19:30:08.181672000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4287,
              "purchased_at" => "2026-11-23T19:30:08.178Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-23 19:30:08.182099000 UTC +00:00,
                  :updated_at => 2026-11-23 19:30:08.182099000 UTC +00:00
}
# {
                          :id => 6192,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4288,
    :credits_last_fulfillment => 5100,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-23 19:30:10.763562000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4288,
              "purchased_at" => "2026-11-23T19:30:10.757Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-23 19:30:10.764268000 UTC +00:00,
                  :updated_at => 2026-11-23 19:30:10.764268000 UTC +00:00
}
# {
                          :id => 6193,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4289,
    :credits_last_fulfillment => 5100,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-23 20:33:30.104974000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4289,
              "purchased_at" => "2026-11-23T20:33:30.098Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-23 20:33:30.105447000 UTC +00:00,
                  :updated_at => 2026-11-23 20:33:30.105447000 UTC +00:00
}
# {
                          :id => 6194,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4290,
    :credits_last_fulfillment => 10,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-23 20:41:34.318017000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4290,
              "purchased_at" => "2026-11-23T20:41:34.314Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "tiny",
                   "credits" => 10,
             "bonus_credits" => 0,
               "price_cents" => 99,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-23 20:41:34.318327000 UTC +00:00,
                  :updated_at => 2026-11-23 20:41:34.318327000 UTC +00:00
}
# {
                          :id => 6195,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4291,
    :credits_last_fulfillment => 1000,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-23 20:56:44.254202000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4291,
              "purchased_at" => "2026-11-23T20:56:44.249Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "starter",
                   "credits" => 1000,
             "bonus_credits" => 0,
               "price_cents" => 4900,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-23 20:56:44.254628000 UTC +00:00,
                  :updated_at => 2026-11-23 20:56:44.254628000 UTC +00:00
}
# {
                          :id => 6196,
                   :wallet_id => 5925,
                 :source_type => "Pay::Subscription",
                   :source_id => 1905,
    :credits_last_fulfillment => 10,
            :fulfillment_type => "subscription",
           :last_fulfilled_at => 2026-11-23 23:31:07.574687000 UTC +00:00,
         :next_fulfillment_at => 2026-12-23 23:31:07.569122000 UTC +00:00,
          :fulfillment_period => "1 month",
                    :stops_at => nil,
                    :metadata => {
        "subscription_id" => 1905,
                   "plan" => "abcdef123456"
    },
                  :created_at => 2026-11-23 23:31:07.575179000 UTC +00:00,
                  :updated_at => 2026-11-23 23:31:07.575179000 UTC +00:00
}
# {
                          :id => 6197,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4292,
    :credits_last_fulfillment => 1000,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-24 11:34:46.513482000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4292,
              "purchased_at" => "2026-11-24T11:34:46.508Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "starter",
                   "credits" => 1000,
             "bonus_credits" => 0,
               "price_cents" => 4900,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-24 11:34:46.513891000 UTC +00:00,
                  :updated_at => 2026-11-24 11:34:46.513891000 UTC +00:00
}
# {
                          :id => 6198,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4293,
    :credits_last_fulfillment => 5100,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-24 11:34:48.426953000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4293,
              "purchased_at" => "2026-11-24T11:34:48.422Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-24 11:34:48.427580000 UTC +00:00,
                  :updated_at => 2026-11-24 11:34:48.427580000 UTC +00:00
}
# {
                          :id => 6199,
                   :wallet_id => 5925,
                 :source_type => "Pay::Charge",
                   :source_id => 4294,
    :credits_last_fulfillment => 5100,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-11-24 11:34:56.538109000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 4294,
              "purchased_at" => "2026-11-24T11:34:56.532Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
                  :created_at => 2026-11-24 11:34:56.538445000 UTC +00:00,
                  :updated_at => 2026-11-24 11:34:56.538445000 UTC +00:00
}
UsageCredits::Transaction (24)
# {
                :id => 10111,
         :wallet_id => 5925,
            :amount => 10,
          :category => "subscription_credits",
        :expires_at => 2026-12-23 19:34:49.356090000 UTC +00:00,
    :fulfillment_id => 6185,
          :metadata => {
        "subscription_id" => 1903,
                 "reason" => "first_cycle",
                   "plan" => "abcdef123456",
           "fulfilled_at" => "2026-11-23T19:29:49.357Z"
    },
        :created_at => 2026-11-23 19:29:49.358023000 UTC +00:00,
        :updated_at => 2026-11-23 19:29:49.358023000 UTC +00:00
}
# {
                :id => 10112,
         :wallet_id => 5925,
            :amount => 10,
          :category => "subscription_credits",
        :expires_at => 2026-12-23 19:34:51.102019000 UTC +00:00,
    :fulfillment_id => 6186,
          :metadata => {
        "subscription_id" => 1904,
                 "reason" => "first_cycle",
                   "plan" => "abcdef123456",
           "fulfilled_at" => "2026-11-23T19:29:51.103Z"
    },
        :created_at => 2026-11-23 19:29:51.104577000 UTC +00:00,
        :updated_at => 2026-11-23 19:29:51.104577000 UTC +00:00
}
# {
                :id => 10113,
         :wallet_id => 5925,
            :amount => 10,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4283,
              "purchased_at" => "2026-11-23T19:29:57.236Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-23T19:29:57.238Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "tiny",
                   "credits" => 10,
             "bonus_credits" => 0,
               "price_cents" => 99,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-23 19:29:57.239730000 UTC +00:00,
        :updated_at => 2026-11-23 19:29:57.239730000 UTC +00:00
}
# {
                :id => 10114,
         :wallet_id => 5925,
            :amount => 10,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4284,
              "purchased_at" => "2026-11-23T19:30:02.314Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-23T19:30:02.316Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "tiny",
                   "credits" => 10,
             "bonus_credits" => 0,
               "price_cents" => 99,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-23 19:30:02.318023000 UTC +00:00,
        :updated_at => 2026-11-23 19:30:02.318023000 UTC +00:00
}
# {
                :id => 10115,
         :wallet_id => 5925,
            :amount => 1000,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4285,
              "purchased_at" => "2026-11-23T19:30:04.975Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-23T19:30:04.976Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "starter",
                   "credits" => 1000,
             "bonus_credits" => 0,
               "price_cents" => 4900,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-23 19:30:04.977451000 UTC +00:00,
        :updated_at => 2026-11-23 19:30:04.977451000 UTC +00:00
}
# {
                :id => 10116,
         :wallet_id => 5925,
            :amount => 1000,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4286,
              "purchased_at" => "2026-11-23T19:30:06.706Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-23T19:30:06.707Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "starter",
                   "credits" => 1000,
             "bonus_credits" => 0,
               "price_cents" => 4900,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-23 19:30:06.708993000 UTC +00:00,
        :updated_at => 2026-11-23 19:30:06.708993000 UTC +00:00
}
# {
                :id => 10117,
         :wallet_id => 5925,
            :amount => 5100,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4287,
              "purchased_at" => "2026-11-23T19:30:08.178Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-23T19:30:08.179Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-23 19:30:08.180356000 UTC +00:00,
        :updated_at => 2026-11-23 19:30:08.180356000 UTC +00:00
}
# {
                :id => 10118,
         :wallet_id => 5925,
            :amount => 5100,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4288,
              "purchased_at" => "2026-11-23T19:30:10.757Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-23T19:30:10.760Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-23 19:30:10.762154000 UTC +00:00,
        :updated_at => 2026-11-23 19:30:10.762154000 UTC +00:00
}
# {
                :id => 10119,
         :wallet_id => 5925,
            :amount => 10,
          :category => "signup_bonus",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "signup"
    },
        :created_at => 2026-11-23 19:30:12.389133000 UTC +00:00,
        :updated_at => 2026-11-23 19:30:12.389133000 UTC +00:00
}
# {
                :id => 10120,
         :wallet_id => 5925,
            :amount => 10,
          :category => "signup_bonus",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "signup"
    },
        :created_at => 2026-11-23 19:30:13.859301000 UTC +00:00,
        :updated_at => 2026-11-23 19:30:13.859301000 UTC +00:00
}
# {
                :id => 10121,
         :wallet_id => 5925,
            :amount => 20,
          :category => "referral_bonus",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "referral"
    },
        :created_at => 2026-11-23 19:30:14.798039000 UTC +00:00,
        :updated_at => 2026-11-23 19:30:14.798039000 UTC +00:00
}
# {
                :id => 10122,
         :wallet_id => 5925,
            :amount => 20,
          :category => "referral_bonus",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "referral"
    },
        :created_at => 2026-11-23 19:30:15.490481000 UTC +00:00,
        :updated_at => 2026-11-23 19:30:15.490481000 UTC +00:00
}
# {
                :id => 10123,
         :wallet_id => 5925,
            :amount => 10,
          :category => "bonus",
        :expires_at => 2026-11-23 19:31:17.379702000 UTC +00:00,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "expiring_bonus_credits"
    },
        :created_at => 2026-11-23 19:30:17.383164000 UTC +00:00,
        :updated_at => 2026-11-23 19:30:17.383164000 UTC +00:00
}
# {
                :id => 10124,
         :wallet_id => 5925,
            :amount => 10,
          :category => "bonus",
        :expires_at => 2026-11-23 19:31:17.933239000 UTC +00:00,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "expiring_bonus_credits"
    },
        :created_at => 2026-11-23 19:30:17.935672000 UTC +00:00,
        :updated_at => 2026-11-23 19:30:17.935672000 UTC +00:00
}
# {
                :id => 10125,
         :wallet_id => 5925,
            :amount => 5100,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4289,
              "purchased_at" => "2026-11-23T20:33:30.098Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-23T20:33:30.102Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-23 20:33:30.103478000 UTC +00:00,
        :updated_at => 2026-11-23 20:33:30.103478000 UTC +00:00
}
# {
                :id => 10126,
         :wallet_id => 5925,
            :amount => 10,
          :category => "bonus",
        :expires_at => 2026-11-23 20:38:34.684117000 UTC +00:00,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "expiring_bonus_credits"
    },
        :created_at => 2026-11-23 20:37:34.686567000 UTC +00:00,
        :updated_at => 2026-11-23 20:37:34.686567000 UTC +00:00
}
# {
                :id => 10127,
         :wallet_id => 5925,
            :amount => 10,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4290,
              "purchased_at" => "2026-11-23T20:41:34.314Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-23T20:41:34.316Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "tiny",
                   "credits" => 10,
             "bonus_credits" => 0,
               "price_cents" => 99,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-23 20:41:34.317241000 UTC +00:00,
        :updated_at => 2026-11-23 20:41:34.317241000 UTC +00:00
}
# {
                :id => 10128,
         :wallet_id => 5925,
            :amount => 20,
          :category => "referral_bonus",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "referral"
    },
        :created_at => 2026-11-23 20:48:55.055469000 UTC +00:00,
        :updated_at => 2026-11-23 20:48:55.055469000 UTC +00:00
}
# {
                :id => 10129,
         :wallet_id => 5925,
            :amount => 10,
          :category => "signup_bonus",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "signup"
    },
        :created_at => 2026-11-23 20:51:03.836120000 UTC +00:00,
        :updated_at => 2026-11-23 20:51:03.836120000 UTC +00:00
}
# {
                :id => 10130,
         :wallet_id => 5925,
            :amount => 1000,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4291,
              "purchased_at" => "2026-11-23T20:56:44.249Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-23T20:56:44.251Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "starter",
                   "credits" => 1000,
             "bonus_credits" => 0,
               "price_cents" => 4900,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-23 20:56:44.252882000 UTC +00:00,
        :updated_at => 2026-11-23 20:56:44.252882000 UTC +00:00
}
# {
                :id => 10131,
         :wallet_id => 5925,
            :amount => 10,
          :category => "subscription_credits",
        :expires_at => 2026-12-23 23:36:07.569122000 UTC +00:00,
    :fulfillment_id => 6196,
          :metadata => {
        "subscription_id" => 1905,
                 "reason" => "first_cycle",
                   "plan" => "abcdef123456",
           "fulfilled_at" => "2026-11-23T23:31:07.572Z"
    },
        :created_at => 2026-11-23 23:31:07.573597000 UTC +00:00,
        :updated_at => 2026-11-23 23:31:07.573597000 UTC +00:00
}
# {
                :id => 10132,
         :wallet_id => 5925,
            :amount => 1000,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4292,
              "purchased_at" => "2026-11-24T11:34:46.508Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-24T11:34:46.511Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "starter",
                   "credits" => 1000,
             "bonus_credits" => 0,
               "price_cents" => 4900,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-24 11:34:46.512170000 UTC +00:00,
        :updated_at => 2026-11-24 11:34:46.512170000 UTC +00:00
}
# {
                :id => 10133,
         :wallet_id => 5925,
            :amount => 5100,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4293,
              "purchased_at" => "2026-11-24T11:34:48.422Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-24T11:34:48.424Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-24 11:34:48.425367000 UTC +00:00,
        :updated_at => 2026-11-24 11:34:48.425367000 UTC +00:00
}
# {
                :id => 10134,
         :wallet_id => 5925,
            :amount => 5100,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 4294,
              "purchased_at" => "2026-11-24T11:34:56.532Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-11-24T11:34:56.534Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
        :created_at => 2026-11-24 11:34:56.536976000 UTC +00:00,
        :updated_at => 2026-11-24 11:34:56.536976000 UTC +00:00
}
UsageCredits::Allocation (0) none

Audit trail

Audit trail
[
    [ 0] [
        [0] "subscription_credits",
        [1] 10,
        [2] {
            "subscription_id" => 1903,
                     "reason" => "first_cycle",
                       "plan" => "abcdef123456",
               "fulfilled_at" => "2026-11-23T19:29:49.357Z"
        }
    ],
    [ 1] [
        [0] "subscription_credits",
        [1] 10,
        [2] {
            "subscription_id" => 1904,
                     "reason" => "first_cycle",
                       "plan" => "abcdef123456",
               "fulfilled_at" => "2026-11-23T19:29:51.103Z"
        }
    ],
    [ 2] [
        [0] "credit_pack_purchase",
        [1] 10,
        [2] {
            "purchase_charge_id" => 4283,
                  "purchased_at" => "2026-11-23T19:29:57.236Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-23T19:29:57.238Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "tiny",
                       "credits" => 10,
                 "bonus_credits" => 0,
                   "price_cents" => 99,
                "price_currency" => "USD"
        }
    ],
    [ 3] [
        [0] "credit_pack_purchase",
        [1] 10,
        [2] {
            "purchase_charge_id" => 4284,
                  "purchased_at" => "2026-11-23T19:30:02.314Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-23T19:30:02.316Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "tiny",
                       "credits" => 10,
                 "bonus_credits" => 0,
                   "price_cents" => 99,
                "price_currency" => "USD"
        }
    ],
    [ 4] [
        [0] "credit_pack_purchase",
        [1] 1000,
        [2] {
            "purchase_charge_id" => 4285,
                  "purchased_at" => "2026-11-23T19:30:04.975Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-23T19:30:04.976Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "starter",
                       "credits" => 1000,
                 "bonus_credits" => 0,
                   "price_cents" => 4900,
                "price_currency" => "USD"
        }
    ],
    [ 5] [
        [0] "credit_pack_purchase",
        [1] 1000,
        [2] {
            "purchase_charge_id" => 4286,
                  "purchased_at" => "2026-11-23T19:30:06.706Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-23T19:30:06.707Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "starter",
                       "credits" => 1000,
                 "bonus_credits" => 0,
                   "price_cents" => 4900,
                "price_currency" => "USD"
        }
    ],
    [ 6] [
        [0] "credit_pack_purchase",
        [1] 5100,
        [2] {
            "purchase_charge_id" => 4287,
                  "purchased_at" => "2026-11-23T19:30:08.178Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-23T19:30:08.179Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "pro",
                       "credits" => 5000,
                 "bonus_credits" => 100,
                   "price_cents" => 19900,
                "price_currency" => "USD"
        }
    ],
    [ 7] [
        [0] "credit_pack_purchase",
        [1] 5100,
        [2] {
            "purchase_charge_id" => 4288,
                  "purchased_at" => "2026-11-23T19:30:10.757Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-23T19:30:10.760Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "pro",
                       "credits" => 5000,
                 "bonus_credits" => 100,
                   "price_cents" => 19900,
                "price_currency" => "USD"
        }
    ],
    [ 8] [
        [0] "signup_bonus",
        [1] 10,
        [2] {
            "reason" => "signup"
        }
    ],
    [ 9] [
        [0] "signup_bonus",
        [1] 10,
        [2] {
            "reason" => "signup"
        }
    ],
    [10] [
        [0] "referral_bonus",
        [1] 20,
        [2] {
            "reason" => "referral"
        }
    ],
    [11] [
        [0] "referral_bonus",
        [1] 20,
        [2] {
            "reason" => "referral"
        }
    ],
    [12] [
        [0] "bonus",
        [1] 10,
        [2] {
            "reason" => "expiring_bonus_credits"
        }
    ],
    [13] [
        [0] "bonus",
        [1] 10,
        [2] {
            "reason" => "expiring_bonus_credits"
        }
    ],
    [14] [
        [0] "credit_pack_purchase",
        [1] 5100,
        [2] {
            "purchase_charge_id" => 4289,
                  "purchased_at" => "2026-11-23T20:33:30.098Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-23T20:33:30.102Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "pro",
                       "credits" => 5000,
                 "bonus_credits" => 100,
                   "price_cents" => 19900,
                "price_currency" => "USD"
        }
    ],
    [15] [
        [0] "bonus",
        [1] 10,
        [2] {
            "reason" => "expiring_bonus_credits"
        }
    ],
    [16] [
        [0] "credit_pack_purchase",
        [1] 10,
        [2] {
            "purchase_charge_id" => 4290,
                  "purchased_at" => "2026-11-23T20:41:34.314Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-23T20:41:34.316Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "tiny",
                       "credits" => 10,
                 "bonus_credits" => 0,
                   "price_cents" => 99,
                "price_currency" => "USD"
        }
    ],
    [17] [
        [0] "referral_bonus",
        [1] 20,
        [2] {
            "reason" => "referral"
        }
    ],
    [18] [
        [0] "signup_bonus",
        [1] 10,
        [2] {
            "reason" => "signup"
        }
    ],
    [19] [
        [0] "credit_pack_purchase",
        [1] 1000,
        [2] {
            "purchase_charge_id" => 4291,
                  "purchased_at" => "2026-11-23T20:56:44.249Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-23T20:56:44.251Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "starter",
                       "credits" => 1000,
                 "bonus_credits" => 0,
                   "price_cents" => 4900,
                "price_currency" => "USD"
        }
    ],
    [20] [
        [0] "subscription_credits",
        [1] 10,
        [2] {
            "subscription_id" => 1905,
                     "reason" => "first_cycle",
                       "plan" => "abcdef123456",
               "fulfilled_at" => "2026-11-23T23:31:07.572Z"
        }
    ],
    [21] [
        [0] "credit_pack_purchase",
        [1] 1000,
        [2] {
            "purchase_charge_id" => 4292,
                  "purchased_at" => "2026-11-24T11:34:46.508Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-24T11:34:46.511Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "starter",
                       "credits" => 1000,
                 "bonus_credits" => 0,
                   "price_cents" => 4900,
                "price_currency" => "USD"
        }
    ],
    [22] [
        [0] "credit_pack_purchase",
        [1] 5100,
        [2] {
            "purchase_charge_id" => 4293,
                  "purchased_at" => "2026-11-24T11:34:48.422Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-24T11:34:48.424Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "pro",
                       "credits" => 5000,
                 "bonus_credits" => 100,
                   "price_cents" => 19900,
                "price_currency" => "USD"
        }
    ],
    [23] [
        [0] "credit_pack_purchase",
        [1] 5100,
        [2] {
            "purchase_charge_id" => 4294,
                  "purchased_at" => "2026-11-24T11:34:56.532Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-11-24T11:34:56.534Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "pro",
                       "credits" => 5000,
                 "bonus_credits" => 100,
                   "price_cents" => 19900,
                "price_currency" => "USD"
        }
    ]
]

Loaded config

Literal, raw config file
      # frozen_string_literal: true

UsageCredits.configure do |config|

  # Default test operations
  operation :small_operation do
    costs 1.credit
  end

  # operation :test_operation do
  #   costs 10.credits + 1.credits_per(:mb)
  #   validate ->(params) { params[:size].to_i <= 100.megabytes }, "File too large (max: 100 MB)"
  # end

  operation :prohibitive_operation do
    costs 1_000_000.credits
  end

  operation :this_operation_will_always_fail do
    costs 42.credits
  end


  # Define test credit packs
  credit_pack :tiny do
    gives 10.credits
    costs 99.cents
  end

  credit_pack :starter do
    gives 1000.credits
    costs 49.dollars
  end

  credit_pack :pro do
    gives 5000.credits
    bonus 100.credits  # Optional: give bonus credits
    costs 199.dollars
    currency :usd
  end


  # Define subscriptions
  subscription_plan :test_plan do
    processor_plan(:fake_processor, "abcdef123456")
    gives 10.credits.every(:month)
    unused_credits :expire
  end

  # Alert when balance drops below 100 credits
  # Set to nil to disable low balance alerts
  # config.low_balance_threshold = 20.credits

  # # Handle low credit balance alerts
  # config.on_low_balance do |user|
  #   # Send notification to user when their balance drops below the threshold
  #   ApplicationMailer.generic_email(to: user.email, body: "Heads up! You're low on credits.", subject: "Low credits alert").deliver_now
  # end

end

    
Credit-consuming operations
Credit packs
Credit subscription plans
Rest of the config
      {
  "default_currency": "usd",
  "rounding_strategy": "ceil",
  "credit_formatter": {},
  "fulfillment_grace_period": 300,
  "allow_negative_balance": false,
  "low_balance_threshold": null,
  "low_balance_callback": null
}