October 17, 2023 | 5 min read

Introducing Simulations 2.0

Marqeta
We are excited to announce the release of new capabilities offered by the Marqeta platform's Simulations 2.0 service. Simulations allow you to test functionality in the sandbox environment that would normally be triggered by an external event in a live environment, such as when a purchaser uses a payment card at a point of sale.
Simulations 2.0 introduces scalable, extensible support for a wide range of event types. It follows an API-driven approach where the structure of the service is defined by its API schema/specification.
With Simulations 2.0, you can replicate all supported transactions from the existising Simulations service using a single endpoint and single type of request object. All the related transaction events can be simulated using an endpoint such as:
  • /simulations/cardtransactions/*: Simulates transactions involving a card, such as a purchase or a refund back to the card
  • /simulations/directdeposits/*: Simulates event types related to deposit accounts
Support has recently been added to Simulations 2.0 for new transaction types such as Refund, Incremental Authorization, and Account Funding, as well as for additional original credit transactions (OCTs), multi-currency transactions, and more.

Simulating transactions in the Sandbox


The Marqeta platform’s Simulations 2.0 service is available for testing and feature exploration. You can quickly build, test, provision cards for testing, and simulate transactions in our public sandbox environment.
The sandbox environment provides a set of endpoints that enable you to simulate various types of common card network transactions, such as authorizations, reversals, and refunds.

Setting up your account


  • Sign in to your sandbox account and set up two-step verification.
  • When prompted, create your API sandbox on the Marqeta platform by clicking Create sandbox.

Marqeta

Once the sandbox is created, you will be redirected to the API keys page of the Marqeta Dashboard.
The API keys page provides you with a sandbox URL and credentials (application token, admin access token) that you will use when communicating with the Marqeta platform to simulate requests on your sandbox.
Marqeta
Now follow the steps below to create other prerequisites you will need to simulate various kinds of transaction events in the sandbox environment.

Creating a user


You can create a user by either running a cURL command or by using Postman.
Marqeta

After running the cURL, you should see a response like this:
Marqeta
Save the token generated in the response from the above POST call. This will be your user token, which you must supply later on in some calls to the Marqeta platform.

Creating a card product


The sandbox environment is provisioned with a card product called “Reloadable Card”. To create this kind of card, send a GET request to the /cardproducts endpoint and save the token returned in the response. This card product already has a funding type attached to it, so no extra steps are required to create a funding type or fund the card.
Marqeta
Save the token generated in the response from the above POST call. This will be your card products token, which you must supply later on in some calls to the Marqeta platform.

Creating a card


Next, create a card by making a POST call to the /cards endpoint. In your call, supply the user token and card product token that you generated in the previous steps.
Marqeta
Save the token generated in the response from the above POST call. This will be your card token, which you must supply later on in some calls to the Marqeta platform.

Simulating transactions


Now that you have created all these assets, you are ready to simulate various transaction events using the Marqeta platform's new Simulations 2.0 service.
Try simulating an authorization event by sending a POST request to the /simulations/cardtransactions/authorization endpoint. Remember to add the card token you generated previously.
Marqeta
Your response will be similar to that shown below, with the transaction type, status, impacted balance, available balance, and other fields indicated.
Marqeta

Adding a webhook


You can use webhooks to create and receive notifications for the transactions that take place in your sandbox environment. For example, when a card is used, a webhook is sent with details of the attempted transaction.
  In a sandbox environment, there are two ways you can create, configure, and manage webhooks:
  • Using the API Explorer
  • Using the Developer Tools UI in the Marqeta Dashboard, as described below

In order to receive and inspect the event notification, you must provide a URL that can accept the notification. Beeceptor provides a free online service that allows you to receive and inspect HTTP requests. To use this service, follow these steps:
1. Go to Beeceptor, create an account, then create an endpoint for receiving requests
2. Create a webhook endpoint to use with calls made from your sandbox.
3. Add the webhook to your sandbox in the URL field of the Webhooks page of the Marqeta Dashboard.
Marqeta

Marqeta
Once you have created a webhook for your sandbox and you have subscribed to events, you are ready to simulate another authorization transaction, but this time with an associated webhook. The webhook you created instructs the Marqeta platform to push an event notification of the transaction to the URL you specify. This simulated transaction is initiated by an API call and will receive a response that is identical to the webhook notification.
Simulate another request, as shown below, to try it out:
Marqeta
This request simulates a transaction authorization and will trigger the webhook notification. At that point, you should see a response similar to the following:
Marqeta

Postman Collection

Marqeta's Simulations 2.o service also provides Postman collections for the sandbox environment. You can download the Simulations 2.0 Postman collection file and import the OpenAPI YAML file in Postman using these steps:
  • In Postman, select Import to open the Import window.
  • Paste or drag-and-drop the downloaded Simulations 2.0 Postman collection file.
  • Choose to import the file as a Postman Collection or as OpenAPI 3.0 with a Postman Collection.
  • Select Import.
Marqeta

To learn more about Simulations 2.0


With Simulations 2.0, you can simulate a wide range of transaction events to reliably test your application and shorten your development time. To learn more about Simulation 2.0, see Card Transactions,
Direct Deposits and Postman Collection on Marqeta Docs.
Take a look at a recording of our Simulations 2.0 webinar here.
Written by Anita Patel, Senior Software Engineer, Core Products at Marqeta.
 

Keep ReadingSee all related articles

Top trends and opportunities for financial services in 2025
5 min read | May 30, 2025

Top trends and opportunities for financial services in 2025

Discover 3 trends reshaping financial services in 2025—and how embedded payments help you stay compliant, move fast, and deliver better customer experiences.
Top trends and opportunities for financial services in 2025
The rise of the financially integrated platform
5 min read | May 30, 2025

The rise of the financially integrated platform

Platform facilitators reshape business operations by embedding payments, streamlining compliance, automating reconciliation, enabling global reach, and driving user-centric innovation.
The rise of the financially integrated platform
Simplifying the process of card portfolio migration
5 min read | May 30, 2025

Simplifying the process of card portfolio migration

Migrating card programs doesn’t have to be painful. Marqeta simplifies the process with advanced tools, compliance expertise, and a seamless experience for cardholders.
Simplifying the process of card portfolio migration

Subscribe to our newsletter

Subscribe for the latest news, updates and trends.

Unsubscribe at any time. By entering your work email, you agree to receive marketing emails from Marqeta.

Launch your next payment innovation

Let's talk about your use case and how we can help.