Skip to main content
PUT
/
v1
/
pricing
/
fee-policies
/
{id}
curl --request PUT \
  --url https://api-sandbox.rinne.com.br/core/v1/pricing/fee-policies/{id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "updated-fee-policy",
  "description": "Policy with adjusted rules",
  "is_active": true,
  "cashout_price": 350,
  "rules": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "conditions": [],
      "price": {
        "percentage": 2,
        "flat": 100
      },
      "priority": 1
    },
    {
      "conditions": [
        {
          "field": "transaction.amount",
          "operator": "GREATER_THAN",
          "value": 50000
        }
      ],
      "price": {
        "percentage": 1.5
      },
      "priority": 2
    }
  ]
}
'
{
  "id": "a3dbd0c2-9f79-4f86-8caa-47779b3f2793",
  "name": "standard-card-fees",
  "description": "Standard fee structure for card transactions",
  "is_active": true,
  "cashout_price": 350,
  "organization_id": "a3dbd0c2-9f79-4f86-8caa-47779b3f2794",
  "rules": [
    {
      "conditions": [
        {
          "field": "transaction.payment_method",
          "operator": "EQUALS",
          "value": "credit_card"
        }
      ],
      "price": {
        "percentage": 2.5,
        "flat": 50,
        "minimum_price": 100
      },
      "priority": 1,
      "id": "a3dbd0c2-9f79-4f86-8caa-47779b3f2793",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

x-api-key
string
header
required

Company API key for authentication

Path Parameters

id
string<uuid>
required

The ID of the fee policy to replace

Body

application/json

Fee policy replacement request. The final state of the policy will match exactly what is provided.

Concurrency protection:

  • Uses RepeatableRead isolation to prevent race conditions
  • No client-side tracking required

Rule handling:

  • Rules WITH id: Updated (id must exist, returns 400 if invalid)
  • Rules WITHOUT id: Created as new
  • Existing rules NOT in payload: Deleted
name
string
required

Policy name (alphanumeric, underscores, hyphens only)

Required string length: 1 - 100
Pattern: ^[a-zA-Z0-9_-]+$
Example:

"standard-card-fees"

is_active
boolean
required

Whether the policy is active

Example:

true

cashout_price
integer
required

Cashout price in cents (fixed fee for cashout operations)

Required range: x >= 0
Example:

350

rules
object[]
required

Complete list of rules for the policy. Rules with IDs are updated, rules without IDs are created, and existing rules not in the payload are deleted.

Minimum array length: 1
description
string

Optional policy description

Maximum string length: 500
Example:

"Standard fee structure for card transactions"

Response

Fee policy replaced successfully

Fee policy response

id
string

Policy ID

Example:

"a3dbd0c2-9f79-4f86-8caa-47779b3f2793"

name
string
Example:

"standard-card-fees"

description
string | null
Example:

"Standard fee structure for card transactions"

is_active
boolean
Example:

true

cashout_price
integer

Cashout price in cents (fixed fee for cashout operations)

Example:

350

organization_id
string

Organization company ID

Example:

"a3dbd0c2-9f79-4f86-8caa-47779b3f2794"

rules
object[]
created_at
string<date-time>
updated_at
string<date-time>