Billcom v0.1.1 Billcom View Source

Simple api library to connect to bill.com api

Config your bill.com connection:

config :billcom, :api,
%{
  devKey: "T3WMJHVXXYZUSUKQE9CDPEKN",
  orgId: "Y8RGTBK2PXFGBUQMSCNM",
  password: "AJXR5CZJBPJD",
  userName: "sarah.connor@example.com"
  prod: true // optionnal
}

Where devKey, orgId, password, userName are provided by Bill.com and are mandatory. prod let you choose between bill.com in sandbox mode or production. By default the api try to connect to sandbox.

Note that most of the api return are with a form of a 2 values tuple:

{status, data}

Where status can be either :ok or :error dans val the corresponding data, and take a parameter a connection struture as a parameters, return of Billcom.login!/0

conn = Billcom.login
Billcom.list_orgs(conn)

Link to this section Summary

Functions

Approve for bill.com api

Cancel accounts payable payment for bill.com api

Cancel invite for bill.com api

Charge customer for bill.com api

Cle accounts receivable approvers for bill.com api

Connect large biller as vendor for bill.com api

Deny for bill.com api

Disconnect customer from network for bill.com api

Disconnect vendor from network for bill.com api

Get accounts payable summary for bill.com api

get_api_url get object value api_url

Get accounts receivable summary for bill.com api

Get bank balance for bill.com api

Get check image data for bill.com api

Return the colection data from the result collection

get_dev_key get object value dev_key

Get disbursement data for bill.com api

Get document pages for bill.com api

Get entity metadata for bill.com api

Get large biller payment address for bill.com api

Get network status for bill.com api

Get object url for bill.com api

get_org_id get object value org_id

get_password get object value password

Get profile permissions for bill.com api

get_session_id get object value session_id

get_user_name get object value user_name

Return the value of a key in the result collections

Check for the presence of a key in the result collections

Large biller search for bill.com api

List approvers for bill.com api

List message for bill.com api

Return the list of organisation associated with your account

List payments for bill.com api

List user approvals for bill.com api

Login to bill.com api

logout from Bill.com api

Mail invoice for bill.com api

Multi factor authentication authenticate for bill.com api

Multi factor authentication challenge for bill.com api

Multi factor authentication status for bill.com api

Network search for bill.com api

Record accounts payable payment for bill.com api

Record accounts receivable payment for bill.com api

Search entity for bill.com api

Send invite for bill.com api

Send invoice for bill.com api

Send message for bill.com api

Send vendor invite for bill.com api

set_api_url set object "api_url" value

Set approvers for bill.com api

Set bank balance for bill.com api

Set customer authorization for bill.com api

set_dev_key set object "dev_key" value

set_org_id set object "org_id" value

set_password set object "password" value

set_session_id set object "session_id" value

set_user_name set object "user_name" value

Upload attachment for bill.com api

Void accounts payable payment for bill.com api

Link to this section Types

Specs

conn() :: %{
  dev_key: String.t(),
  org_id: String.t(),
  password: String.t(),
  user_name: String.t(),
  session_id: String.t(),
  api_url: String.t(),
  conn_url: String.t()
}

Link to this section Functions

Link to this function

approve(connection, data)

View Source

Specs

approve(map(), map()) :: any()

Approve for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

cancel_ap_payment(connection, data)

View Source

Specs

cancel_ap_payment(map(), map()) :: any()

Cancel accounts payable payment for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

cancel_invite(connection, data)

View Source

Specs

cancel_invite(map(), map()) :: any()

Cancel invite for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

charge_customer(connection, data)

View Source

Specs

charge_customer(map(), map()) :: any()

Charge customer for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

clear_approvers(connection, data)

View Source

Specs

clear_approvers(map(), map()) :: any()

Cle accounts receivable approvers for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

connect_large_biller_as_vendor(connection, data)

View Source

Specs

connect_large_biller_as_vendor(map(), map()) :: any()

Connect large biller as vendor for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}

Specs

deny(map(), map()) :: any()

Deny for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

disconnect_customer_from_network(connection, data)

View Source

Specs

disconnect_customer_from_network(map(), map()) :: any()

Disconnect customer from network for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

disconnect_vendor_from_network(connection, data)

View Source

Specs

disconnect_vendor_from_network(map(), map()) :: any()

