> ## 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.

# Configure Submerchant Markup

> Create or replace the markup configuration of a submerchant.

# Configure Submerchant Markup

Use this endpoint to set a submerchant's own markup for each product and payment method. The submerchant's markup takes priority over the merchant's global markup, but not over an inline `markup` sent in the request.

> [!WARNING]
>
> **This endpoint replaces the whole configuration.** Every call removes the submerchant's current markups and saves only the items in `markups`. Any product and payment method you leave out goes back to the global markup.

## Path Parameters

**merchantId** `integer` *required*

ID of the merchant (parent account). It must be one of the authenticated user's companies.

**subMerchantId** `integer` *required*

ID of the submerchant. It must be a submerchant of `merchantId`.

## Request Body

**markups** `array[object]` *required*

Markup configurations for the submerchant. Send between `1` and `8` items, and at most one item for each `product` and `payment_method` pair.

**Markup Object**

**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:

* For `payin`: `pix`, `billet`, `credit_card`
* For `payout`: `pix`, `ted`

**mode** `string` *required*

Type of markup to be applied.

Allowed values:

* `fixed`: fixed amount (BRL) per transaction
* `percent`: percentage over the transaction amount

**amount** `number` *required*

Markup value. In BRL when `mode` is `fixed`, and a percentage when `mode` is `percent` (`1.5` means 1.5%).

Must be greater than or equal to `0.01`.

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

Minimum markup amount (BRL) 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 (BRL) when `mode` is `percent`.

Business rules:

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

> [!NOTE]
>
> Unlike the global markup, a submerchant markup with `mode` = `percent` requires **both** `min_charge_value` and `max_charge_value`.

## Request Examples

```json Payin and payout markup theme={null}
{
  "markups": [
    {
      "product": "payin",
      "payment_method": "pix",
      "mode": "percent",
      "amount": 1.4,
      "min_charge_value": 1.0,
      "max_charge_value": 5.0
    },
    {
      "product": "payin",
      "payment_method": "billet",
      "mode": "fixed",
      "amount": 2.0
    },
    {
      "product": "payout",
      "payment_method": "pix",
      "mode": "fixed",
      "amount": 0.8
    }
  ]
}
```

```bash cURL theme={null}
curl -X PUT "https://api.sandbox.wepayout.com.br/v2/account/123/submerchants/1234/markups" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "markups": [
      {
        "product": "payin",
        "payment_method": "pix",
        "mode": "percent",
        "amount": 1.4,
        "min_charge_value": 1.0,
        "max_charge_value": 5.0
      }
    ]
  }'
```

## Response

Returns the submerchant with its updated markup, with the same fields as [Get Submerchant Markup](https://docs.wepayout.co/api-reference/markup/submerchant/get-submerchant-markup.md).

```json 200 OK theme={null}
{
  "id": 1234,
  "name": "Store X",
  "legal_name": "Store X LTDA",
  "document": "12345678000190",
  "has_markup": true,
  "payin": [
    {
      "id": 61,
      "payment_method": "pix",
      "mode": "percent",
      "amount": "1.40",
      "min_charge_value": "1.00",
      "max_charge_value": "5.00"
    }
  ],
  "payout": [],
  "updated_at": "2026-09-29 14:02:37"
}
```

```json 422 Unprocessable Entity theme={null}
{
  "message": "The given data was invalid.",
  "errors": {
    "markups.0.payment_method": [
      "The payment method ted is not allowed with product payin."
    ],
    "markups.1.min_charge_value": [
      "Minimum and maximum values are required when the mode is percent."
    ],
    "markups.2.min_charge_value": [
      "Minimum and maximum values do not apply to the fixed mode."
    ],
    "markups.3.max_charge_value": [
      "The minimum value cannot be greater than the maximum value."
    ],
    "markups.4.payment_method": [
      "There is more than one configuration for the same product and payment method."
    ]
  }
}
```

```json 422 Unprocessable Entity - Not a submerchant of this merchant theme={null}
{
  "message": "The given data was invalid.",
  "errors": {
    "subMerchantId": [
      "The subaccount 7777 does not belong to this account."
    ]
  }
}
```

```json 500 Internal Server Error theme={null}
{
  "error": "Failed to create markup."
}
```

## Related Resources

> [card] [Batch Apply Submerchant Markup](https://docs.wepayout.co/api-reference/markup/submerchant/batch-apply-submerchant-markup.md)
>
> Apply the same markup to many submerchants

> [card] [Remove Submerchant Markup](https://docs.wepayout.co/api-reference/markup/submerchant/delete-submerchant-markup.md)
>
> Go back to the global markup

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

> [card] [Create Merchant Markup](https://docs.wepayout.co/api-reference/markup/account/create-merchant-markup.md)
>
> Configure the global markup


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