Simple Store Credit

How can we help?

Search the documentation or ask the AI agent anything about the plugin.

Action and filter hooks

Updated September 14, 2026

The plugin fires actions as credit moves and exposes filters for most of its decisions. The lists below cover the hooks most likely to be useful; they are all documented inline in the source alongside their arguments.

Credit movement actions

  • sscp_credit_added( $user_id, $amount, $type, $note, $args ) after credit lands on a balance.
  • sscp_credit_deducted( $user_id, $amount, $type, $note, $args ) after credit is taken off.
  • sscp_balance_adjusted( $user_id, $change, $new_balance, $type ) on any change, in either direction.
  • sscp_credit_awarded( $user_id, $amount, $delivery, $args ) after an award, whichever way it was delivered.
  • sscp_award_credit_failed( $user_id, $amount, $args, $error ) when an award could not be delivered at all.
  • sscp_credit_debt_added( $user_id, $amount ) when a clawback could not be fully recovered.

sscp_balance_changed_locked fires while the per-user lock is still held. It exists so expiry tracking can mirror a change atomically – keep anything hooked there fast, and do not start slow work inside it.

Voucher and gifting actions

  • sscp_voucher_created( $voucher_id, $args )
  • sscp_voucher_issued_to_user
  • sscp_gift_voucher_created, sscp_gift_balance_transferred, sscp_giftcard_gifted

Commonly used filters

  • sscp_credit_label – the store credit label.
  • sscp_get_balance( $balance, $user_id ), for display adjustments only. It does not change the stored figure.
  • sscp_award_credit_amount( $amount, $user_id, $args ) before an award is made.
  • sscp_cart_redeemable_max( $max, $cart ) to change the maximum credit a cart accepts.
  • sscp_allow_earn_for_order and sscp_order_earned_credit – gate or adjust cashback per order.
  • sscp_account_endpoint – the My Account endpoint slug. Re-save permalinks after changing it.
  • sscp_ways_to_get_credit and sscp_ways_to_redeem_credit – the Overview tab content.
  • sscp_email_merge_tags, sscp_email_replacements, sscp_email_registry, sscp_email_default_templates – the email system.
  • sscp_mc_provider, sscp_mc_rate, sscp_mc_enabled – currency detection and conversion.
  • sscp_unpaid_order_credit_hold_days – the grace period before an unpaid order’s credit hold is released. Defaults to 7.
  • sscp_migration_plugin_definitions – add another wallet plugin as a migration source.
  • sscp_option_fields – the settings schema, for adding your own fields.

Example: add a bonus on a customer’s first order

// PHP
add_filter( 'sscp_award_credit_amount', function ( $amount, $user_id, $args ) {
    if ( 'earn' !== $args['source'] ) {
        return $amount;
    }
    $orders = wc_get_orders( array(
        'customer_id' => $user_id,
        'status'      => array( 'completed' ),
        'limit'       => 2,
        'return'      => 'ids',
    ) );
    return ( count( $orders ) <= 1 ) ? $amount + 5 : $amount;
}, 10, 3 );

Related

Was this article helpful?