400 Bad Request

Create Rendering Provider

Many DaisyBill models use validators to ensure that valid data is persisted when a record is created or updated. Consider the following request and its response:

rendering_provider = DaisybillApi::Models::RenderingProvider.create(
  billing_provider_id: 25,
  first_name: "Cecile",
  last_name: "Romaguera",
  npi: "3",
  state_license_number: "251229",
  taxonomy_code: "",
  type_of_specialty: "Basketball-player"
)

Validation errors are included in the response, showing the attributes corresponding to invalid inputs and their respective errors:

{  
  "errors":{  
    "taxonomy":["can't be blank"],
    "npi":["is the wrong length (should be 10 characters)"],
    "type_of_specialty":["is not included in the list"]
  }
}