Socket
Book a DemoInstallSign in
Socket

xtract-sdk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xtract-sdk

0.0.5
bundlerRubygems
Version published
Maintainers
1
Created
Source

XtractSDK

This gem is the official library provided by Xtract to interact with our API.

You can read the API docs directly from here.

Installation

Add this line to your application's Gemfile:

gem 'xtract-sdk'

And then execute:

$> bundle

Or install it yourself as:

$> gem install xtract-sdk

Usage

First you need to configure your api key obtained from the platform:

XtractSDK.configure do |config|
  config.api_key = 'API_KEY'
end

Also you can pass the key when creating the client directly:

client = XtractSDK::Client.new(api_key: 'API_KEY')

Then you can create a client and start making requests. We provide a convenient way to do this:

Get invoices

client = XtractSDK::Client.new
invoices = client
    .invoices
    .client_tax_id('SOME_TAX_ID')
    .call

invoices.each do |invoice|
  puts invoice.id
  puts invoice.products
end

These are all the filtering options:

client_business_name
client_tax_id
provider_business_name
provider_tax_id
date_from
date_to
expiration_date_from
expiration_date_to
number
electronic_authorization_id
created_at_from
created_at_to
accounted ('pending', 'in_progress', 'completed', 'with_errors')
imputed (true, false)
approval_status ('unassigned', 'approved', 'rejected', 'approval_pending', 'on_hold')

Get an invoice

client = XtractSDK::Client.new
invoice = client.invoice(ID)

puts invoice.id
puts invoice.products

Update an invoice

client = XtractSDK::Client.new
client.update_invoice(ID, { accounted: 'completed' }) #=> :ok

Errors

You can check here all the error classes that the library raises.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/xtractapp/ruby-sdk.

FAQs

Package last updated on 24 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.