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,
"automatic_anticipation_percentage": 2.5,
"spot_anticipation_percentage": 2.5,
"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,
"automatic_anticipation_percentage": 2.4999,
"spot_anticipation_percentage": 2.4999,
"organization_id": "a3dbd0c2-9f79-4f86-8caa-47779b3f2794",
"rules": [
{
"conditions": [
{
"field": "transaction.card_data.brand",
"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"
}{
"error": {
"code": "AUTHORIZATION_ERROR",
"message": "You need 'admin' permissions to access this resource",
"status": 403,
"path": "/companies",
"timestamp": "2023-12-01T10:00:00.000Z",
"requestId": "req_123456789"
}
}Pricing
Replace a fee policy
Replace an existing fee policy for the authenticated company. The final state of the policy will match exactly what is provided in the request.
Concurrency Protection:
- Uses stronger isolation to prevent race conditions
- If concurrent modifications occur, one request will fail with serialization error
- Clients can retry on failure
Rule Replacement Behavior:
- Rules WITH IDs: Updated in place (ID must exist in the policy, returns 400 if not)
- Rules WITHOUT IDs: Created as new rules
- Existing rules NOT in the payload: Deleted
Key Difference from PATCH:
- PATCH preserves rules not mentioned in the request
- PUT removes rules not included in the request
To keep an existing rule, include it in the request with its ID. To remove a rule, simply omit it from the request. To add a new rule, include it without an ID.
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,
"automatic_anticipation_percentage": 2.5,
"spot_anticipation_percentage": 2.5,
"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,
"automatic_anticipation_percentage": 2.4999,
"spot_anticipation_percentage": 2.4999,
"organization_id": "a3dbd0c2-9f79-4f86-8caa-47779b3f2794",
"rules": [
{
"conditions": [
{
"field": "transaction.card_data.brand",
"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"
}{
"error": {
"code": "AUTHORIZATION_ERROR",
"message": "You need 'admin' permissions to access this resource",
"status": 403,
"path": "/companies",
"timestamp": "2023-12-01T10:00:00.000Z",
"requestId": "req_123456789"
}
}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
Response
Fee policy replaced successfully
Fee policy response

