Tipalti.Procurement.Employees (tipalti_client v1.0.0)

Copy Markdown View Source

Procurement REST API — bulk employee import via CSV.

This is a three-step flow against triggers.(sandbox.)approve.com:

  1. get_upload_url/1 — request a short-lived (60 second) signed upload URL.
  2. upload_csv/2PUT the CSV bytes directly to that URL (max 10MB).
  3. import_csv/1 — tell Tipalti to import the file that was just uploaded.

import_employees/2 wraps all three steps for the common case where you already have the CSV contents in memory.

csv = File.read!("employees.csv")
{:ok, _result} = Tipalti.Procurement.Employees.import_employees(config, csv)

Once imported, payer admins invite the employees via Procurement settings in the Tipalti Hub (or, with SSO, employees can self-access without an invite and are assigned the employee role automatically).

Summary

Functions

Requests a signed upload URL, valid for 60 seconds.

Triggers Tipalti to import the CSV file that was just uploaded via upload_csv/2.

Runs the full upload-URL → upload → import flow for the given CSV content.

Uploads raw CSV content (max 10MB) directly to a previously-obtained signed URL (from get_upload_url/1). This is a plain, unauthenticated PUT to that URL — Tipalti's own signature is embedded in the URL.

Functions

get_upload_url(config)

@spec get_upload_url(Tipalti.Config.t()) :: {:ok, map()} | {:error, Exception.t()}

Requests a signed upload URL, valid for 60 seconds.

get_upload_url!(config)

@spec get_upload_url!(Tipalti.Config.t()) :: map()

import_csv(config)

@spec import_csv(Tipalti.Config.t()) :: {:ok, map()} | {:error, Exception.t()}

Triggers Tipalti to import the CSV file that was just uploaded via upload_csv/2.

import_csv!(config)

@spec import_csv!(Tipalti.Config.t()) :: map()

import_employees(config, csv_content)

@spec import_employees(Tipalti.Config.t(), binary()) ::
  {:ok, map()} | {:error, Exception.t()}

Runs the full upload-URL → upload → import flow for the given CSV content.

import_employees!(config, csv_content)

@spec import_employees!(Tipalti.Config.t(), binary()) :: map()

upload_csv(upload_url, csv_content)

@spec upload_csv(String.t(), binary()) :: :ok | {:error, Exception.t()}

Uploads raw CSV content (max 10MB) directly to a previously-obtained signed URL (from get_upload_url/1). This is a plain, unauthenticated PUT to that URL — Tipalti's own signature is embedded in the URL.