Shift4 Payments · API Governance Rules
Shift4 Payments API Rules
Spectral linting rules defining API design standards and conventions for Shift4 Payments.
15 Rules
error 3
warn 9
Rule Categories
shift4
Rules
error
shift4-operation-id-required
All Shift4 operations must have an operationId.
$.paths[*][get,post,put,patch,delete]
warn
shift4-operation-id-camel-case
Shift4 operationIds use camelCase (e.g., createCharge, listEvents).
$.paths[*][get,post,put,patch,delete].operationId
warn
shift4-tags-required
All Shift4 operations must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
hint
shift4-summary-title-case
Operation summaries should use Title Case.
$.paths[*][get,post,put,patch,delete].summary
warn
shift4-no-versioned-paths
Shift4 paths are unversioned (no /v1/ prefix); the version lives in the secret key.
$.paths[*]~
warn
shift4-no-trailing-slash
Shift4 paths must not have trailing slashes.
$.paths[*]~
error
shift4-basic-auth-defined
Shift4 uses HTTP Basic auth with the secret key as username.
$.components.securitySchemes
warn
shift4-server-production
The Shift4 production server must be https://api.shift4.com.
$.servers[*].url
warn
shift4-amount-integer
Amount fields must be integers expressed in the smallest currency unit.
$.components.schemas[*].properties.amount.type
warn
shift4-currency-string
Currency must be a string (ISO 4217 code).
$.components.schemas[*].properties.currency.type
hint
shift4-created-int64
Resource 'created' timestamps are Unix seconds (integer int64).
$.components.schemas[*].properties.created
warn
shift4-response-200-defined
All Shift4 operations should define a 200 response.
$.paths[*][get,post,put,patch,delete].responses
hint
shift4-list-response-shape
List endpoints should use a list/hasMore/totalCount envelope.
$.components.schemas[?(@property.match(/^ListResponse/))].properties
warn
shift4-info-contact
Shift4 OpenAPI specs must include contact info.
$.info
error
shift4-servers-defined
Shift4 API must define at least one server.
$