Skip to content
Pine Computer Request access
Menu

03 / 26 Work on sites with no API · Example

Post supplier invoices

Your payables software pulls each invoice off the supplier’s portal and matches every line to the purchase order.

Illustration of an example: in your customer’s payables software, this week’s supplier invoices are collected at once, each on a computer of its own working its supplier’s portal. Boxwell shows invoices to account holders only, so someone in finance signs in on its screen and hands it back. Each invoice comes back to its order’s row as the supplier’s PDF, its lines matched to the purchase order and ready to post; nothing is posted.
Who it’s for
Accounts-payable software whose customers’ suppliers post invoices on a portal and never email them.
Why it’s hard
Few supplier portals offer an export, so each invoice is downloaded by hand. Boxwell billed PO-4471 on two invoices, so neither total matches the order alone.
You get back
  • Each new invoice, as the supplier’s PDF
  • A line-by-line match against its purchase order
  • Any price or quantity that differs, flagged
How it runs, in your product’s code

Every Monday, a computer opens each supplier’s portal and searches by purchase order. Boxwell shows invoices to account holders only, so someone in your customer’s finance team signs in. Each invoice’s lines are compared with the order’s quantities and prices. Invoices that agree turn to Ready to post, and the posting is left to your product.

Ruby · task-turn excerpt
# Existing backend Computer and session; see setup docs.# saved_message_id is your durable ID for this request.computer.require_agent_protocol!agent = session.agentgoal = <<~JOB  Download this week’s invoices from each supplier’s portal and  match every line to its purchase order. Don’t post anything.JOBturn = agent.run(goal, idempotency_key: saved_message_id)# Persist turn.turn_id before waiting or leaving this process.turn = agent.wait(turn_id: turn.turn_id, timeout: 30)case turn.statewhen "running", "canceling"  # Schedule another wait for this turn ID.when "needs_input"  # Present turn.question; authorize any desktop handoff.  # When the user replies, answer this turn and save the new ID:  # agent.answer(turn_id: turn.turn_id, answer: reply.text)when "answered"  # Continue with turn.next_turn_id; do not resubmit the goal.when "completed"  turn.result.artifacts.each do |file|    bytes = session.read_file(file.fetch("relative_path"))    # Save bytes in your own file store before stopping.  end  # Verify the outputs and external state against the request.when "failed", "canceled"  # Record the outcome; check side effects before any retry.end

Requires a configured Computer, session and durable request ID. The comments mark application logic you supply; this excerpt does not implement storage, polling or human handoff. Agent integration · Saving outputs

Build more.
Hand AI the work.