Plixstar
API Reference

Admin b2b

GET
/api/v1/admin/b2b/companies

Optional status filter. No filter = all statuses, newest first. Includes owner profile. ssm_cert_url is the public-bucket helper url (signed-url port deferred).

Authorization

better-auth.session_token
better-auth.session_token<token>

In: cookie

Query Parameters

status*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/admin/b2b/companies?status=string"
[  {    "id": "string",    "name": "string",    "ssm_number": "string",    "industry": "string",    "address": "string",    "contact_name": "string",    "contact_phone": "string",    "contact_email": "string",    "owner_id": "string",    "status": "string",    "rejection_reason": "string",    "reviewed_by": "string",    "reviewed_at": "string",    "ssm_cert_path": "string",    "created_at": "string",    "updated_at": "string",    "owner": {      "id": "string",      "full_name": "string",      "email": "string"    },    "ssm_cert_url": "string"  }]
GET
/api/v1/admin/b2b/companies/pending

Authorization

better-auth.session_token
better-auth.session_token<token>

In: cookie

Response Body

application/json

curl -X GET "https://example.com/api/v1/admin/b2b/companies/pending"
[  {    "id": "string",    "name": "string",    "ssm_number": "string",    "industry": "string",    "address": "string",    "contact_name": "string",    "contact_phone": "string",    "contact_email": "string",    "owner_id": "string",    "status": "string",    "rejection_reason": "string",    "reviewed_by": "string",    "reviewed_at": "string",    "ssm_cert_path": "string",    "created_at": "string",    "updated_at": "string",    "owner": {      "id": "string",      "full_name": "string",      "email": "string"    },    "ssm_cert_url": "string"  }]
GET
/api/v1/admin/b2b/companies/{id}

Includes owner + ssm_cert_url. Signed-url port deferred — for now the helper returns the public-bucket URL or null.

Authorization

better-auth.session_token
better-auth.session_token<token>

In: cookie

Path Parameters

id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/admin/b2b/companies/string"
{}
POST
/api/v1/admin/b2b/companies/{id}/approve

Sets status=approved, stamps reviewed_by/at, and creates (or reactivates) a b2b_members row for the owner with company_admin role.

Authorization

better-auth.session_token
better-auth.session_token<token>

In: cookie

Path Parameters

id*string

Response Body

curl -X POST "https://example.com/api/v1/admin/b2b/companies/string/approve"
Empty
POST
/api/v1/admin/b2b/companies/{id}/reject

Authorization

better-auth.session_token
better-auth.session_token<token>

In: cookie

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://example.com/api/v1/admin/b2b/companies/string/reject" \  -H "Content-Type: application/json" \  -d '{    "reason": "string"  }'
Empty