Aller au contenu
agentsub
Esc
↑↓naviguer↵ouvrir⌘Japerçu

Create a Link checkout session

Owner only. credits is limited to 100 or 500 (i.e. $1.00 or $5.00 at 1 credit = $0.01). Requires an Idempotency-Key.

POST/v1/payments/checkout
Authorization
AuthorizationBearer token (JWT) · headerrequired

Clerk human owner session JWT; iss must equal the configured Clerk issuer and the identity must be a human (not agent) owner with a verified email.

or
AuthorizationOAuth2 access token · headerrequired
Scopes:agentsub:owner
Header parameters
Idempotency-Keystringrequired

Required only where this parameter is listed. Same payload/key recovers prior operation; secret replays omit plaintext.

matches ^[A-Za-z0-9._:-]{1,200}$
Request body
requiredapplication/json
agentIdstringrequired
min length 1 · max length 200
creditsintegerrequired
Allowed:100500
Responses
200

Checkout session (hosted Link approval URL)

object
400

invalid_input or idempotency_required payment error

codestringrequired
Allowed:owner_requiredagent_mismatchidempotency_requiredinvalid_inputstripe_signature_requiredpayment_unavailable
statusintegerrequired
403

owner_required when called with an agent token

codestringrequired
Allowed:owner_requiredagent_mismatchidempotency_requiredinvalid_inputstripe_signature_requiredpayment_unavailable
statusintegerrequired
503

payment_unavailable

codestringrequired
Allowed:owner_requiredagent_mismatchidempotency_requiredinvalid_inputstripe_signature_requiredpayment_unavailable
statusintegerrequired
Request
curl -X POST 'https://api.agentsub.dev/v1/payments/checkout' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Idempotency-Key: string' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "agentId": "string",
  "credits": 100
}'
Response
{}