Skip to main content
The Marqeta platform provides you with a production environment and a sandbox. The main difference between the production and sandbox environments is that your production environment communicates with a payment card network. This communication allows your program’s cards to pay for goods and services by initiating live transactions over the card network. There are two types of sandbox environments available:
  • Public sandbox: A single-user environment where you can begin building your program and experiment with the Marqeta platform.
  • Private sandbox: A multi-user environment where you can integrate your application with the Marqeta platform.
All funds and transactions are simulated in both types of sandbox environments. Unlike the production environment, a sandbox does not communicate with a card network, so the cards you create within them cannot be used to conduct real-world transactions. Therefore, you must rely on simulated transactions in order to test all objects you create within a sandbox. The sandbox environments provide a set of endpoints that let you simulate various types of card network transactions, such as authorizations, reversals, and balance inquiries. These endpoints are available only within the sandbox, so the details on this page do not apply to production. To use the Simulations API for card transactions:
  • Create a card in your sandbox environment.
  • Use the /simulations/cardtransactions/* endpoints to simulate transaction event types. Each endpoint is its own event type.
  • Use the /webhooks endpoint to send optional customer notifications for system events.
To use the Simulations API for direct deposits, see Simulations 2.0 — Direct Deposits.
Note
You can use Postman to run requests for card transaction and direct deposit simulations endpoints. This collection of requests has been saved as a YAML file for your convenience. To access the YAML file, see Postman Collection for Simulations 2.0.
All card transaction simulations endpoints share the same request/response model, as described below.

Request body

Response body

International card transactions and currency conversion

With Simulations 2.0, you can simulate international card transactions based on currency and location.

Authorization events with currency conversion

You can add currency conversion when simulating an authorization-type transaction by including the currency_conversion object and related details in a POST request to the /simulations/cardtransactions/authorization endpoint. For information about the /simulations/cardtransactions/authorization endpoint, see Simulate authorization. The following example shows an authorization-type transaction, with currency conversion, for a United States card transacting in the United Kingdom. See the full request body structure at Request body.

Sample request body

JSON
See the full response body structure at Response body.

Sample response body

JSON

Clearing events with currency conversion

You can add currency conversion when simulating an authorization.clearing-type transaction by including the currency_conversion object and related details in a POST request to the /simulations/cardtransactions/authorization.clearing endpoint. For more information about the /simulations/cardtransactions/authorization.clearing endpoint, see Simulate authorization clearing. The following example shows an authorization.clearing-type transaction, with currency conversion, for a United States card in the United Kingdom. See the full request body structure at Request body.

Sample request body

JSON
See the full response body structure at Response body.

Sample response body

JSON

Transactions with Account Name Inquiry

Account Name Inquiry (ANI) is an account verification feature that is supported by both the Mastercard and Visa card networks. You can simulate the ANI feature with Simulations 2.0. For more information about ANI, see About Account Name Inquiry. You can add account name verification when simulating an authorization transaction by including the account_name_verification object and related details in a POST request to the /simulations/cardtransactions/authorization endpoint. For information about the /simulations/cardtransactions/authorization endpoint, see Simulate authorization.

ANI for Visa

The following example shows an authorization transaction, with account name verification, for the Visa network. See the full request body structure at Request body.

Sample request body

JSON
See the full response body structure at Response body.

Sample response body

JSON

ANI for Mastercard

The following example shows an authorization transaction, with account name verification, for the Mastercard network. See the full request body structure at Request body.

Sample request body

JSON
See the full response body structure at Response body.

Sample response body

JSON

Transactions with Visa Flexible Credential

The Visa Flexible Credential (VFC) feature allows cardholders to use their debit card for Buy Now, Pay Later (BNPL) credit transactions when you approve that transaction from your Just-in-Time Funding Gateway. By integrating VFC in your program, a single card product can toggle between debit and credit payment methods based on each transaction, bringing multiple funding sources to a single card. You can simulate VFC transactions for authorization, authorization.reversal, authorization.incremental, and refund.authorization transaction by including the flex object and related details in a POST request to the following endpoints:
  • /simulations/cardtransactions/authorization
  • /simulations/cardtransactions/authorization.reversal
  • /simulations/cardtransactions/authorization.incremental
  • /simulations/cardtransactions/refund.authorization
For information about the /simulations/cardtransactions/* endpoints, see Simulate authorization.

Authorization Transaction with VFC

The following example shows an authorization transaction with VFC for the Visa network.

Sample request body

See the full request body structure at Request body.
JSON

Sample response body

JSON
For more information about how to incorporate Visa Flexible Credential support in your program, contact your Marqeta representative.

Simulate authorization

Action: POST
Endpoint: /simulations/cardtransactions/authorization
Authorization is the process of confirming whether a card is valid, business rules are met, and funds are sufficient, and then placing a temporary hold on those funds. Use this endpoint to simulate an authorization type transaction by including the card_token and other authorization details in your request. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See Authorization Event.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate authorization advice

Action: POST
Endpoint: /simulations/cardtransactions/authorization.advice
Authorization advice allows an amount to be decreased after the authorization. This endpoint allows you to simulate post-swipe adjustments. Simulate an authorization.advice transaction by including the preceding_related_transaction_token and other authorization details in your request. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate authorization clearing

Action: POST
Endpoint: /simulations/cardtransactions/authorization.clearing
Clearing is the process of finalizing the hold on funds and posting the transaction on the cardholder’s account. This process is triggered by the merchant’s capture request. This endpoint simulates an authorization.clearing type transaction by including the preceding_related_transaction_token and amount in your request. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See Authorization Clearing Event.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate authorization reversal

Action: POST
Endpoint: /simulations/cardtransactions/authorization.reversal
A reversal releases the hold that was placed on account funds by an authorization, thus returning the funds to the account. This endpoint simulates an authorization.reversal type transaction by including the original_transaction_token and amount in your request. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate incremental authorization

Action: POST
Endpoint: /simulations/cardtransactions/authorization.incremental
Use this endpoint to simulate incremental authorization transactions. An incremental authorization is a request to add an additional dollar amount to an ongoing prior authorization. This type of transaction enables you to increase the final amount authorized as conditions change or additional charges accrue. A common use case is adding the gratuity (an incremental authorization) to the original total (a prior authorization) of a restaurant bill. For this use case, you use two endpoints: one to create the authorization, and another to increment it.
  • Create the authorization using the /simulations/cardtransactions/authorization endpoint:
    Action: POST
    Endpoint: /simulations/cardtransactions/authorization
  • Increment the authorization using the /simulations/cardtransactions/authorization.incremental endpoint:
    Action: POST
    Endpoint: /simulations/cardtransactions/authorization.incremental
You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate authorization cash back

Action: POST
Endpoint: /simulations/cardtransactions/authorization.cashback
Use this endpoint to simulate authorization.cashback transactions, which covers authorization for cash back requested at a point-of-sale terminal. This simulation can be used to test dual-message cash back transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate ATM withdrawal authorization

Action: POST
Endpoint: /simulations/cardtransactions/authorization.atm.withdrawal
Use this endpoint to simulate authorization.atm.withdrawal transactions. In the EU, this includes authorization for withdrawing cash at an ATM. In the US, this event indicates that the cardholder got cash from a bank teller rather than an ATM. This simulation can be used to test dual-message ATM withdrawal transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate ATM withdrawal authorization clearing

Action: POST
Endpoint: /simulations/cardtransactions/authorization.clearing.atm.withdrawal
Use this endpoint to simulate authorization.clearing.atm.withdrawal transactions, which completes an authorization for withdrawing cash at an ATM. This simulation can be used to test dual-message ATM withdrawal transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate quasi-cash authorization

Action: POST
Endpoint: /simulations/cardtransactions/authorization.quasi.cash
Use this endpoint to simulate authorization.quasi.cash transactions. This is for authorization at a point-of-sale terminal for items equivalent to cash, such as traveler’s checks, money orders, foreign currency, or gaming chips. This simulation can be used to test dual-message quasi-cash transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate quasi-cash authorization clearing

Action: POST
Endpoint: /simulations/cardtransactions/authorization.clearing.quasi.cash
Use this endpoint to simulate authorization.clearing.quasi.cash transactions, which completes an authorization at a point-of-sale terminal for items equivalent to cash, such as traveler’s checks, money orders, foreign currency, or gaming chips. This simulation can be used to test dual-message quasi-cash transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate AFT authorization

Action: POST
Endpoint: /simulations/cardtransactions/account.funding.authorization
Use this endpoint to simulate Account Funding Transactions (AFTs) using account.funding.authorization. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate AFT authorization clearing

Action: POST
Endpoint: /simulations/cardtransactions/account.funding.authorization.clearing
Use this endpoint to simulate account.funding.authorization.clearing transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate AFT authorization reversal

Action: POST
Endpoint: /simulations/cardtransactions/account.funding.authorization.reversal
Use this endpoint to simulate account.funding.authorization.reversal transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate AFT authorization and capture

Action: POST
Endpoint: /simulations/cardtransactions/account.funding.auth_plus_capture
Use this endpoint to simulate account.funding.auth_plus_capture transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate AFT authorization and capture reversal

Action: POST
Endpoint: /simulations/cardtransactions/account.funding.auth_plus_capture.reversal
Use this endpoint to simulate account.funding.auth_plus_capture.reversal transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate refund

Action: POST
Endpoint: /simulations/cardtransactions/refund
Use this endpoint to simulate an offline refund. Refunds are not associated with a token, so a preceding_related_transaction_token is not needed. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate refund authorization

Action: POST
Endpoint: /simulations/cardtransactions/refund.authorization
Online refund refers to the refund.authorization messages that Visa and Mastercard merchants can send to card issuers. These refund authorizations allow merchants to notify customers of a pending refund and give card issuers the opportunity to decline a refund. Like purchase authorizations, refund authorizations are eventually cleared or completed by a refund.authorization.clearing event. That refund authorization clearing is automatically accepted and processed by the Marqeta platform, regardless of your funding model. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate refund authorization reversal

Action: POST
Endpoint: /simulations/cardtransactions/refund.authorization.reversal
Use this endpoint to reject refund.authorization transactions for online refunds. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate refund authorization clearing

Action: POST
Endpoint: /simulations/cardtransactions/refund.authorization.clearing
Use this endpoint to simulate online refund clearing. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate PIN-debit

Action: POST
Endpoint: /simulations/cardtransactions/pindebit
Use this endpoint to simulate transactions using network debit rails. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate PIN-debit reversal

Action: POST
Endpoint: /simulations/cardtransactions/pindebit.reversal
Use this endpoint to simulate transactions using network debit rails. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate PIN-debit authorization

Action: POST
Endpoint: /simulations/cardtransactions/pindebit.authorization
Use this endpoint to simulate PIN-debit authorization transactions. The typical use case for dual-message PIN-debit transactions is automated fuel dispenser transactions. The pump sends an initial authorization message to the card issuer. When fueling completes, a clearing message is sent with the final amount. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate PIN-debit authorization clearing

Action: POST
Endpoint: /simulations/cardtransactions/pindebit.authorization.clearing
Use this endpoint to clear pindebit.authorization transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate PIN-debit authorization reversal

Action: POST
Endpoint: /simulations/cardtransactions/pindebit.authorization.reversal
Use this endpoint to reverse pindebit.authorization transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate PIN-debit cash back

Action: POST
Endpoint: /simulations/cardtransactions/pindebit.cashback
Simulate a PIN-debit transaction for cash back requested at a point-of-sale terminal. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate PIN-debit refund

Action: POST
Endpoint: /simulations/cardtransactions/pindebit.refund
Use this endpoint to simulate a PIN-debit transaction refund. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate PIN-debit ATM withdrawal

Action: POST
Endpoint: /simulations/cardtransactions/pindebit.atm.withdrawal
Use this endpoint to simulate a cash withdrawal at an ATM. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate PIN-debit balance inquiry

Action: POST
Endpoint: /simulations/cardtransactions/pindebit.balanceinquiry
Use this endpoint to simulate a balance inquiry via the card network. This is a non-financial transaction. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate PIN-debit quasi-cash

Action: POST
Endpoint: /simulations/cardtransactions/pindebit.quasi.cash
Use this endpoint to simulate pindebit.quasi.cash transactions. This PIN-debit transaction occurs at a point-of-sale terminal for items equivalent to cash, such as traveler’s checks, money orders, foreign currency, or gaming chips. This simulation can be used to test single-message cash back transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate OCT authorization

Action: POST
Endpoint: /simulations/cardtransactions/original.credit.authorization
Use this endpoint to simulate original.credit.authorization transactions. This is for original credit transaction (OCT) authorization for disbursing funds to a credit card. This simulation can be used to test dual-message OCT transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate OCT authorization clearing

Action: POST
Endpoint: /simulations/cardtransactions/original.credit.authorization.clearing
Use this endpoint to simulate original.credit.authorization.clearing transactions, which completes an original credit transaction (OCT) authorization. This simulation can be used to test dual-message OCT transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate OCT authorization and capture

Action: POST
Endpoint: /simulations/cardtransactions/original.credit.auth_plus_capture
Use this endpoint to simulate original.credit.auth_plus_capture transactions for single-message original credit transaction (OCT) for disbursing funds to a credit card. This simulation can be used to test single-message OCT transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate OCT authorization and capture reversal

Action: POST
Endpoint: /simulations/cardtransactions/original.credit.auth_plus_capture.reversal
Use this endpoint to simulate original.credit.auth_plus_capture.reversal transactions to reverse the financial impact of a single-message original credit transaction (OCT). This simulation can be used to reverse single-message OCT transactions. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON

Simulate Product Inquiry

Action: POST
Endpoint: /simulations/cardtransactions/product.inquiry
Use this endpoint to simulate a product.inquiry type transaction. You can view the full request body structure on the Simulations 2.0 — Card Transactions page.

Request body

See the full request body structure at Request body.

Sample request body

JSON

Response body

See Card Transaction Simulation Response.

Sample response body

JSON