Params

  • number

    Client number

  • first_name

    Must be present if client is an individual.

  • last_name

    Must be present if client is an individual.

  • email

    Must be valid email if used.

  • company

    Must be present unless client is an individual.

  • phone
  • home_phone
  • mobile_phone
  • fax
  • org_number
  • client_type

    Is the client an individual (not a business)? One of: “company”, “individual” (defaults to “company”)

  • web
  • vat_number
  • settings Must be a Hash
  • settings[invoice_delivery_method]

    One of: “email”, “letter”, “e_invoice”

  • settings[e_invoice]

    Boolean. If possible, the invoice will be sent as an e-invoice.

  • settings[invoice_days]

    Default for new invoices to this client. Defaults to global setting.

  • settings[locale]

    Default for new invoices to this client. Defaults to global setting.

  • settings[currency]

    Default for new invoices to this client. Defaults to global setting.

  • settings[email_attach_pdf]

    Boolean. Attach PDF when sending invoices by email. Useful if the recipient needs the PDF for automatic scanning.

  • address Must be a Hash
  • address[street_address]
  • address[care_of]

    This field (if present) is printed as the first line in the address. No “care of” prefix is added by the application, so you have to do this yourself. This makes it possible to use the field for other purposes, e.g. “Att.”

  • address[zip_code]
  • address[city]
  • address[country]

Examples

POST /api/v2/clients
{
  "first_name": "Nils",
  "last_name": "Eriksson",
  "address": {
    "street_address": "Testvägen",
    "care_of": "Någon",
    "zip_code": "12345",
    "city": "Karlstad",
    "country": "SE"
  },
  "mobile_phone": "46701234567",
  "email": "test@test.com",
  "fax": "",
  "phone": "070 751 51 66",
  "home_phone": "46701234567",
  "client_type": "individual",
  "org_number": "8001010043"
}
201
{
  "data": {
    "id": 2,
    "number": 1,
    "name": "Nils Eriksson",
    "first_name": "Nils",
    "last_name": "Eriksson",
    "email": "test@test.com",
    "fax": "",
    "phone": "070 751 51 66",
    "home_phone": "46701234567",
    "mobile_phone": "46701234567",
    "client_type": "individual",
    "org_number": "8001010043",
    "settings": {
      "email_attach_pdf": false,
      "invoice_delivery_method": "email",
      "invoice_template": "original",
      "discount": 0,
      "show_product_code": false,
      "currency": "SEK",
      "locale": "sv",
      "invoice_days": 30,
      "tax": 25,
      "prices_inc_tax": "no"
    },
    "address": {
      "street_address": "Testvägen",
      "care_of": "Någon",
      "zip_code": "12345",
      "city": "Karlstad",
      "country": "SE"
    }
  }
}
POST /api/v2/clients
{
  "company": ""
}
422
{
  "errors": {
    "company": [
      {
        "error": "blank"
      }
    ]
  }
}