---
title: "Create Transaction"
slug: "create-transaction"
updated: 2025-06-27T19:50:25Z
published: 2025-06-27T19:50:25Z
canonical: "docs.onespan.com/create-transaction"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onespan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Transaction

Transactions are the main resource in OneSpan Identity Verification (see also [Transaction model](/v1/docs/transaction-model)). This API creates and starts the execution of a new transaction:

- Create transactions with documents, signatures, signers, and an instance of the predefined workflow.
- Create transactions with predefined document templates.
- Create transactions by providing additional metadata that will be retained as electronic evidence.
- Create transactions with an instance of a predefined workflow to request identity validation checks to be executed through OneSpan Identity Verification.
- Create transactions that require implicit or explicit user consent. For an example request, see [Example request with explicit consent](/v1/docs/create-transaction#example-requests). For consent configuration, see [Transaction model](/v1/docs/transaction-model).

> The number of agreements may not exceed a total size of 50 MB, and the size of a single agreement must not exceed 10 MB.

## Syntax

```http
PUT /api/transaction/
```

## Examples

### Example requests

```http
PUT api/transaction/ HTTP/1.1
Host: onespan.com
Accept: application/json, text/javascript
 
{
  "tenant_id":"5e52d7b8-8b18-41a4-9187-d4ce75af6815",
  "workflow_id":"80b601c9-f102-4761-9eaa-90ba8fcb58b6",
  "urlSetKey":"default",
  "brand_id":"a089f718-f12d-4b13-b82e-e1d8b324337d",
  "language": "english",
  "opaque_id": "WorkflowExternalMitAtPwd=1234",
  "configuration": {
    "redirects": [
      {
        "id": "REDIRECT_DOCID_PASS",
        "url": "https://www.overriddenUrl.com/?user={{userRole}}&transaction={{transactionId}}&opaqueId={{opaqueId}}"
      }
    ]
  },
  "users"[...],
  "documents"[...]
}
```

#### Example request with explicit consent

```http
PUT api/transaction/ HTTP/1.1
Host: onespan.com
Accept: application/json, text/javascript
 
{
  "tenant_id":"5e52d7b8-8b18-41a4-9187-d4ce75af6815",
  "workflow_id":"80b601c9-f102-4761-9eaa-90ba8fcb58b6",
  "urlSetKey":"default",
  "brand_id":"a089f718-f12d-4b13-b82e-e1d8b324337d",
  "language": "english",
  "opaque_id": "WorkflowExternalMitAtPwd=1234",
  "configuration": {
    "redirects": [
      {
        "id": "REDIRECT_DOCID_PASS",
        "url": "https://www.overriddenUrl.com/?user={{userRole}}&transaction={{transactionId}}&opaqueId={{opaqueId}}"
      },
      "consent": {
        "explicit": true,
        "text": "I agree to the <URL link=\"myTermsURL"\> Terms and Conditions</URL> consent."
      }
    ]
  },
  "users"[...],
  "documents"[...]
}
```

### Example response

```http
HTTP/1.1 200 OK

Vary: Accept
Content-Type: application/json
{
  "id":"dcaad720-d1e9-47ba-a76b-a6370ef0373b",

  "status":"new",
  "created":"2017-04-23T18:25:43.511Z",
  "tokens": [...],
  ...

}
```

### Headers

The following headers are included in the request and the response:

#### Request headers

- [Accept](https://tools.ietf.org/html/rfc7231#section-5.3.2): The response content type depends on the Accept header.
- [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2): The OAuth/JWT token to authenticate.

#### Response headers

- [Content-Type](https://tools.ietf.org/html/rfc7231#section-3.1.1.5): application/json

### Status codes

<editor360-custom-block data-preprocessing="true" data-sanitizationtags="a"><div data-type="table-content"> <table width="100%" class=" fr-alternate-rows editor360-table" borderstyle="Solid"> <colgroup style="display:none;"> <col> <col style="width:250px;"> <col style="width:250px;"> </colgroup> <tbody> <tr> <td colspan="3" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="37d8507c-b583-4ef7-bfd6-f684be156997"><a name="Tab_Status_codes" display="false"></a><strong>Status codes</strong></p> </td> </tr> <tr> <th colspan="1" rowspan="1" class="TableStyle-Global-HeadE-Column-MainHeader" style="vertical-align:middle;text-align:left;"> <p data-block-id="61c4b964-bf59-48c0-b3e0-c24a46f8e5e4">Status code</p> </th> <th colspan="1" rowspan="1" class="TableStyle-Global-HeadE-Column-MainHeader" style="vertical-align:middle;text-align:left;"> <p data-block-id="0e3ee76f-508a-492f-93f9-7f86e57d3c4a">Name</p> </th> <th colspan="1" rowspan="1" class="TableStyle-Global-HeadD-Column-MainHeader" style="vertical-align:middle;text-align:left;"> <p data-block-id="054be626-b316-4302-99aa-255c72e5af77">Description</p> </th> </tr> <tr> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="4c71f7aa-12ba-4e1a-829a-0ad0048852c6"><span class="vdsCodeBasic" type="spanMark">200</span></p> </td> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="b2530c70-700b-40bb-86f3-62f45159d154"><span class="vdsCodeBasic" type="spanMark">OK</span></p> </td> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="d56dc64b-6e1e-4c5f-b2e5-ce968dd90b0d">No error.</p> </td> </tr> <tr> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="c60a0810-de08-4318-8c4c-e5ec3576dbc0"><span class="vdsCodeBasic" type="spanMark">400</span></p> </td> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="9cd91e9c-2688-4871-be5c-c15fd309c7d7"><span class="vdsCodeBasic" type="spanMark">Bad Request</span></p> </td> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="b8bad8b2-9ea8-4ad4-946a-5f995ec06e06">The transaction data is invalid.</p> </td> </tr> <tr> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="d043d853-9e4b-4113-93f8-2234f7b98729"><span class="vdsCodeBasic" type="spanMark">401</span></p> </td> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="014db84a-7145-4a44-87bc-fa98593912e5"><span class="vdsCodeBasic" type="spanMark">Unauthorized</span></p> </td> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="c8dba750-c965-484a-8eb1-109bf7dad989">Invalid token.</p> </td> </tr> <tr> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="8a81deb8-184b-4cfb-9f91-bded143fd128"><span class="vdsCodeBasic" type="spanMark">403</span></p> </td> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="1fbda662-0376-46de-ab7f-de6f083b4be9"><span class="vdsCodeBasic" type="spanMark">Forbidden</span></p> </td> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="498a72c7-72a6-454f-8814-30aaca7dc740">The token does not grant transaction creation rights.</p> </td> </tr> <tr> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="f1248baf-cc1a-49bd-9ea4-43cbc97a91e1"><span class="vdsCodeBasic" type="spanMark">500</span></p> </td> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="8d1d061d-f3ab-4ccc-97e2-f89cd609855c"><span class="vdsCodeBasic" type="spanMark">Internal Server Error</span></p> </td> <td colspan="1" rowspan="1" colwidth="NaN" style="vertical-align:middle;text-align:left;"> <p data-block-id="502036a6-ea22-4b0b-9dd0-52a490716e23">Server or application error.</p> </td> </tr> </tbody> </table></div></editor360-custom-block>
