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
Feb 14, 1:59 PM +10 credits subscription_credits first_cycle expires in 28 days
Feb 14, 2:03 PM +10 credits subscription_credits first_cycle expires in 28 days
Feb 14, 2:03 PM +10 credits credit_pack_purchase
Feb 14, 2:04 PM +10 credits credit_pack_purchase
Feb 14, 2:05 PM +5100 credits credit_pack_purchase
Feb 14, 2:05 PM +5100 credits credit_pack_purchase
Feb 14, 2:08 PM +20 credits referral_bonus referral
Feb 14, 2:11 PM +20 credits referral_bonus referral
Feb 14, 2:12 PM +10 credits bonus expiring_bonus_credits 🗑️ expired
Feb 14, 2:14 PM +10 credits bonus expiring_bonus_credits 🗑️ expired
Feb 14, 3:03 PM +20 credits referral_bonus referral
Feb 14, 3:24 PM +20 credits referral_bonus referral

Payment records (pay gem)

The user has paid $399.98 total

Pay::Charge (4)
# {
                        :id => 2112,
               :customer_id => 3159,
           :subscription_id => nil,
              :processor_id => "87dD-VJ6YmmtHWqqNClfx",
                    :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" => 2,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-02-14 14:03:47.912230000 UTC +00:00,
                :updated_at => 2026-02-14 14:03:47.912230000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 2113,
               :customer_id => 3159,
           :subscription_id => nil,
              :processor_id => "E0IPl-pM5LpCSMvKJKa_k",
                    :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" => 2,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-02-14 14:04:41.592990000 UTC +00:00,
                :updated_at => 2026-02-14 14:04:41.592990000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 2115,
               :customer_id => 3159,
           :subscription_id => nil,
              :processor_id => "EavFUOyRsQ3Dh0nD3qmTB",
                    :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" => 2,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-02-14 14:05:58.612344000 UTC +00:00,
                :updated_at => 2026-02-14 14:05:58.612344000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
# {
                        :id => 2114,
               :customer_id => 3159,
           :subscription_id => nil,
              :processor_id => "JkdQpxqGmp-902bZDVzrn",
                    :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" => 2,
                   "exp_year" => 2026
    },
            :stripe_account => nil,
                :created_at => 2026-02-14 14:05:38.655060000 UTC +00:00,
                :updated_at => 2026-02-14 14:05:38.655060000 UTC +00:00,
                      :type => "Pay::FakeProcessor::Charge"
}
Pay::Subscription (2)
# {
                         "id" => 1147,
                "customer_id" => 3159,
                       "name" => "default",
               "processor_id" => "2JW-vl0urqalcTywQpDc_",
             "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-02-14 13:59:07.489078000 UTC +00:00,
                 "updated_at" => 2026-02-14 13:59:07.489078000 UTC +00:00,
                       "type" => "Pay::FakeProcessor::Subscription",
                    "prorate" => true
}
# {
                         "id" => 1148,
                "customer_id" => 3159,
                       "name" => "default",
               "processor_id" => "SihGJDT0PtckMNTYmU8-u",
             "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-02-14 14:03:38.498725000 UTC +00:00,
                 "updated_at" => 2026-02-14 14:03:38.498725000 UTC +00:00,
                       "type" => "Pay::FakeProcessor::Subscription",
                    "prorate" => true
}

Model records

