Lesson 1 — Your first API call

Every Transxact integration starts the same way: authenticate with a key, and

prove you can talk to the API. This lesson gets you from zero to a verified

key pair in test mode.

Why keys come first

Transxact uses two key types, scoped to a mode:

  • Secret key (sk_test_…) — server-side only. Creates payment intents,

confirms them, and creates links.

  • Publishable key (pk_test_…) — safe for client-side use. May only

create payment intents and drive the hosted checkout.

Test-mode keys are fully isolated from live mode: no real money moves, and

every rail is simulated inside the aggregator.

Create your keys

Sign in to the Developer section (or use the CLI):


transxact keys:create --mode test

Store the secret key somewhere safe — it is shown exactly once at creation.

Make an authenticated call

The simplest read is fetching an intent that does not exist yet — the error

body proves your authentication worked and introduces the error object:


curl https://api.transxact.io/payment-intents/pi_does_not_exist \
  -H "Authorization: Bearer sk_test_..."

You should see a JSON error:


{
  "error": {
    "type": "invalid_request",
    "code": "resource_missing",
    "message": "no such payment intent: pi_does_not_exist"
  }
}

Every error has this shape — a closed type set plus a machine-readable

code. Your integration should branch on type/code, never on message.

Exercise

1. Create both a secret and a publishable test key in the Developer section.

2. Repeat the curl above using the publishable key instead of the secret

key, and note the permission_error you get back.

3. Skim the API keys reference for the full rules.

This tutorial is the hands-on path. The

quickstart is the condensed version of the same flow —

use whichever fits, then keep the other as a reference.

What's next

With a working key you can create your first payment intent —

Lesson 2.


_Pattern decisions behind this tutorial (per-lesson structure, exercise

format) are recorded in ADR-0014; the canonical documentation conventions are

the documentation-standard term in CONTEXT.md._