Class: XpensifySDK::HTTPClient

Inherits:
Object
  • Object
show all
Defined in:
lib/xpensify_sdk/http_client.rb

Constant Summary collapse

API_URL =
'https://api.xpensify.app/api/v1'.freeze

Class Method Summary collapse

Class Method Details

.invoice(id, api_key) ⇒ Object



16
17
18
19
20
21
# File 'lib/xpensify_sdk/http_client.rb', line 16

def invoice(id, api_key)
  HTTP.get(
    "#{API_URL}/invoices/#{id}",
    headers: build_headers(api_key)
  )
end

.invoices(api_key, params) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/xpensify_sdk/http_client.rb', line 8

def invoices(api_key, params)
  HTTP.get(
    "#{API_URL}/invoices",
    params: params,
    headers: build_headers(api_key)
  )
end