---
description: >-
  This API allows third-party services to establish organizations and associate
  new merchants with these organizations.
---

# Dynamic Provisioning

## Organization Provision Endpoint

<mark style="color:green;">`POST`</mark> `{UI_URL_ISSUED_BY_PAYTIKO}/api/dynamic-provision/organization`

#### Headers

<table><thead><tr><th width="177">Key</th><th width="113">Type</th><th width="121" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>Content-Type<mark style="color:red;">*</mark></td><td>String</td><td>true</td><td><code>application/json</code></td></tr><tr><td>Api-Key<mark style="color:red;">*</mark></td><td>String</td><td>true</td><td><code>{API_KEY_ISSUED_BY_PAYTIKO}</code></td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="170">Field</th><th width="99">Type</th><th width="114" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>String</td><td>true</td><td>Organization name.</td></tr><tr><td>user.firstName</td><td>String</td><td>false</td><td>User first name (or full name if last name cannot be provided).</td></tr><tr><td>user.lastName</td><td>String</td><td>false</td><td>User last name.</td></tr><tr><td>user.email</td><td>String</td><td>false</td><td>Unique user e-mail.</td></tr><tr><td>user.password</td><td>String</td><td>false</td><td>User password.</td></tr><tr><td>user.phone</td><td>String</td><td>false</td><td>Phone number.</td></tr></tbody></table>

{% hint style="warning" %}
Not all user object fields are required. If any field within the user object is left blank, it will be automatically generated by Paytiko.
{% endhint %}

{% tabs %}
{% tab title="200: OK " %}
```json
{
    "organizationSecretKey": "6b717772-8d6f-4d6c-bac6-d6a497e65a28"
}
```
{% endtab %}

{% tab title="400: Bad Request " %}
```json
{
    "errors": {
        "Name": [
            "The Name field is required."
        ]
    },
    "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
    "title": "One or more validation errors occurred.",
    "status": 400,
    "traceId": "00-48ba767b6ab8b363eda1015ab84acedf-7ad9d2a0aa6e49f8-00"
}
```
{% endtab %}

{% tab title="401: Unauthorized" %}
```json
"'ApiKey' header is required"
```
{% endtab %}
{% endtabs %}

## Merchant Provision Endpoint

<mark style="color:green;">`POST`</mark> `{UI_URL_ISSUED_BY_PAYTIKO}/api/dynamic-provision/merchant/{ORGANIZATION_KEY}`

Create a new merchant within a newly created organization. You can create unlimited number of merchants within one organization.

**Headers**

<table data-full-width="false"><thead><tr><th width="202">Key</th><th width="117">Type</th><th width="111" data-type="checkbox">Required</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type<mark style="color:red;">*</mark></td><td>String</td><td>true</td><td><code>application/json</code></td></tr><tr><td>Api-Key<mark style="color:red;">*</mark></td><td>String</td><td>true</td><td><code>{API_KEY_ISSUED_BY_PAYTIKO}</code></td></tr></tbody></table>

**Request Body**

<table><thead><tr><th width="176">Field</th><th width="133">Type</th><th width="126" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>String</td><td>true</td><td>Merchant name.</td></tr><tr><td>syncUrl<mark style="color:red;">*</mark></td><td>String</td><td>true</td><td>Webhook notification URL.</td></tr><tr><td>email</td><td>String</td><td>false</td><td>Merchant e-mail.</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}
```json
{
    "merchantSecretKey": "03e7277a72eb41bfb565053fc61873a9"
}
```
{% endtab %}

{% tab title="400" %}
```json
{
    "isSuccess": false,
    "errorMessage": "Merchant with provided e-mail already exists."
}
```
{% endtab %}
{% endtabs %}
