Procurement REST API — bulk employee import via CSV.
This is a three-step flow against triggers.(sandbox.)approve.com:
get_upload_url/1— request a short-lived (60 second) signed upload URL.upload_csv/2—PUTthe CSV bytes directly to that URL (max 10MB).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
@spec get_upload_url(Tipalti.Config.t()) :: {:ok, map()} | {:error, Exception.t()}
Requests a signed upload URL, valid for 60 seconds.
@spec get_upload_url!(Tipalti.Config.t()) :: map()
@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.
@spec import_csv!(Tipalti.Config.t()) :: map()
@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.
@spec import_employees!(Tipalti.Config.t(), binary()) :: map()
@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.