API template library

Plaid Link & Tokens mock API and live sandbox

A WireMock simulation of Plaid's REST API — covering Link token creation, public-token exchange, Hosted Link sessions, and Layer session tokens.

Vendor
Plaid
Functionality
Link sessions and token exchange
Spec version
2020-09-14_1.688.6
Endpoints
9
Stubs
11
Protocol
REST
Validation
AI-validated Before publication, an AI agent exercised these endpoints against the real Plaid API through WireMock's recording proxy, and the recorded traffic was used to verify each stub's request and response shapes.

Live sandbox · no signup, no API key

Plaid Link & Tokens

A running WireMock Cloud instance of this template, callable right now from a terminal, a script, or an AI agent.

Base URL
https://mjml3.wiremockapi.cloud

POST Create Link Token

curl -s -X POST 'https://mjml3.wiremockapi.cloud/link/token/create' \
  -H 'Content-Type: application/json' \
  -d '{}'

POST Create Sandbox Public Token

curl -s -X POST 'https://mjml3.wiremockapi.cloud/sandbox/public_token/create' \
  -H 'Content-Type: application/json' \
  -d '{}'

POST Create Item Public Token

curl -s -X POST 'https://mjml3.wiremockapi.cloud/item/public_token/create' \
  -H 'Content-Type: application/json' \
  -d '{}'
Method Path Summary
POST /item/public_token/create Create public token
POST /item/public_token/exchange Exchange public token for an access token
POST /link_delivery/create Create Hosted Link session
POST /link_delivery/get Get Hosted Link session
POST /link/oauth/correlation_id/exchange Exchange the Link Correlation Id for a Link Token
POST /link/token/create Create Link Token
POST /link/token/get Get Link Token
POST /sandbox/public_token/create Create a test Item
POST /session/token/create Create a Link token for Layer

Unauthenticated WireMock Cloud demo sandbox for Plaid — not an official Plaid sandbox, and it returns simulated example data only.

What's inside the Link & Tokens template

This template is the opening move of every Plaid integration — the token choreography that precedes any data call. Its stubs mint rather than replay: each POST to /link/token/create issues a fresh link-sandbox-prefixed token built around a new UUID, and the exchange endpoint answers with an equally fresh access-sandbox token beside an item_id. Code that stores tokens, checks their prefixes, or asserts that two sessions never share a credential gets realistic churn instead of one frozen string.

  • Link tokens — creation with per-call minted values, plus a get route that answers with a deliberate error
  • Public-token exchange — /item/public_token/exchange trading a public token for an access token and item id
  • Test-Item bootstrap — /sandbox/public_token/create, the shortcut past the Link UI that Plaid's own sandbox offers
  • Hosted Link — session creation returning a secure.plaid.com-style delivery URL and session id
  • OAuth re-entry — the correlation-id exchange that resumes Link after a bank's OAuth redirect
  • Layer — /session/token/create nesting a link token inside its session envelope

Example implementation using plaid-python

plaid-python points at any host through its Configuration object — swap the sandbox in for plaid.Environment.Production and the client is redirected, credential pair and all:

Plaid's Node, Ruby, Java, and Go libraries expose the same base-path setting on their configuration objects, so whichever runtime your backend uses, the redirect is one field — and once you have a private copy of the template in WireMock Cloud, its URL drops into the same slot.

The token dance is backend-only code, which makes it the part of a Plaid integration best suited to mocking: your /create-link-token and /exchange endpoints can run in CI on every push, with no dashboard keys provisioned and no real client_id's quota spent on test traffic.

import plaid
from plaid.api import plaid_api
from plaid.model.link_token_create_request import LinkTokenCreateRequest
from plaid.model.link_token_create_request_user import LinkTokenCreateRequestUser
from plaid.model.products import Products
from plaid.model.country_code import CountryCode

configuration = plaid.Configuration(
    host="https://mjml3.wiremockapi.cloud",
    # required by the client, ignored by the mock
    api_key={"clientId": "any-value", "secret": "any-value"},
)
client = plaid_api.PlaidApi(plaid.ApiClient(configuration))

resp = client.link_token_create(
    LinkTokenCreateRequest(
        client_name="My App",
        language="en",
        country_codes=[CountryCode("US")],
        user=LinkTokenCreateRequestUser(client_user_id="user-123"),
        products=[Products("auth")],
    )
)
print(resp.link_token)

Frequently asked questions

Plaid reads credentials from the JSON request body rather than an Authorization header — and this mock reads neither. The token routes match on path alone, so a body of {} earns the same minted token as a fully-credentialed request. Keep a production keypair out of anything you send here; the instance is reachable by anyone.

That stub is intentionally unhappy. It returns Plaid's INVALID_INPUT envelope — error_type, error_code INVALID_FIELD, the message "could not find the requested link_token" — so the error-parsing branch of your client gets exercised with vendor-authentic grammar while every other route stays on the success path.

No — Plaid's hosted UI validates tokens against Plaid's servers, which have never heard of the mock's UUIDs, and the Hosted Link delivery URL points at a secure.plaid.com session that does not exist. The template's territory is your server side: token issuance, storage, exchange, and the item bookkeeping that follows.

Feed it onward. The product templates accept any access_token value, so a test can run the full handoff — mint here, exchange, then call the Transactions template with the result — mirroring the sequence a production integration performs after a user completes Link.

Vendor names identify APIs represented by WireMock template sources. This page does not imply vendor endorsement, certification, partnership, or official integration status.