Skip to content

Latest commit

 

History

History
369 lines (245 loc) · 9.23 KB

CustomersApi.md

File metadata and controls

369 lines (245 loc) · 9.23 KB

StandoutFortnox::CustomersApi

All URIs are relative to https://api.fortnox.se/3

Method HTTP request Description
add_customer POST /customers Create customer
delete_customer DELETE /customers/{customerId} Delete customer
get_active_customers GET /customers/?filter=active Check for active customers
get_customer GET /customers/{customerId} Get customer by Id
get_customers GET /customers Get all customers
get_inactive_customers GET /customers/?filter=inactive Check for inactive customers
update_customer PUT /customers/{customerId} Update customer

add_customer

Customers add_customer(body)

Create customer

Create customer

Example

# load the gem
require 'standout_fortnox'

api_instance = StandoutFortnox::CustomersApi.new

body = StandoutFortnox::Customers.new # Customers | Customer object that needs to be added


begin
  #Create customer
  result = api_instance.add_customer(body)
  p result
rescue StandoutFortnox::ApiError => e
  puts "Exception when calling CustomersApi->add_customer: #{e}"
end

Parameters

Name Type Description Notes
body Customers Customer object that needs to be added

Return type

Customers

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

delete_customer

delete_customer(customer_id)

Delete customer

Delete customer

Example

# load the gem
require 'standout_fortnox'

api_instance = StandoutFortnox::CustomersApi.new

customer_id = 56 # Integer | ID of customer to delete


begin
  #Delete customer
  api_instance.delete_customer(customer_id)
rescue StandoutFortnox::ApiError => e
  puts "Exception when calling CustomersApi->delete_customer: #{e}"
end

Parameters

Name Type Description Notes
customer_id Integer ID of customer to delete

Return type

nil (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_active_customers

Customers get_active_customers

Check for active customers

Retrieves all customers that are active

Example

# load the gem
require 'standout_fortnox'

api_instance = StandoutFortnox::CustomersApi.new

begin
  #Check for active customers
  result = api_instance.get_active_customers
  p result
rescue StandoutFortnox::ApiError => e
  puts "Exception when calling CustomersApi->get_active_customers: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

Customers

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_customer

Customer get_customer(customer_id)

Get customer by Id

Get customer by Id

Example

# load the gem
require 'standout_fortnox'

api_instance = StandoutFortnox::CustomersApi.new

customer_id = 789 # Integer | ID of customer to return


begin
  #Get customer by Id
  result = api_instance.get_customer(customer_id)
  p result
rescue StandoutFortnox::ApiError => e
  puts "Exception when calling CustomersApi->get_customer: #{e}"
end

Parameters

Name Type Description Notes
customer_id Integer ID of customer to return

Return type

Customer

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_customers

Customers get_customers(opts)

Get all customers

Get all customers

Example

# load the gem
require 'standout_fortnox'

api_instance = StandoutFortnox::CustomersApi.new

opts = { 
  filter: nil, # Object | Retrieves all customers matching given filter
  offset: nil, # Object | 
  limit: nil, # Object | 
  sortby: nil, # Object | Which property to sort by, must be defined as sortable in documentation
  sortorder: nil, # Object | 
  page: nil, # Object | 
  lastmodified: nil, # Object | Retrieves all records since the provided timestamp
  fromdate: nil, # Object | Defines a selection based on a start date.
  todate: nil, # Object | Defines a selection based on an end date.
  city: nil, # Object | Get only customers inluding given value for City
  customernumber: nil, # Object | Get only customers inluding given value for CustomerNumber
  email: nil, # Object | Get only customers inluding given value for Email
  gln: nil, # Object | Get only customers inluding given value for GLN
  glndelivery: nil, # Object | Get only customers inluding given value for GLNDelivery
  name: nil, # Object | Get only customers inluding given value for Name
  organisationnumber: nil, # Object | Get only customers inluding given value for OrganisationNumber
  phone: nil, # Object | Get only customers inluding given value for Phone1
  zipcode: nil # Object | Get only customers inluding given value for ZipCode
}

begin
  #Get all customers
  result = api_instance.get_customers(opts)
  p result
rescue StandoutFortnox::ApiError => e
  puts "Exception when calling CustomersApi->get_customers: #{e}"
end

Parameters

Name Type Description Notes
filter Object Retrieves all customers matching given filter [optional]
offset Object [optional]
limit Object [optional]
sortby Object Which property to sort by, must be defined as sortable in documentation [optional]
sortorder Object [optional]
page Object [optional]
lastmodified Object Retrieves all records since the provided timestamp [optional]
fromdate Object Defines a selection based on a start date. [optional]
todate Object Defines a selection based on an end date. [optional]
city Object Get only customers inluding given value for City [optional]
customernumber Object Get only customers inluding given value for CustomerNumber [optional]
email Object Get only customers inluding given value for Email [optional]
gln Object Get only customers inluding given value for GLN [optional]
glndelivery Object Get only customers inluding given value for GLNDelivery [optional]
name Object Get only customers inluding given value for Name [optional]
organisationnumber Object Get only customers inluding given value for OrganisationNumber [optional]
phone Object Get only customers inluding given value for Phone1 [optional]
zipcode Object Get only customers inluding given value for ZipCode [optional]

Return type

Customers

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_inactive_customers

Customers get_inactive_customers

Check for inactive customers

Retrieves all customers that are inactive

Example

# load the gem
require 'standout_fortnox'

api_instance = StandoutFortnox::CustomersApi.new

begin
  #Check for inactive customers
  result = api_instance.get_inactive_customers
  p result
rescue StandoutFortnox::ApiError => e
  puts "Exception when calling CustomersApi->get_inactive_customers: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

Customers

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

update_customer

Customer update_customer(customer_id, body)

Update customer

Update customer

Example

# load the gem
require 'standout_fortnox'

api_instance = StandoutFortnox::CustomersApi.new

customer_id = 56 # Integer | ID of customer to update

body = StandoutFortnox::Customer.new # Customer | Customer object that needs to be added


begin
  #Update customer
  result = api_instance.update_customer(customer_id, body)
  p result
rescue StandoutFortnox::ApiError => e
  puts "Exception when calling CustomersApi->update_customer: #{e}"
end

Parameters

Name Type Description Notes
customer_id Integer ID of customer to update
body Customer Customer object that needs to be added

Return type

Customer

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json