UsageCredits::Fulfillment (6)
# {
                          :id => 3258,
                   :wallet_id => 3164,
                 :source_type => "Pay::Subscription",
                   :source_id => 1147,
    :credits_last_fulfillment => 10,
            :fulfillment_type => "subscription",
           :last_fulfilled_at => 2026-02-14 13:59:07.494336000 UTC +00:00,
         :next_fulfillment_at => 2026-03-14 13:59:07.489078000 UTC +00:00,
          :fulfillment_period => "1 month",
                    :stops_at => nil,
                    :metadata => {
        "subscription_id" => 1147,
                   "plan" => "abcdef123456"
    },
                  :created_at => 2026-02-14 13:59:07.495100000 UTC +00:00,
                  :updated_at => 2026-02-14 13:59:07.495100000 UTC +00:00
}
# {
                          :id => 3259,
                   :wallet_id => 3164,
                 :source_type => "Pay::Subscription",
                   :source_id => 1148,
    :credits_last_fulfillment => 10,
            :fulfillment_type => "subscription",
           :last_fulfilled_at => 2026-02-14 14:03:38.503539000 UTC +00:00,
         :next_fulfillment_at => 2026-03-14 14:03:38.498725000 UTC +00:00,
          :fulfillment_period => "1 month",
                    :stops_at => nil,
                    :metadata => {
        "subscription_id" => 1148,
                   "plan" => "abcdef123456"
    },
                  :created_at => 2026-02-14 14:03:38.504205000 UTC +00:00,
                  :updated_at => 2026-02-14 14:03:38.504205000 UTC +00:00
}
# {
                          :id => 3260,
                   :wallet_id => 3164,
                 :source_type => "Pay::Charge",
                   :source_id => 2112,
    :credits_last_fulfillment => 10,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-02-14 14:03:47.917019000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 2112,
              "purchased_at" => "2026-02-14T14:03:47.912Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "tiny",
                   "credits" => 10,
             "bonus_credits" => 0,
               "price_cents" => 99,
            "price_currency" => "USD"
    },
                  :created_at => 2026-02-14 14:03:47.917486000 UTC +00:00,
                  :updated_at => 2026-02-14 14:03:47.917486000 UTC +00:00
}
# {
                          :id => 3261,
                   :wallet_id => 3164,
                 :source_type => "Pay::Charge",
                   :source_id => 2113,
    :credits_last_fulfillment => 10,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-02-14 14:04:41.598090000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 2113,
              "purchased_at" => "2026-02-14T14:04:41.592Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "tiny",
                   "credits" => 10,
             "bonus_credits" => 0,
               "price_cents" => 99,
            "price_currency" => "USD"
    },
                  :created_at => 2026-02-14 14:04:41.598831000 UTC +00:00,
                  :updated_at => 2026-02-14 14:04:41.598831000 UTC +00:00
}
# {
                          :id => 3262,
                   :wallet_id => 3164,
                 :source_type => "Pay::Charge",
                   :source_id => 2114,
    :credits_last_fulfillment => 5100,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-02-14 14:05:38.661478000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 2114,
              "purchased_at" => "2026-02-14T14:05:38.655Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
                  :created_at => 2026-02-14 14:05:38.662101000 UTC +00:00,
                  :updated_at => 2026-02-14 14:05:38.662101000 UTC +00:00
}
# {
                          :id => 3263,
                   :wallet_id => 3164,
                 :source_type => "Pay::Charge",
                   :source_id => 2115,
    :credits_last_fulfillment => 5100,
            :fulfillment_type => "credit_pack",
           :last_fulfilled_at => 2026-02-14 14:05:58.624112000 UTC +00:00,
         :next_fulfillment_at => nil,
          :fulfillment_period => nil,
                    :stops_at => nil,
                    :metadata => {
        "purchase_charge_id" => 2115,
              "purchased_at" => "2026-02-14T14:05:58.612Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
                  :created_at => 2026-02-14 14:05:58.624589000 UTC +00:00,
                  :updated_at => 2026-02-14 14:05:58.624589000 UTC +00:00
}
UsageCredits::Transaction (12)
# {
                :id => 5353,
         :wallet_id => 3164,
            :amount => 10,
          :category => "subscription_credits",
        :expires_at => 2026-03-14 14:04:07.489078000 UTC +00:00,
    :fulfillment_id => 3258,
          :metadata => {
        "subscription_id" => 1147,
                 "reason" => "first_cycle",
                   "plan" => "abcdef123456",
           "fulfilled_at" => "2026-02-14T13:59:07.491Z"
    },
        :created_at => 2026-02-14 13:59:07.492501000 UTC +00:00,
        :updated_at => 2026-02-14 13:59:07.492501000 UTC +00:00
}
# {
                :id => 5354,
         :wallet_id => 3164,
            :amount => 10,
          :category => "subscription_credits",
        :expires_at => 2026-03-14 14:08:38.498725000 UTC +00:00,
    :fulfillment_id => 3259,
          :metadata => {
        "subscription_id" => 1148,
                 "reason" => "first_cycle",
                   "plan" => "abcdef123456",
           "fulfilled_at" => "2026-02-14T14:03:38.500Z"
    },
        :created_at => 2026-02-14 14:03:38.501945000 UTC +00:00,
        :updated_at => 2026-02-14 14:03:38.501945000 UTC +00:00
}
# {
                :id => 5355,
         :wallet_id => 3164,
            :amount => 10,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 2112,
              "purchased_at" => "2026-02-14T14:03:47.912Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-02-14T14:03:47.914Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "tiny",
                   "credits" => 10,
             "bonus_credits" => 0,
               "price_cents" => 99,
            "price_currency" => "USD"
    },
        :created_at => 2026-02-14 14:03:47.915310000 UTC +00:00,
        :updated_at => 2026-02-14 14:03:47.915310000 UTC +00:00
}
# {
                :id => 5356,
         :wallet_id => 3164,
            :amount => 10,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 2113,
              "purchased_at" => "2026-02-14T14:04:41.592Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-02-14T14:04:41.595Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "tiny",
                   "credits" => 10,
             "bonus_credits" => 0,
               "price_cents" => 99,
            "price_currency" => "USD"
    },
        :created_at => 2026-02-14 14:04:41.596483000 UTC +00:00,
        :updated_at => 2026-02-14 14:04:41.596483000 UTC +00:00
}
# {
                :id => 5357,
         :wallet_id => 3164,
            :amount => 5100,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 2114,
              "purchased_at" => "2026-02-14T14:05:38.655Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-02-14T14:05:38.658Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
        :created_at => 2026-02-14 14:05:38.659597000 UTC +00:00,
        :updated_at => 2026-02-14 14:05:38.659597000 UTC +00:00
}
# {
                :id => 5358,
         :wallet_id => 3164,
            :amount => 5100,
          :category => "credit_pack_purchase",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "purchase_charge_id" => 2115,
              "purchased_at" => "2026-02-14T14:05:58.612Z",
         "credits_fulfilled" => true,
              "fulfilled_at" => "2026-02-14T14:05:58.614Z",
             "purchase_type" => "credit_pack",
                 "pack_name" => "pro",
                   "credits" => 5000,
             "bonus_credits" => 100,
               "price_cents" => 19900,
            "price_currency" => "USD"
    },
        :created_at => 2026-02-14 14:05:58.615666000 UTC +00:00,
        :updated_at => 2026-02-14 14:05:58.615666000 UTC +00:00
}
# {
                :id => 5359,
         :wallet_id => 3164,
            :amount => 20,
          :category => "referral_bonus",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "referral"
    },
        :created_at => 2026-02-14 14:08:31.834702000 UTC +00:00,
        :updated_at => 2026-02-14 14:08:31.834702000 UTC +00:00
}
# {
                :id => 5360,
         :wallet_id => 3164,
            :amount => 20,
          :category => "referral_bonus",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "referral"
    },
        :created_at => 2026-02-14 14:11:55.361339000 UTC +00:00,
        :updated_at => 2026-02-14 14:11:55.361339000 UTC +00:00
}
# {
                :id => 5361,
         :wallet_id => 3164,
            :amount => 10,
          :category => "bonus",
        :expires_at => 2026-02-14 14:13:14.805715000 UTC +00:00,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "expiring_bonus_credits"
    },
        :created_at => 2026-02-14 14:12:14.808978000 UTC +00:00,
        :updated_at => 2026-02-14 14:12:14.808978000 UTC +00:00
}
# {
                :id => 5362,
         :wallet_id => 3164,
            :amount => 10,
          :category => "bonus",
        :expires_at => 2026-02-14 14:15:34.298361000 UTC +00:00,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "expiring_bonus_credits"
    },
        :created_at => 2026-02-14 14:14:34.301555000 UTC +00:00,
        :updated_at => 2026-02-14 14:14:34.301555000 UTC +00:00
}
# {
                :id => 5363,
         :wallet_id => 3164,
            :amount => 20,
          :category => "referral_bonus",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "referral"
    },
        :created_at => 2026-02-14 15:03:53.443376000 UTC +00:00,
        :updated_at => 2026-02-14 15:03:53.443376000 UTC +00:00
}
# {
                :id => 5364,
         :wallet_id => 3164,
            :amount => 20,
          :category => "referral_bonus",
        :expires_at => nil,
    :fulfillment_id => nil,
          :metadata => {
        "reason" => "referral"
    },
        :created_at => 2026-02-14 15:24:34.732491000 UTC +00:00,
        :updated_at => 2026-02-14 15:24:34.732491000 UTC +00:00
}
UsageCredits::Allocation (0) none