Disconnect vendor from network for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

get_ap_summary(connection, data)

View Source

Specs

get_ap_summary(map(), map()) :: any()

Get accounts payable summary for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}

Specs

get_api_url(conn()) :: String.t()

get_api_url get object value api_url

Parameters:

Actual connexion structure (see billcom.login!/0)

return:

api_url value

Link to this function

get_ar_summary(connection, data)

View Source

Specs

get_ar_summary(map(), map()) :: any()

Get accounts receivable summary for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

get_bank_balance(connection, data)

View Source

Specs

get_bank_balance(map(), map()) :: any()

Get bank balance for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

get_check_image_data(connection, data)

View Source

Specs

get_check_image_data(map(), map()) :: any()

Get check image data for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}

Return the colection data from the result collection

Parameters:

Result collection of a api call. It can be the tuple of the api call or a map which is usually the second element of the return of any api cal

return:

  • success: value
  • failure: unkown behavior

Specs

get_dev_key(conn()) :: String.t()

get_dev_key get object value dev_key

Parameters:

Actual connexion structure (see billcom.login!/0)

return:

dev_key value

Link to this function

get_disbursement_data(connection, data)

View Source

Specs

get_disbursement_data(map(), map()) :: any()

Get disbursement data for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

get_document_pages(connection, data)

View Source

Specs

get_document_pages(map(), map()) :: any()

Get document pages for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

get_entity_metadata(connection, data)

View Source

Specs

get_entity_metadata(map(), map()) :: any()

Get entity metadata for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

get_large_biller_payment_address(connection, data)

View Source

Specs

get_large_biller_payment_address(map(), map()) :: any()

Get large biller payment address for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

get_network_status(connection, data)

View Source

Specs

get_network_status(map(), map()) :: any()

Get network status for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

get_object_url(connection, data)

View Source

Specs

get_object_url(map(), map()) :: any()

Get object url for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}

Specs

get_org_id(conn()) :: String.t()

get_org_id get object value org_id

Parameters:

Actual connexion structure (see billcom.login!/0)

return:

org_id value

Specs

get_password(conn()) :: String.t()

get_password get object value password

Parameters:

Actual connexion structure (see billcom.login!/0)

return:

password value

Link to this function

get_profile_permissions(connection, data)

View Source

Specs

get_profile_permissions(map(), map()) :: any()

Get profile permissions for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}

Specs

get_session_id(conn()) :: String.t()

get_session_id get object value session_id

Parameters:

Actual connexion structure (see billcom.login!/0)

return:

session_id value

Specs

get_user_name(conn()) :: String.t()

get_user_name get object value user_name

Parameters:

Actual connexion structure (see billcom.login!/0)

return:

user_name value

Specs

get_val(map(), String.t()) :: atom()
get_val(map(), tuple()) :: atom()

Return the value of a key in the result collections

Parameters:

  • result: collection of data from another api call.
  • key: the key you are looking for

    return:

  • success: value
  • failure: unkown behavior see has_key?/2

Specs

has_key?(map(), String.t()) :: atom()

Check for the presence of a key in the result collections

Parameters:

  • result: collection of data from another api call
  • key: the key you are looking for

return:

  • success: true
  • failure: false
Link to this function

large_biller_search(connection, data)

View Source

Specs

large_biller_search(map(), map()) :: any()

Large biller search for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

list_approvers(connection, data)

View Source

Specs

list_approvers(map(), map()) :: any()

List approvers for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

list_message(connection, data)

View Source

Specs

list_message(map(), map()) :: any()

List message for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}

Specs

list_orgs(conn()) :: {atom(), map()}

Return the list of organisation associated with your account

Parameters:

conn - see Billcom.login!/0

Return

Success

{:ok, val}

from where you can fetch organisation list (example: val |> Map.fetch!("response_data"))

Failure

{:error, val}

where date are failure reasons

Link to this function

list_payments(connection, data)

View Source

Specs

list_payments(map(), map()) :: any()

List payments for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

list_user_approvals(connection, data)

View Source

Specs

list_user_approvals(map(), map()) :: any()

List user approvals for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}

Specs

login!() :: conn()

Login to bill.com api

Parameters:

none - the module load a configuration from config file

Configuration file:

