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

# Create Merchant Markup Configuration

> Create markup configuration for a merchant by product and payment method.

Use this endpoint to configure markup rules for a merchant, defining how much additional amount will be charged per product and payment method.

## Request Body

**account\_id** `integer` *required*

ID of the merchant that will receive the markup.

**parent\_id** `integer`

Optional parent relationship ID. Can be used to associate this markup to a parent account or hierarchy level.

**product** `string` *required*

Product where the markup will be applied.

Allowed values: `payin`, `payout`

**payment\_method** `string` *required*

Payment method where the markup will be applied.

Allowed values: `pix`, `billet`, `credit_card`

**type** `string` *required*

Markup scope type.

Currently, only `global` is supported externally.

**mode** `string` *required*

Type of markup to be applied.

Allowed values:

* `fixed`: fixed amount per charge
* `percent`: percentage over the charge amount

**amount** `number` *required*

Markup value to be applied.

Constraints:

* Must be greater than or equal to `0.01`.

**min\_charge\_value** `number`

Minimum markup amount when mode is `percent`.

Business rules:

* **Required** when `mode` = `percent`
* **Prohibited** when `mode` = `fixed`
* Must be greater than or equal to `0.01`

**max\_charge\_value** `number`

Maximum markup amount when mode is `percent`.

Business rules:

* **Optional**
* Must be greater than or equal to `min_charge_value`
* **Prohibited** when `mode` = `fixed`

> [!WARNING]
>
> When `mode` is `fixed`, do **not** send `min_charge_value` or `max_charge_value`.

## Request Examples

```json Percent markup example theme={null}
{
  "account_id": 123,
  "product": "payin",
  "payment_method": "pix",
  "type": "global",
  "mode": "percent",
  "amount": 2.5,
  "min_charge_value": 1.0,
  "max_charge_value": 100.0
}
```

```json Fixed markup example theme={null}
{
  "account_id": 123,
  "product": "payout",
  "payment_method": "pix",
  "type": "global",
  "mode": "fixed",
  "amount": 5.0
}
```

```bash cURL theme={null}
curl -X POST "https://api.sandbox.wepayout.com.br/v2/account/markup" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": 123,
    "product": "payin",
    "payment_method": "pix",
    "type": "global",
    "mode": "percent",
    "amount": 2.5,
    "min_charge_value": 1.0,
    "max_charge_value": 100.0
  }'
```

## Response

**id** `integer`

Markup configuration ID.

**product** `string`

Product where the markup is applied.

**payment\_method** `string`

Payment method where the markup is applied.

**account\_id** `integer`

Merchant ID that receives the markup.

**parent\_id** `integer or null`

Parent relationship ID, when applicable.

**type** `string`

Markup scope type. Example: `global`.

**mode** `string`

Markup mode. Example: `fixed` or `percent`.

**amount** `number`

Markup value configured for this rule.

**min\_charge\_value** `number or null`

Minimum markup value when `mode` is `percent`.

**max\_charge\_value** `number or null`

Maximum markup value when `mode` is `percent`.

```json 201 Created theme={null}
{
  "id": 1,
  "product": "payin",
  "payment_method": "pix",
  "account_id": 123,
  "parent_id": null,
  "type": "global",
  "mode": "percent",
  "amount": 2.5,
  "min_charge_value": 1.0,
  "max_charge_value": 100.0,
  "enabled": true,
  "created_at": "2024-06-01T12:00:00Z",
  "updated_at": "2024-06-01T12:00:00Z"
}
```

```json 422 Unprocessable Entity theme={null}
{
  "message": "Dados inválidos.",
  "errors": {
    "product": [
      "O campo product é inválido."
    ],
    "amount": [
      "O campo amount é obrigatório."
    ],
    "min_charge_value": [
      "O campo min_charge_value é obrigatório quando mode é percent."
    ]
  }
}
```

```json 500 Internal Server Error theme={null}
{
  "error": "Não foi possível criar o markup."
}
```

## Related Resources

> [card] [Update Merchant Markup](https://docs.wepayout.co/api-reference/markup/account/update-merchant-markup.md)
>
> Update existing markup configurations

> [card] [List Merchant Markups](https://docs.wepayout.co/api-reference/markup/account/list-merchant-markups.md)
>
> View all markup configurations

> [card] [About Markup](https://docs.wepayout.co/markup/about-markup.md)
>
> Learn about markup types and configuration levels

> [card] [Create Payin with Global Markup](https://docs.wepayout.co/api-reference/markup/payin/create-payin-with-global-markup.md)
>
> Use global markup when creating payin charges


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.