aria-partner-api

Purchase seats and credits

Seat and credit purchases are charged on the partner payment method set up in the admin dashboard. A credit reaches a member from the pool when you create a scan-only account or request a scan (Scan credits); that does not charge.

Send an optional Idempotency-Key header, 1–64 characters. Repeating a request with the same key and body returns the original response and does not charge again. Reusing the key with a different body returns 409 (error: idempotency_conflict). A key that is empty or over 64 characters returns 400 (error: invalid_idempotency_key).

Where Path What it does
Partner POST /api/v1/partner/seats/ Buys subscription seats (charge_type "subscription")
Partner POST /api/v1/partner/credits/ Buys unassigned on-demand credits into the org pool

Purchase seats

POST /api/v1/partner/seats/

Buys subscription seats and adds them to available right away. An on-demand product_id returns 400 (error: not_a_subscription).

Product Billing What you get
Subscription Added to the recurring subscription, prorated to the current period (monthly or annually). Seats in use and unused seats renew automatically quantity seats. An unused seat still bills

Price comes from price_per_seat on the inventory row at the time of purchase. Purchases are final: seats cannot be refunded or released once bought, so size quantity to what you will assign. Inventory is GET /api/v1/partner/seats/.

Request body

Field Required Type Description
product_id Yes integer Subscription product_id from seat inventory
quantity Yes integer Seats to buy. 1–1000 per request

Examples

Core subscription seats:

POST /api/v1/partner/seats/
Content-Type: application/json
Authorization: Bearer <api_key>
Idempotency-Key: order-2026-09-30-core-a1

{
  "product_id": 101,
  "quantity": 25
}

Advanced subscription seats:

{
  "product_id": 103,
  "quantity": 5
}

Success (201 Created)

{
  "product_id": 101,
  "product_name": "Core",
  "description": "Scan and removal subscription on the Core catalog.",
  "charge_type": "subscription",
  "billing_frequency": "monthly",
  "quantity": 25,
  "price_per_seat": 999,
  "amount_charged": 12450,
  "currency": "usd",
  "invoice_url": "https://invoice.stripe.com/i/acct_123/inv_456",
  "purchased_at": "2026-09-30T20:15:00.000000+00:00",
  "seat_summary": {
    "product_id": 101,
    "total": 75,
    "occupied": 12,
    "available": 63
  }
}
Field Type Description
product_id, product_name, description, charge_type, billing_frequency, price_per_seat — Same values as GET /api/products/
quantity integer Seats added
price_per_seat integer Unit price in cents at purchase time
amount_charged integer Prorated charge for the current period, in cents
currency string ISO 4217 code
invoice_url string Stripe-hosted receipt for this charge
purchased_at string When the purchase completed (UTC, ISO 8601)
seat_summary object Updated total, occupied, and available for the product

A repeated request with the same Idempotency-Key returns 200 OK with the original body.

Errors

Status Condition
400 Unknown product_id (error: product_not_configured); on-demand product_id (error: not_a_subscription); quantity missing, not an integer, or out of range; Idempotency-Key empty or over 64 characters (error: invalid_idempotency_key)
402 No payment method on file (error: payment_method_required), or the charge was declined (error: payment_failed; includes Stripe’s decline_code when available)
403 Missing or invalid API key, or partner inactive, or the partner’s contract does not allow API purchases for this product (error: purchase_not_allowed)
409 Purchase would exceed the contractual cap for the product (error: seat_cap_exceeded; includes total, max_total), or Idempotency-Key reused with a different body (error: idempotency_conflict)

No seats are added when the request fails.

Purchase history, invoices, and receipts are tracked in Stripe. Review them in the admin dashboard or follow invoice_url from the purchase response; the API does not list past purchases.

Purchase credits

POST /api/v1/partner/credits/

Buys on-demand credits and adds them to the org pool, unassigned. A subscription product_id returns 400 (error: not_on_demand). The pool is GET /api/v1/partner/credits/. Assigning credits to a member draws from available and does not charge again.

Product Billing What you get
On-demand product Charged once, at price_per_seat × quantity quantity unassigned credits in the org pool

Request body

Field Required Type Description
product_id Yes integer On-demand product_id from GET /api/products/
quantity Yes integer Credits to buy. 1–1000 per request

Example

POST /api/v1/partner/credits/
Content-Type: application/json
Authorization: Bearer <api_key>
Idempotency-Key: credits-2026-10-12-a1

{
  "product_id": 201,
  "quantity": 25
}

Success (201 Created)

{
  "product_id": 201,
  "product_name": "Core Scan",
  "description": "On-demand scan of the Core catalog.",
  "charge_type": "on_demand",
  "billing_frequency": "one_time",
  "quantity": 25,
  "price_per_seat": 299,
  "amount_charged": 7475,
  "currency": "usd",
  "invoice_url": "https://invoice.stripe.com/i/acct_123/inv_789",
  "purchased_at": "2026-10-12T20:15:00.000000+00:00",
  "credit_summary": {
    "product_id": 201,
    "total": 25,
    "occupied": 0,
    "available": 25
  }
}
Field Type Description
product_id, product_name, description, charge_type, billing_frequency, price_per_seat — Same values as GET /api/products/
quantity integer Credits added to the pool
price_per_seat integer Unit price in cents at purchase time
amount_charged integer Charge in cents
currency string ISO 4217 code
invoice_url string Stripe-hosted receipt for this charge
purchased_at string When the purchase completed (UTC, ISO 8601)
credit_summary object Updated total, occupied, and available for the product

A repeated request with the same Idempotency-Key returns 200 OK with the original body.

Errors

Status Condition
400 Unknown product_id (error: product_not_configured); subscription product_id (error: not_on_demand); quantity missing, not an integer, or out of range; Idempotency-Key empty or over 64 characters (error: invalid_idempotency_key)
402 No payment method on file (error: payment_method_required), or the charge was declined (error: payment_failed; includes Stripe’s decline_code when available)
403 Missing or invalid API key, or partner inactive, or the partner’s contract does not allow API purchases for this product (error: purchase_not_allowed)
409 Idempotency-Key reused with a different body (error: idempotency_conflict)

No credits are added when the request fails.