GET /api/vendors
Get vendors list

Get a list of company’s vendors.

Examples

{
  "collection": [
    {
      "id": 1,
      "name": "Renance - Automated Financial Setvices Ltd",
      "notes": "Bezala - the great expense software we use",
      "business_id": "2697751-4",
      "vat_id": "FI26977514",
      "deactivated": false,
      "external_id": "Vendor 2"
    }
  ],
  "pagination": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1
  }
}

Params

Param name Description
page
optional

Page number.

Validations:

  • Must be a Integer

per_page
optional

Number of records per page. Default: 50.

Validations:

  • Must be a Integer


GET /api/vendors/:id
Get vendor

Get full vendor information.

Examples

{
  "id": 1,
  "name": "Renance - Automated Financial Setvices Ltd",
  "notes": "Bezala - the great expense software we use",
  "business_id": "2697751-4",
  "vat_id": "FI26977514",
  "business_type": "llc",
  "contact_person": "Fredrik Teir",
  "email": "firstname.lastname@bezala.com",
  "phone_number": "+3584401612",
  "url": "www.bezala.com",
  "iban": "FI3584800710258XYZ",
  "bic": "DABAFIHH",
  "external_id": "Vendor 2",
  "deactivated": false,
  "address": {
    "street": "Keilranta 5",
    "city": "Espoo",
    "postal_code": "02150",
    "country_id": 1,
    "latitude": "60.1763725",
    "longitude": "24.8332552"
  }
}

Params

Param name Description
id
required

Vendor ID

Validations:

  • Must be a Integer


POST /api/vendors
Create vendor

Create new vendor.

Params

Param name Description
vendor
required

Vendor parameters.

Validations:

  • Must be a Hash

vendor[name]
required

Vendor name. Must be unique within a company.

Validations:

  • Must be a String

vendor[notes]
optional

Additional notes to be displayed on UI alongside vendor name.

Validations:

  • Must be a String

vendor[vat_id]
optional

VAT ID.

Validations:

  • Must be a String

vendor[business_id]
optional

Business ID.

Validations:

  • Must be a String

vendor[business_type]
optional

Vendor business type (LLC or private entrepreneur). Default: "llc".

Validations:

  • Must be one of: llc, private_entrepreneur.

vendor[contact_person]
optional

Vendor Contact person.

Validations:

  • Must be a String

vendor[email]
optional

Vendor Email.

Validations:

  • Must be a String

vendor[phone_number]
optional

Vendor Phone.

Validations:

  • Must be a String

vendor[url]
optional

Vendor URL.

Validations:

  • Must be a String

vendor[iban]
optional

Default Bank account IBAN.

Validations:

  • Must be a String

vendor[bic]
optional

Default Bank account BIC. If not provided, Bezala will try to auto-calculate it based on IBAN.

Validations:

  • Must be a String

vendor[external_id]
optional

Vendor External ID.

Validations:

  • Must be a String

vendor[address_attributes]
optional

Vendor address.

Validations:

  • Must be a Hash

vendor[address_attributes][street]
optional

Street address.

Validations:

  • Must be a String

vendor[address_attributes][city]
optional

City of the address, or Post Office.

Validations:

  • Must be a String

vendor[address_attributes][postal_code]
optional

Postal Code of the address.

Validations:

  • Must be a String

vendor[address_attributes][country_id]
optional

Country id of an address.

Validations:

  • Must be a Integer

vendor[address_attributes][latitude]
optional

Geographic Latitude from Google Maps.

Validations:

  • Must be a decimal number.

vendor[address_attributes][longitude]
optional

Geographic Longitude from Google Maps.

Validations:

  • Must be a decimal number.


PUT /api/vendors/:id
Update vendor

Update an existing vendor.

Params

Param name Description
id
required

Vendor ID

Validations:

  • Must be a Integer

vendor
required

Vendor parameters.

Validations:

  • Must be a Hash

vendor[name]
required

Vendor name. Must be unique within a company.

Validations:

  • Must be a String

vendor[notes]
optional

Additional notes to be displayed on UI alongside vendor name.

Validations:

  • Must be a String

vendor[vat_id]
optional

VAT ID.

Validations:

  • Must be a String

vendor[business_id]
optional

Business ID.

Validations:

  • Must be a String

vendor[business_type]
optional

Vendor business type (LLC or private entrepreneur). Default: "llc".

Validations:

  • Must be one of: llc, private_entrepreneur.

vendor[contact_person]
optional

Vendor Contact person.

Validations:

  • Must be a String

vendor[email]
optional

Vendor Email.

Validations:

  • Must be a String

vendor[phone_number]
optional

Vendor Phone.

Validations:

  • Must be a String

vendor[url]
optional

Vendor URL.

Validations:

  • Must be a String

vendor[iban]
optional

Default Bank account IBAN.

Validations:

  • Must be a String

vendor[bic]
optional

Default Bank account BIC. If not provided, Bezala will try to auto-calculate it based on IBAN.

Validations:

  • Must be a String

vendor[external_id]
optional

Vendor External ID.

Validations:

  • Must be a String

vendor[address_attributes]
optional

Vendor address.

Validations:

  • Must be a Hash

vendor[address_attributes][street]
optional

Street address.

Validations:

  • Must be a String

vendor[address_attributes][city]
optional

City of the address, or Post Office.

Validations:

  • Must be a String

vendor[address_attributes][postal_code]
optional

Postal Code of the address.

Validations:

  • Must be a String

vendor[address_attributes][country_id]
optional

Country id of an address.

Validations:

  • Must be a Integer

vendor[address_attributes][latitude]
optional

Geographic Latitude from Google Maps.

Validations:

  • Must be a decimal number.

vendor[address_attributes][longitude]
optional

Geographic Longitude from Google Maps.

Validations:

  • Must be a decimal number.


PUT /api/vendors/:id/toggle_deactivated
Toggle deactivated field

Toggle vendor’s deactivated field.

Params

Param name Description
id
required

Vendor ID

Validations:

  • Must be a Integer


DELETE /apivendors/:id
Delete vendor

Delete a vendor.

Params

Param name Description
id
required

Vendor ID

Validations:

  • Must be a Integer