Mono Colombia

Add or update a rule to a spending control

You can use this endpoint to add or update a rule to a spending control

PUT
/v1/spending_controls/{spending_control_id}/rules

Authorization

authorization
AuthorizationBearer <token>

In: header

Path Parameters

spending_control_idstring

Spending control ID (Base 62 format)

Match^[A-Za-z]{2,7}_[\w-]{22}$
Example"spc_5tgliBmzjZ6mpQPRbQjfKj"

Request Body

application/json

Attributes to add or update a rule to a spending control

TypeScript Definitions

Use the request body type in TypeScript.

daily?object

Limit amount for daily spending

monthly?object

Limit amount for monthly spending

typestring

String field

Default"velocity"
Example"velocity"
weekly?object

Limit amount for weekly spending

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://api.sandbox.cuentamono.com/v1/spending_controls/spc_5tgliBmzjZ6mpQPRbQjfKj/rules" \  -H "Content-Type: application/json" \  -d '{    "type": "velocity"  }'
{
  "currency_code": "COP",
  "id": "spc_5tgliBmzjZ6mpQPRbQjfKj",
  "nickname": "Holiday Spending Control",
  "rules": {
    "card_usage": {
      "disabled_card_usages": [
        "online_purchase"
      ]
    },
    "mcc": {
      "mccs": [
        "5411"
      ],
      "operation": "allow_mccs"
    },
    "merchant_name": {
      "operation": "allow_pattern",
      "regex": "^AMAZON.*"
    },
    "mid": {
      "mids": [
        "012345678"
      ],
      "operation": "allow_mids"
    },
    "velocity": {
      "daily": {
        "amount": 100000000,
        "currency": "COP"
      },
      "monthly": {
        "amount": 100000000,
        "currency": "COP"
      },
      "weekly": {
        "amount": 100000000,
        "currency": "COP"
      }
    },
    "withdrawal_velocity": {
      "daily": {
        "amount": 100000000,
        "currency": "COP"
      },
      "monthly": {
        "amount": 100000000,
        "currency": "COP"
      }
    }
  },
  "target": "card"
}
{
  "currency_code": "COP",
  "id": "spc_5tgliBmzjZ6mpQPRbQjfKj",
  "nickname": "Holiday Spending Control",
  "rules": {
    "card_usage": {
      "disabled_card_usages": [
        "online_purchase"
      ]
    },
    "mcc": {
      "mccs": [
        "5411"
      ],
      "operation": "allow_mccs"
    },
    "merchant_name": {
      "operation": "allow_pattern",
      "regex": "^AMAZON.*"
    },
    "mid": {
      "mids": [
        "012345678"
      ],
      "operation": "allow_mids"
    },
    "velocity": {
      "daily": {
        "amount": 100000000,
        "currency": "COP"
      },
      "monthly": {
        "amount": 100000000,
        "currency": "COP"
      },
      "weekly": {
        "amount": 100000000,
        "currency": "COP"
      }
    },
    "withdrawal_velocity": {
      "daily": {
        "amount": 100000000,
        "currency": "COP"
      },
      "monthly": {
        "amount": 100000000,
        "currency": "COP"
      }
    }
  },
  "target": "card"
}
{
  "code": "400 Bad Request",
  "errors": [
    {
      "error_code": "validation_error",
      "message": "Generic changeset errors",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Malformed request"
}
{
  "code": "401 Unauthorized",
  "errors": [
    {
      "error_code": "expired_token",
      "message": "The token is expired, inactive, or doesn't exist.",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Authorization header is missing or invalid."
}
{
  "code": "403 Forbidden",
  "errors": [
    {
      "error_code": "not_authorized",
      "message": "Not authorized to have access to this resource.",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Not authorized to have access to this resource"
}
{
  "code": "404 Not Found",
  "errors": [
    {
      "error_code": "item_not_found",
      "message": "The item doesn't exist",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Resource not defined"
}
{
  "code": "422 Unprocessable Content",
  "errors": [
    {
      "error_code": "missing_field",
      "message": "The field is missing on the request body or parameters.",
      "path": "#/path/to/field",
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Validation errors"
}