> ## 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 Payout with Inline Markup

> Create a payout payment with inline markup configuration.

# Create Payout with Inline Markup

When creating a payout payment, you can include an `inline markup` object in the request payload.

> [!NOTE]
>
> **Inline markup takes precedence**: If you send a `markup` object in the payment creation request, it will override any global or submerchant markup configurations.

## Markup Object Structure

The `markup` object should be added to the request body when creating a payment via `POST /v2/payout/payments`.

**markup** `object`

Optional inline markup configuration for this specific payment.

**Markup Object**

**mode** `string` *required*

How the markup value will be applied.

Allowed values:

* `fixed`: fixed amount per payment
* `percent`: percentage over the payment 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 PIX with Percent Markup theme={null}
{
  "payment_method": "PIX",
  "invoice": "e3317882-f821-455b-b082-dc3ba36e8a57",
  "currency": "BRL",
  "amount": 100.50,
  "country": "BR",
  "beneficiary": {
    "name": "John Doe",
    "document": {
      "type": "CPF",
      "number": "12345678901"
    },
    "pix": {
      "key": "12345678901"
    }
  },
  "markup": {
    "mode": "percent",
    "amount": 2.5,
    "min_charge_value": 0.50,
    "max_charge_value": 10.00
  }
}
```

```json PIX with Fixed Markup theme={null}
{
  "payment_method": "PIX",
  "invoice": "e3317882-f821-455b-b082-dc3ba36e8a57",
  "currency": "BRL",
  "amount": 100.50,
  "country": "BR",
  "beneficiary": {
    "name": "John Doe",
    "document": {
      "type": "CPF",
      "number": "12345678901"
    },
    "pix": {
      "key": "12345678901"
    }
  },
  "markup": {
    "mode": "fixed",
    "amount": 5.0
  }
}
```

```bash cURL - PIX with Percent Markup theme={null}
curl -X POST "https://api.sandbox.wepayout.com.br/v2/payout/payments" \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "payment_method": "PIX",
    "invoice": "e3317882-f821-455b-b082-dc3ba36e8a57",
    "currency": "BRL",
    "amount": 100.50,
    "country": "BR",
    "beneficiary": {
      "name": "John Doe",
      "document": {
        "type": "CPF",
        "number": "12345678901"
      },
      "pix": {
        "key": "12345678901",
        "key_type": "CPF"
      }
    },
    "markup": {
      "mode": "percent",
      "amount": 2.5,
      "min_charge_value": 0.50,
      "max_charge_value": 10.00
    }
  }'
```

```bash cURL - PIX with Fixed Markup theme={null}
curl -X POST "https://api.sandbox.wepayout.com.br/v2/payout/payments" \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "payment_method": "PIX",
    "invoice": "e3317882-f821-455b-b082-dc3ba36e8a57",
    "currency": "BRL",
    "amount": 100.50,
    "country": "BR",
    "beneficiary": {
      "name": "John Doe",
      "document": {
        "type": "CPF",
        "number": "12345678901"
      },
      "pix": {
        "key": "12345678901",
        "key_type": "CPF"
      }
    },
    "markup": {
      "mode": "fixed",
      "amount": 5.0
    }
  }'
```

## Response

**id** `integer`

WEpayment's auto generated id, use this id to perform conciliation or perform queries via API / Dashboard.

**merchant** `object`

Merchant object.

**Merchant**

**id** `integer`

Id of the WE account that created the payout.

**name** `string`

Name of the WE account that created the payout.

**payment\_method** `string`

Payment method used for the payout.

Values: `PIX`

**amount** `string`

The payout amount formatted with currency symbol.

**currency** `string`

Currency code (ISO 4217).

**invoice** `string`

Invoice identifier.

**status** `object`

Payout status.

**Status**

**id** `integer`

Status ID.

**name** `string`

Status name (e.g., "Awaiting").

**beneficiary** `object`

Beneficiary information.

**Beneficiary**

**name** `string`

Beneficiary name.

**document** `object`

Document information.

**markup** `object`

Inline markup configuration applied to this payment.

**Markup Object**

**mode** `string`

Markup mode applied.

Values: `fixed`, `percent`

**amount** `number`

Markup value configured for this payment.

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

Minimum markup value when `mode` is `percent`. Will be `null` when `mode` is `fixed`.

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

Maximum markup value when `mode` is `percent`. Will be `null` when `mode` is `fixed` or when not specified.

**origin** `string`

Level of the markup that was applied. Always `inline` when the `markup` object is sent in the request. Any `origin` sent in the request is ignored.

Values: `inline`

```json 201 Created - PIX Payment with Markup theme={null}
{
  "id": 12345,
  "merchant": {
    "id": 477,
    "name": "Merchant Name"
  },
  "payment_method": "PIX",
  "amount": "R$ 100,50",
  "currency": "BRL",
  "invoice": "e3317882-f821-455b-b082-dc3ba36e8a57",
  "status": {
    "id": 1,
    "name": "Awaiting"
  },
  "beneficiary": {
    "name": "John Doe",
    "document": {
      "type": "CPF",
      "number": "12345678901"
    }
  },
  "markup": {
    "mode": "percent",
    "amount": 2.5,
    "min_charge_value": 0.50,
    "max_charge_value": 10.00,
    "origin": "inline"
  },
  "purpose": null,
  "paid_at": null,
  "created_at": "2024-01-15T10:30:00.000000Z",
  "updated_at": "2024-01-15T10:30:00.000000Z"
}
```

```json 422 Unprocessable Entity - Markup Only for PIX theme={null}
{
  "message": "The given data was invalid",
  "errors": {
    "markup": [
      "Markup is only allowed for PIX payments"
    ]
  }
}
```

```json 422 Unprocessable Entity - Invalid markup.mode theme={null}
{
  "message": "The given data was invalid",
  "errors": {
    "markup.mode": [
      "The selected markup.mode is invalid."
    ]
  }
}
```

```json 422 Unprocessable Entity - Invalid markup.amount theme={null}
{
  "message": "The given data was invalid",
  "errors": {
    "markup.amount": [
      "The markup.amount must be at least 0.01."
    ]
  }
}
```

```json 422 Unprocessable Entity - Missing min_charge_value for percent mode theme={null}
{
  "message": "The given data was invalid",
  "errors": {
    "markup.min_charge_value": [
      "The markup.min_charge value field is required when markup.mode is percent."
    ]
  }
}
```

```json 422 Unprocessable Entity - Invalid charge values for fixed mode theme={null}
{
  "message": "The given data was invalid",
  "errors": {
    "markup.min_charge_value": [
      "Invalid charge values for fixed mode"
    ]
  }
}
```

```json 422 Unprocessable Entity - Markup Required theme={null}
{
  "message": "The given data was invalid",
  "errors": {
    "markup": [
      "Inline markup is required when no global markup is configured"
    ]
  }
}
```

```json 500 Internal Server Error theme={null}
{
  "message": "Internal error"
}
```

## How It Works

1. **Priority**: The inline markup configuration takes precedence over global and submerchant markup settings.

2. **Calculation** (for percent mode):
   * The system calculates: `payment_amount * (amount / 100)`
   * If calculated value \< `min_charge_value` → applies `min_charge_value`
   * If calculated value > `max_charge_value` → applies `max_charge_value`
   * Otherwise → applies the calculated value

3. **Fixed Mode**: When using `fixed` mode, the markup amount is applied directly regardless of the transaction value.

## Related Resources

> [card] [Create Payment](https://docs.wepayout.co/api-reference/cash-out/payout/create-payment.md)
>
> Complete documentation for creating payout payments

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


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