Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Overview
Start an integration
Products
Global Payouts
Capital
Issuing cards
    Overview
    How Issuing works
    Global availability
    Manage fraud
    Cards
    Choose your card type
    Virtual cards
    Issue virtual cards
    Physical cards
    Manage cards
    Digital wallets
    Replacement cards
    Card programmes
    Programme management
    Customise your card programme
    Add funds to your card programme
    Credit Consumer Issuing
    Controls
    Spending controls
    Advanced fraud tools
    3DS
    Fraud challenges
    Real-time authorisations
    PIN management
    Issuing Elements
    Token Management
    Funding
    Balance
    Post-fund your integration with Stripe
    Post-fund your integration with Dynamic Reserves
    Purchases
    Authorisations
    Transactions
    Disputes
    Testing
    Merchant categories
    ATM Usage
    Issuing with Connect
    Set up an Issuing and Connect integration
    Update terms of service acceptance
    Connect funding
    Connected accounts, cardholders, and cards
    Embed card management UI
    Credit
    Overview
    Set up connected accounts
    Manage credit terms
    Report other credit decisions and manage AANs
    Report required regulatory data for credit decisions
    Manage account obligations
    Test credit integration
    Additional information
    Choose a cardholder type
    Customer support for Issuing and Treasury
    Issuing watchlist
    Marketing guidance (Europe/UK)
    Product and marketing compliance guidance (US)
Treasury
Manage money
HomeMoney managementIssuing cards

Testing Issuing

Learn how to test your integration and simulate purchases.

Copy page

Testing payments

Learn more about testing your Stripe integration.

You can issue cards and simulate purchases using your own Stripe integration in a sandbox environment. This allows you to test your integration before you go live without having to make real purchases. You can only use these cards for testing within your Stripe account and not for external purchases.

Caution

When testing your authorisation endpoint, make sure that you have set the test endpoint in your Issuing settings. You can view test data by switching into your sandbox environment.

Fund your test Issuing balance

Before you create test transactions, you must add test funds to the Issuing balance on your account. These aren’t real funds, and you can only use them for simulating test purchases.

Issuing users in the US

Issuing users in the US use “pull” funding, and use Top-ups to fund their Issuing balance. You can create test top-ups in the Dashboard, or with the Top-ups API. Learn more about funding Issuing balances for US users.

Issuing users in the UK and euro area

To top up their balance, Issuing users in the UK and Europe “push” funds using Funding Instructions. You can do this in your sandbox environment, which you access from the Dashboard, or with the Funding Instructions API. Learn more about funding Issuing balances for UK and euro area users.

Create a card
Server-side

Create a cardholder with a name, billing address, and entity type. You can also provide additional information, if necessary.

Command Line
cURL
curl https://api.stripe.com/v1/issuing/cardholders \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d name="Jenny Rosen" \ --data-urlencode email="jenny.rosen@example.com" \ --data-urlencode phone_number="+18008675309" \ -d status=active \ -d type=individual \ -d "individual[first_name]"=Jenny \ -d "individual[last_name]"=Rosen \ -d "individual[dob][day]"=1 \ -d "individual[dob][month]"=11 \ -d "individual[dob][year]"=1981 \ -d "billing[address][line1]"="123 Main Street" \ -d "billing[address][city]"="San Francisco" \ -d "billing[address][state]"=CA \ -d "billing[address][postal_code]"=94111 \ -d "billing[address][country]"=US

Next, create a Card for the cardholder.

Command Line
cURL
curl https://api.stripe.com/v1/issuing/cards \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d cardholder=
{{CARDHOLDER_ID}}
\ -d type=virtual \ -d currency=usd \ -d status=active

Create an authorisation
Server-side

An Authorisation represents a cardholder’s attempt to make a purchase on a card. You can simulate the creation of an authorisation in test-mode with the Authorisation test helpers API.

Command Line
cURL
curl https://api.stripe.com/v1/test_helpers/issuing/authorizations \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d card=
{{CARD_ID}}
\ -d amount=1000 \ -d authorization_method=chip \ -d "merchant_data[category]"=taxicabs_limousines \ -d "merchant_data[city]"="San Francisco" \ -d "merchant_data[country]"=US \ -d "merchant_data[name]"="Rocket Rides" \ -d "merchant_data[network_id]"=1234567890 \ -d "merchant_data[postal_code]"=94107 \ -d "merchant_data[state]"=CA

After you configure real-time authorisations, Stripe sends the issuing_authorization.request webhook event. You can respond to this event directly to approve or decline it. Learn more about the real-time authorisation endpoint builder.

Capture an authorisation
Server-side

After approval, an Authorisation is in a pending state while it waits for capture. You can simulate capture of the authorisation with the API.

Command Line
cURL
curl -X POST https://api.stripe.com/v1/test_helpers/issuing/authorizations/
{{AUTHORIZATION_ID}}
/capture
\ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"

This generates a new Transaction resource and the Authorisation status updates to closed.

Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access programme.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc