Create a test Item

POST /sandbox/public_token/create

Use the /sandbox/public_token/create endpoint to create a valid public_token for an arbitrary institution ID, initial products, and test credentials. The created public_token maps to a new Sandbox Item. You can then call /item/public_token/exchange to exchange the public_token for an access_token and perform all API actions. /sandbox/public_token/create can also be used with the user_custom test username to generate a test account with custom data, or with Plaid's pre-populated Sandbox test accounts.

Request Body

Required

SandboxPublicTokenCreateRequest defines the request schema for /sandbox/public_token/create

Parameters

client_id
string
Your Plaid API client_id. The client_id is required and may be provided either in the PLAID-CLIENT-ID header or as part of a request body.
secret
string
Your Plaid API secret. The secret is required and may be provided either in the PLAID-SECRET header or as part of a request body.
institution_id
required, string
The ID of the institution the Item will be associated with
initial_products
required, array[string]
The products to initially pull for the Item. May be any products that the specified institution_id supports. This array may not be empty.
options
object
An optional set of options to be used when configuring the Item. If specified, must not be null.
webhook
string
Specify a webhook to associate with the new Item.
override_username
string
Test username to use for the creation of the Sandbox Item. Default value is user_good.
override_password
string
Test password to use for the creation of the Sandbox Item. Default value is pass_good.
transactions
object
An optional set of parameters corresponding to transactions options.
start_date
string
The earliest date for which to fetch transaction history. Dates should be formatted as YYYY-MM-DD.
end_date
string
The most recent date for which to fetch transaction history. Dates should be formatted as YYYY-MM-DD.
days_requested
integer
The maximum number of days of transaction history to request for the Transactions product.
statements
object
An optional set of parameters corresponding to statements options.
start_date
required, string
The earliest date for which to fetch statements history. Dates should be formatted as YYYY-MM-DD.
end_date
required, string
The most recent date for which to fetch statements history. Dates should be formatted as YYYY-MM-DD.
income_verification
object
A set of parameters for income verification options. This field is required if income_verification is included in the initial_products array.
income_source_types
array[string]
The types of source income data that users will be permitted to share. Options include bank and payroll. Currently you can only specify one of these options.
bank_income
object
Specifies options for Bank Income. This field is required if income_verification is included in the initial_products array and bank is specified in income_source_types.
days_requested
integer
The number of days of data to request for the Bank Income product
user_token
string
The user token associated with the User data is being requested for.

Response

SandboxPublicTokenCreateResponse defines the response schema for /sandbox/public_token/create

Response Properties

public_token
required, string
A public token that can be exchanged for an access token using /item/public_token/exchange
request_id
required, string
A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.