---
title: "Create Account Login"
method: POST
path: "/v2/ap-portals/accounts"
tags: ["ap-portals"]
---

# Create Account Login

`POST /v2/ap-portals/accounts`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/ap-portals/accounts`
- Auth: HTTP bearer

Create login

Register an AP-portal login (provider + credentials) for the org. Credentials are
encrypted at rest and never returned. Tie a customer portal to it before sweeping.

## Request body

- CreateLoginRequest: Create an AP-portal login: the credentials for one buyer-portal account. Mirrors the v1 ``POST /ap-portal-accounts``. Credentials are encrypted at rest and never returned.
  - `provider` 'kehe' | 'taulia' | 'coupa' | 'ariba' | 'meijer' | 'kroger' | 'walgreens' | 'albertsons' | 'target' | 'heb' | 'heb_sidm' | 'c_and_s' | 'walmart' | 'walmart_highradius' | 'cvs' | 'cvs_sap' | 'cvs_image_silo' | 'kroger_supplier_connect' | 'kroger_claimtrax' | 'kroger_verigon' | 'servicetitan' | 'sandbox' | 'generic', required: Supported AP Portal providers.
  - `username` string, required
  - `password` string, required
  - `header_token` string, nullable: Optional header token for API authentication (e.g. x-bot-token for Walmart).
  - `totp_secret` string, nullable: Base32 TOTP seed for authenticator-app MFA; the sweep mints the one-time code at login. Write-only.
  - `scope` APPortalScope[]: Non-empty list of document kinds to sweep. Defaults to INVOICES + ORDERS for all providers; omit INVOICES for orders-only logins.
  - `login_url` string, nullable: The login's own sign-in page when it differs from the provider's default, such as https://go.servicetitan.com/ for a ServiceTitan user outside Enterprise Hub.

## Response `201`

Successful Response

- APPortalLoginItem: An AP-portal login. Credentials (password / header token / TOTP secret) are write-only and never surfaced here.
  - `id` string, required
  - `provider` 'kehe' | 'taulia' | 'coupa' | 'ariba' | 'meijer' | 'kroger' | 'walgreens' | 'albertsons' | 'target' | 'heb' | 'heb_sidm' | 'c_and_s' | 'walmart' | 'walmart_highradius' | 'cvs' | 'cvs_sap' | 'cvs_image_silo' | 'kroger_supplier_connect' | 'kroger_claimtrax' | 'kroger_verigon' | 'servicetitan' | 'sandbox' | 'generic', required: Supported AP Portal providers.
  - `username` string, nullable, required
  - `status` 'active' | 'locked' | 'awaiting_auth' | 'password_expiring' | 'password_expired' | 'connecting', required: Status of an AP portal account (the login/credential).
  - `scope` APPortalScope[], required
  - `login_url` string, nullable, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/stuut/apis/stuut-api.md) - [All operations](https://skmtc.dev/stuut/apis/stuut-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stuut/apis/stuut-api/revisions/ff0ad16a55ff?raw)