Audit trail

Audit trail
[
    [ 0] [
        [0] "subscription_credits",
        [1] 10,
        [2] {
            "subscription_id" => 1147,
                     "reason" => "first_cycle",
                       "plan" => "abcdef123456",
               "fulfilled_at" => "2026-02-14T13:59:07.491Z"
        }
    ],
    [ 1] [
        [0] "subscription_credits",
        [1] 10,
        [2] {
            "subscription_id" => 1148,
                     "reason" => "first_cycle",
                       "plan" => "abcdef123456",
               "fulfilled_at" => "2026-02-14T14:03:38.500Z"
        }
    ],
    [ 2] [
        [0] "credit_pack_purchase",
        [1] 10,
        [2] {
            "purchase_charge_id" => 2112,
                  "purchased_at" => "2026-02-14T14:03:47.912Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-02-14T14:03:47.914Z",
                 "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" => 2113,
                  "purchased_at" => "2026-02-14T14:04:41.592Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-02-14T14:04:41.595Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "tiny",
                       "credits" => 10,
                 "bonus_credits" => 0,
                   "price_cents" => 99,
                "price_currency" => "USD"
        }
    ],
    [ 4] [
        [0] "credit_pack_purchase",
        [1] 5100,
        [2] {
            "purchase_charge_id" => 2114,
                  "purchased_at" => "2026-02-14T14:05:38.655Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-02-14T14:05:38.658Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "pro",
                       "credits" => 5000,
                 "bonus_credits" => 100,
                   "price_cents" => 19900,
                "price_currency" => "USD"
        }
    ],
    [ 5] [
        [0] "credit_pack_purchase",
        [1] 5100,
        [2] {
            "purchase_charge_id" => 2115,
                  "purchased_at" => "2026-02-14T14:05:58.612Z",
             "credits_fulfilled" => true,
                  "fulfilled_at" => "2026-02-14T14:05:58.614Z",
                 "purchase_type" => "credit_pack",
                     "pack_name" => "pro",
                       "credits" => 5000,
                 "bonus_credits" => 100,
                   "price_cents" => 19900,
                "price_currency" => "USD"
        }
    ],
    [ 6] [
        [0] "referral_bonus",
        [1] 20,
        [2] {
            "reason" => "referral"
        }
    ],
    [ 7] [
        [0] "referral_bonus",
        [1] 20,
        [2] {
            "reason" => "referral"
        }
    ],
    [ 8] [
        [0] "bonus",
        [1] 10,
        [2] {
            "reason" => "expiring_bonus_credits"
        }
    ],
    [ 9] [
        [0] "bonus",
        [1] 10,
        [2] {
            "reason" => "expiring_bonus_credits"
        }
    ],
    [10] [
        [0] "referral_bonus",
        [1] 20,
        [2] {
            "reason" => "referral"
        }
    ],
    [11] [
        [0] "referral_bonus",
        [1] 20,
        [2] {
            "reason" => "referral"
        }
    ]
]

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
}