---
title: "Test mode only (409 `sandbox_only` otherwise): finish a test setup with one of the two test cards, `success` (Visa ending 4242) or `decline` (ending 0002, which declines every charge). `sessionId` is the `session` parameter of the URL that `POST /v1/payment-method/setup` returned for the test key"
method: POST
path: "/v1/payment-method/test-setup"
---

# Test mode only (409 \`sandbox_only\` otherwise): finish a test setup with one of the two test cards, \`success\` (Visa ending 4242) or \`decline\` (ending 0002, which declines every charge). \`sessionId\` is the \`session\` parameter of the URL that \`POST /v1/payment-method/setup\` returned for the test key

`POST /v1/payment-method/test-setup`

## Request

- Base URL: `https://api.evictionsapi.com`
- URL: `https://api.evictionsapi.com/v1/payment-method/test-setup`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

## Request body

- object
  - `sessionId` string, required
  - `card` 'success' | 'decline', required

## Response `200`

Where to send the customer next: the setup's return URL.

- object
  - `returnUrl` string, uri, required

## Other responses

- `400`: The request is invalid.
- `401`: The credential is missing or invalid.
- `403`: The credential is not allowed to do this (`forbidden`). For a signed-in session: `permission_denied`, the person's role in the organization lacks the permission this needs (ask an owner); `no_organization`, the person belongs to no organization yet (start one with `POST /v1/me/organizations` or accept an invitation).
- `404`: Not found.
- `409`: The request conflicts with the current state: for a case, it is not in a state that allows this, or its details were erased (`erased`); for an API key, a limit or the key in use.
- `422`: The case did not pass a check.

---

[API](https://skmtc.dev/evictionsapi/apis/evictions-api.md) · [All operations](https://skmtc.dev/evictionsapi/apis/evictions-api/llms.txt) · [OpenAPI document](https://skmtc.dev/evictionsapi/apis/evictions-api/revisions/28459213a1a3?raw)
