Method: Unit::Resource::FeeResource.create_fee

Defined in:
lib/unit/api_resources/fee_resource.rb

.create_fee(request) ⇒ UnitResponse, UnitError

Create a new fee by calling Unit’s API

Parameters:

  • request (CreateFeeRequest)

Returns:



15
16
17
18
19
# File 'lib/unit/api_resources/fee_resource.rb', line 15

def create_fee(request)
  payload = request.to_json_api
  response = HttpHelper.post("#{api_url}/fees", body: payload, headers: headers)
  response_handler(response)
end