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

<ParamField body="account_id" type="integer" required>
  ID of the merchant that will receive the markup.
</ParamField>

<ParamField body="parent_id" type="integer">
  Optional parent relationship ID. Can be used to associate this markup to a parent account or hierarchy level.
</ParamField>

<ParamField body="product" type="string" required>
  Product where the markup will be applied.

  Allowed values: `payin`, `payout`
</ParamField>

<ParamField body="payment_method" type="string" required>
  Payment method where the markup will be applied.

  Allowed values: `pix`, `billet`, `credit_card`
</ParamField>

<ParamField body="type" type="string" required>
  Markup scope type.

  Currently, only `global` is supported externally.
</ParamField>

<ParamField body="mode" type="string" required>
  Type of markup to be applied.

  Allowed values:

  * `fixed`: fixed amount per charge
  * `percent`: percentage over the charge amount
</ParamField>

<ParamField body="amount" type="number" required>
  Markup value to be applied.

  Constraints:

  * Must be greater than or equal to `0.01`.
</ParamField>

<ParamField body="min_charge_value" type="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`
</ParamField>

<ParamField body="max_charge_value" type="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`
</ParamField>

<Warning>
  When `mode` is `fixed`, do **not** send `min_charge_value` or `max_charge_value`.
</Warning>

## Request Examples

<CodeGroup>
  ```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
    }'
  ```
</CodeGroup>

## Response

<ResponseField name="id" type="integer">
  Markup configuration ID.
</ResponseField>

<ResponseField name="product" type="string">
  Product where the markup is applied.
</ResponseField>

<ResponseField name="payment_method" type="string">
  Payment method where the markup is applied.
</ResponseField>

<ResponseField name="account_id" type="integer">
  Merchant ID that receives the markup.
</ResponseField>

<ResponseField name="parent_id" type="integer or null">
  Parent relationship ID, when applicable.
</ResponseField>

<ResponseField name="type" type="string">
  Markup scope type. Example: `global`.
</ResponseField>

<ResponseField name="mode" type="string">
  Markup mode. Example: `fixed` or `percent`.
</ResponseField>

<ResponseField name="amount" type="number">
  Markup value configured for this rule.
</ResponseField>

<ResponseField name="min_charge_value" type="number or null">
  Minimum markup value when `mode` is `percent`.
</ResponseField>

<ResponseField name="max_charge_value" type="number or null">
  Maximum markup value when `mode` is `percent`.
</ResponseField>

<ResponseExample>
  ```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."
  }
  ```
</ResponseExample>

## Related Resources

<CardGroup cols={2}>
  <Card title="Update Merchant Markup" icon="pen" href="/api-reference/markup/account/update-merchant-markup">
    Update existing markup configurations
  </Card>

  <Card title="List Merchant Markups" icon="list" href="/api-reference/markup/account/list-merchant-markups">
    View all markup configurations
  </Card>

  <Card title="About Markup" icon="circle-info" href="/markup/about-markup">
    Learn about markup types and configuration levels
  </Card>

  <Card title="Create Payin with Global Markup" icon="code" href="/api-reference/markup/payin/create-payin-with-global-markup">
    Use global markup when creating payin charges
  </Card>
</CardGroup>
