Plans
POST/v1/installment-purchases

Request installment purchase

View as .md
curl -X POST "https://api.52-28-238-205.sslip.io/v1/installment-purchases" \  -H "Authorization: Bearer agk_test_..." \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{"plan_id":"pof_01jd2x3k4m5n6p7q8r9s0t1v2w","task_id":"research-feed","idempotency_key":"research-feed-plan-1"}'

An agent asks to buy a published plan offer (installments or subscription); the full terms go through policy and usually one approval. Agent credential only; requires an Idempotency-Key (header or body), and a retry with the same key returns the first result.

Server URLhttps://api.52-28-238-205.sslip.io
POST/v1/installment-purchasesBase URL: https://api.52-28-238-205.sslip.io
Authorization
  • agentKeyAuthorization: Bearer agk_test_...
Headers
  • Idempotency-Keystring

    Required (header, or idempotency_key in the body). A retry with the same key returns the same plan and intent.

Body

application/json · required. Fields are listed under Request body below.

Runs the same action from an agent, under the same policy.
IdempotentIdempotency-Key
Send a unique key per request. The same key with the same body returns the first result instead of acting twice; the same key with a different body is refused with 409 IDEMPOTENCY_CONFLICT. How keys work
Policy decisionREQUIRE_APPROVAL · DENY
The policy engine decides this call. The result carries the decision and a reason code; see reason codes.

Authorization

agentKey
headerAuthorizationBearer <agk_test_...>

Agent credential

Header Parameters

Idempotency-Key?|

Required (header, or idempotency_key in the body). A retry with the same key returns the same plan and intent.

Request Body

application/json
  1. body
plan_id?|

Plan id (pln_...).

plan_offer_id?string|null
task_id?|

The agent's own task reference, stored with the intent for tracing.

purpose?|

The agent's stated purpose (up to 500 characters). Shown to approvers and screened by Shield; not in the public receipt.

idempotency_key?|

Unique key per purchase; a retry with the same key returns the first result instead of paying twice.

Response Body

Success.

application/json
  1. response
status*Status

Current state; the allowed values and moves are in the state machines reference.

plan_id*Plan Id

Plan id (pln_...).

intent_id*Intent Id

Payment intent id (pi_...).

plan_status*Plan Status
payment_status*Payment Status

Payment state of the intent; the allowed values and moves are in the state machines reference.

decision?|

Policy decision: ALLOW, REQUIRE_APPROVAL or DENY.

reason_code?|

Machine-readable reason from the reason code catalog, for example ABOVE_AUTO_THRESHOLD.

total_base_units*Total Base Units

Total in integer base units, carried as a string.

count*Count
amount_base_units*Amount Base Units

Amount in integer base units, carried as a string (USDC and USDT have 6 decimals: "50000" = 0.05).

period_seconds*Period Seconds
asset?|

Asset symbol, for example USDC or USDT; USD for card amounts.

network?|

Network as a CAIP-2 id, for example eip155:84532 (Base Sepolia) or solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1 (Solana devnet).

schedule?array<>
Default[]
approval_id?|

Approval id (apr_...).

approval_expires_at?string|null
poll_after_ms?integer|null
message?string|null
[key: string]?any