Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

How the StockShift apps sign in. The app opens /apps/authorize in the system browser with a PKCE S256 challenge and the thumbprint of its device key. The member signs in there, with every check the web enforces. The browser returns a code to the app, which trades it at POST /apps/token with the PKCE verifier and a DPoP proof (RFC 9449) signed by the device key. The answer holds an access token of one hour, which is sent as a bearer token on every call, and a rotating refresh token of 30 days. A refresh needs a DPoP proof with the server's latest nonce, so a stolen refresh token is useless without the device key. A session ends 180 days after sign-in at most. Every app request carries StockShift-Client: / (), such as ios/1.4.2 (311). Below the minimum of GET /apps/version-policy a call is answered 426 client_upgrade_required with the minimum and the store link. Below the deprecated-below version it works and the response adds StockShift-Client-Deprecated: sunset=; minimum=. Signing in and out, the device status, wipe receipt and PIN lock calls and the version policy answer every version.

Body

application/json

A PIN signature from a device: the signed Action and the assertion the device key signed, with a DPoP proof in the DPoP header.

action
enum<string>
required

The Action to sign, by its public name, as named to POST /api/v1/access/signatures/start.

Available options:
devices.wipe,
engineering.ecos.approve,
inventory.periods.reopen,
inventory.verifications.request,
inventory.verifications.witness,
sales.certificates.sign,
sales.shipments.post-certified
Example:

"devices.wipe"

assertion
string
required

The device-signature+jwt the device key signed once the PIN was checked: sub, device, act, meaning, digest, pin, iat and jti.

Maximum string length: 8192
Example:

"eyJ0eXAiOiJkZXZpY2Utc2lnbmF0dXJlK2p3dCIsImFsZyI6IkVTMjU2In0.eyJzdWIiOiI3In0.c2lnbmF0dXJl"

Response

DeviceSignatureResource

data
DeviceSignatureResource · object
required