config :billcom, :api,
%{
  devKey: "T3WMJHVXXYZUSUKQE9CDPEKN",
  orgId: "Y8RGTBK2PXFGBUQMSCNM",
  password: "AJXR5CZJBPJD",
  userName: "sarah.connor@example.com"
}

Return:

success:

{:ok, conn}

A bill.com connexiton structure

failure: raise error

Specs

logout(conn()) :: {atom(), map()}

logout from Bill.com api

Parameters:

conn - see Billcom.login!/0

Return:

Success:

{:ok, val}

where data are logout data

Failure:

{:error, val}

where date are failure reasons

Link to this function

mail_invoice(connection, data)

View Source

Specs

mail_invoice(map(), map()) :: any()

Mail invoice for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

mfa_authenticate(connection, data)

View Source

Specs

mfa_authenticate(map(), map()) :: any()

Multi factor authentication authenticate for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

mfa_challenge(connection, data)

View Source

Specs

mfa_challenge(map(), map()) :: any()

Multi factor authentication challenge for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

mfa_status(connection, data)

View Source

Specs

mfa_status(map(), map()) :: any()

Multi factor authentication status for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

network_search(connection, data)

View Source

Specs

network_search(map(), map()) :: any()

Network search for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

record_ap_payment(connection, data)

View Source

Specs

record_ap_payment(map(), map()) :: any()

Record accounts payable payment for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

record_ar_payment(connection, data)

View Source

Specs

record_ar_payment(map(), map()) :: any()

Record accounts receivable payment for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

search_entity(connection, data)

View Source

Specs

search_entity(map(), map()) :: any()

Search entity for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

send_invite(connection, data)

View Source

Specs

send_invite(map(), map()) :: any()

Send invite for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

send_invoice(connection, data)

View Source

Specs

send_invoice(map(), map()) :: any()

Send invoice for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

send_message(connection, data)

View Source

Specs

send_message(map(), map()) :: any()

Send message for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

send_vendor_invite(connection, data)

View Source

Specs

send_vendor_invite(map(), map()) :: any()

Send vendor invite for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}

Specs

set_api_url(conn(), String.t()) :: String.t()

set_api_url set object "api_url" value

Parameters:

  • conn: actual connexion structure
  • val: value of the object

return:

new conn strucutre with api_url set to val

Link to this function

set_approvers(connection, data)

View Source

Specs

set_approvers(map(), map()) :: any()

Set approvers for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

set_bank_balance(connection, data)

View Source

Specs

set_bank_balance(map(), map()) :: any()

Set bank balance for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

set_customer_authorization(connection, data)

View Source

Specs

set_customer_authorization(map(), map()) :: any()

Set customer authorization for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}

Specs

set_dev_key(conn(), String.t()) :: String.t()

set_dev_key set object "dev_key" value

Parameters:

  • conn: actual connexion structure
  • val: value of the object

return:

new conn strucutre with dev_key set to val

Specs

set_org_id(conn(), String.t()) :: String.t()

set_org_id set object "org_id" value

Parameters:

  • conn: actual connexion structure
  • val: value of the object

return:

new conn strucutre with org_id set to val

Specs

set_password(conn(), String.t()) :: String.t()

set_password set object "password" value

Parameters:

  • conn: actual connexion structure
  • val: value of the object

return:

new conn strucutre with password set to val

Link to this function

set_session_id(conn, val)

View Source

Specs

set_session_id(conn(), String.t()) :: String.t()

set_session_id set object "session_id" value

Parameters:

  • conn: actual connexion structure
  • val: value of the object

return:

new conn strucutre with session_id set to val

Link to this function

set_user_name(conn, val)

View Source

Specs

set_user_name(conn(), String.t()) :: String.t()

set_user_name set object "user_name" value

Parameters:

  • conn: actual connexion structure
  • val: value of the object

return:

new conn strucutre with user_name set to val

Link to this function

update_map(map, key, val)

View Source
Link to this function

upload_attachment(connection, data)

View Source

Specs

upload_attachment(map(), map()) :: any()

Upload attachment for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}
Link to this function

void_ap_payment(connection, data)

View Source

Specs

void_ap_payment(map(), map()) :: any()

Void accounts payable payment for bill.com api

Parameters:

  • conn: a connection structure (see Billcom.login!/0)
  • data: data object to send for the object

return:

success:

{:ok, val}

fail:

{:error, val}