vsmsconnect — API — hike

← all endpoints

GET/api/v1/accounting/hike/start auth: jwt (administrator) + connector licence gate

Begin a Hike OAuth2 authorisation flow. Returns the Hike authorisation URL. Rate-limited (10/min `open` bucket).

handlers: HikeAuthController.start

Inputs

No parameters.

Outputs

200
APIResponseDataObject<HikeStartResponse>
`{ authorizationUrl }`.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
429
APIError
Rate limit exceeded.
GET/api/v1/accounting/hike/callback auth: none (Hike-initiated browser redirect)

Hike redirects the operator's browser here after consent. Validates `state`, exchanges `code`, upserts the store connection, then redirects to the app deep link (302 on desktop browsers; on mobile an HTML bridge page that navigates to the deep link). On failure the redirect carries a sanitised error code, never the message. Mounted without the JWT guard because no app session exists on this request.

handlers: HikeAuthController.callback

Inputs

namerequireddefaultdescription
code query
string
no—Authorisation code from Hike.
state query
string
no—OAuth state issued by `/start`.
error query
string
no—Hike error code when consent failed.

Outputs

302
empty
Redirect to the web success/failure page (desktop).
200 text/html
text/html
Mobile bridge page that returns to the app deep link.
GET/api/v1/accounting/hike/status auth: jwt (any authenticated member of the business)

Connection summary: every Hike store connection (no tokens), outlet filter list, `autoFiscaliseInvoices`, `autoFiscaliseConnector`, `syncFromDate`.

handlers: HikeAuthController.status

Inputs

No parameters.

Outputs

200
APIResponseDataObject<HikeStatusResponse>
`connected`, `connections[]`, `outlets[]`, auto-fiscalise flags, `syncFromDate`.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
DELETE/api/v1/accounting/hike/connections/:connectionId auth: jwt (administrator)

Disconnect ONE Hike store. Per connection, never business-wide: a business may hold several Hike stores.

handlers: HikeAuthController.disconnect

Inputs

namerequireddefaultdescription
connectionId path
string (uuid)
yes—Hike connection id (one per Hike store).

Outputs

200
APIResponseDataObject<{ deactivatedCount: number }>
Number of connections deactivated.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
POST/api/v1/accounting/hike/connections/:connectionId/outlets/sync auth: jwt (administrator); 10/min rate limit (`open` bucket)

Refresh the outlet catalogue from Hike for one connection. An outlet with no mapped Location BLOCKS its sales rather than inheriting a default.

handlers: HikeAuthController.syncOutlets

Inputs

namerequireddefaultdescription
connectionId path
string (uuid)
yes—Hike connection id (one per Hike store).

Outputs

200
APIResponseDataObject<HikeOutletSyncResult>
Outlet sync result.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
501
APIError
NOT_IMPLEMENTED — the service is not wired on this deployment.
429
APIError
Rate limit exceeded.
GET/api/v1/accounting/hike/connections/:connectionId/outlets auth: jwt (administrator)

List the connection's Hike outlets with their mapped VSMS Location (if any).

handlers: HikeAuthController.listOutlets

Inputs

namerequireddefaultdescription
connectionId path
string (uuid)
yes—Hike connection id (one per Hike store).

Outputs

200
APIResponseDataList<object>
Outlets with `locationId` mapping.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
501
APIError
NOT_IMPLEMENTED — the service is not wired on this deployment.
PATCH/api/v1/accounting/hike/connections/:connectionId/outlets/:outletId/location auth: jwt (administrator)

Assign (or clear) the VSMS Location for one Hike outlet. `locationId: null` clears the mapping, which BLOCKS that outlet's sales.

handlers: HikeAuthController.setOutletLocation

Inputs

namerequireddefaultdescription
connectionId path
string (uuid)
yes—Hike connection id (one per Hike store).
outletId path
string
yes—Hike's own outlet id (not validated as a UUID).
locationId body
string (uuid) | null
yes—Location to map; `null` clears. Required — omission is rejected.

Outputs

200
APIResponseDataObject<object>
Updated outlet mapping.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
501
APIError
NOT_IMPLEMENTED — the service is not wired on this deployment.
POST/api/v1/accounting/hike/outlets/resync-blocked auth: jwt (administrator)

Re-sync Hike invoices blocked by outlet routing (LOCATION_NOT_MAPPED / LOCATION_CERTIFICATE_MISSING) and dispatch the ones that can now be signed. BUSINESS-WIDE (no `:connectionId`): the same pass the dashboard action runs. Clears only the two location reasons. Runs in the background: replies `202 { runId }` at once and stores the outcome on the run. The finished run's `result` is an `APIResponseDataObject` of the re-sync counts (`reprocessed`, `nowEligible`, `nowEligibleInvoices`, `nowEligibleQuotes`, `stillBlocked`, `autoFiscalisationJobIds`).

handlers: HikeAuthController.resyncOutletBlocked

Inputs

No parameters.

Outputs

202
APIResponseDataObject<BackgroundRunAcceptedDTO>
Started in the background: `{ runId }`. Poll `GET /api/v1/businesses/:businessId/background-runs/:runId`; once `status` is `done`, `result` holds the response body this endpoint used to return.
409
APIError
BACKGROUND_RUN_IN_PROGRESS — a blocked-invoice re-sync for this business (every re-sync entry point shares one lock) is already running. `data` is `BackgroundRunInProgressDTO` (`runId`, `kind`, `params`, `startedAt`) of the running run.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
501
APIError
NOT_IMPLEMENTED — the re-sync is not wired on this deployment.
POST/api/v1/accounting/hike/registers/sync auth: jwt (administrator); 10/min rate limit (`open` bucket)

Sync Hike registers as print tills. BUSINESS-WIDE (no `:connectionId`): the Receipt Printers tab is scoped per connector, so one call refreshes every Hike store's tills.

handlers: HikeAuthController.syncRegisters

Inputs

No parameters.

Outputs

200
APIResponseDataObject<HikeRegisterSyncResult>
Register sync result.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
501
APIError
NOT_IMPLEMENTED — the service is not wired on this deployment.
429
APIError
Rate limit exceeded.
GET/api/v1/accounting/hike/register-tills auth: jwt (administrator)

List Hike register tills grouped by outlet, business-wide.

handlers: HikeAuthController.listRegisterTills

Inputs

No parameters.

Outputs

200
APIResponseDataList<object>
Register tills grouped by outlet.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
501
APIError
NOT_IMPLEMENTED — the service is not wired on this deployment.
GET/api/v1/accounting/hike/connections/:connectionId/sync auth: jwt (administrator | view_invoices | submit_invoices)

Manual Sync Now for ONE Hike store (per connection, not per business). Pulls sales, normalises and persists to `Invoices` (`Source='hike'`); with auto-fiscalise on, newly-inserted eligible invoices are dispatched as fiscalisation jobs. Both query params omitted = resume from the connection's own watermark. `modifiedSince` is a one-off lower bound that wins over the watermark and is not persisted; `dateTo` bounds the run and stops the watermark advancing. The response message is `fetched=X inserted=Y duplicates=Z laybyPayments=N refundsLinked=M[ jobIds=...]`. Runs in the background: replies `202 { runId }` at once and stores the outcome on the run. The finished run's `result` is the old synchronous body: `APIResponseDataObject<SyncHikeInvoicesResult>` with the counters `message`.

handlers: HikeAuthController.syncInvoices

Inputs

namerequireddefaultdescription
connectionId path
string (uuid)
yes—Hike connection id (one per Hike store).
modifiedSince query
YYYY-MM-DD | ISO-8601 datetime
no—Lower bound; a bare date is a wall-clock date in the store's timezone.
dateTo query
YYYY-MM-DD | ISO-8601 datetime
no—Upper bound of the run; same format as `modifiedSince`.

Outputs

202
APIResponseDataObject<BackgroundRunAcceptedDTO>
Started in the background: `{ runId }`. Poll `GET /api/v1/businesses/:businessId/background-runs/:runId`; once `status` is `done`, `result` holds the response body this endpoint used to return.
409
APIError
BACKGROUND_RUN_IN_PROGRESS — a Sync Now for this store, or the business's Hike Sync All is already running. `data` is `BackgroundRunInProgressDTO` (`runId`, `kind`, `params`, `startedAt`) of the running run.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
501
APIError
NOT_IMPLEMENTED — the service is not wired on this deployment.
POST/api/v1/accounting/hike/sync-all auth: jwt (administrator | view_invoices | submit_invoices)

Sync All for Hike: syncs the listed connections one after another in ONE background run, never two at once, so a multi-store backlog does not load the provider or the database in parallel. Each connection takes its own sync lock as it is reached; one already syncing is reported `skipped`, and one failing does not stop the rest. Replies `202 { runId }`; the finished run's `result` is an `APIResponseDataObject<SyncAllResultDTO>` whose `connections[]` hold each connection's status and the body its single Sync Now would have returned.

handlers: HikeAuthController.syncAllInvoices

Inputs

namerequireddefaultdescription
connectionIds body
uuid[] (1-50)
yes—The connections to sync, in order.
modifiedSince body
string
no—Optional lower bound, same format as the single-connection sync.
dateTo body
string
no—Optional upper bound, same format as the single-connection sync.

Outputs

202
APIResponseDataObject<BackgroundRunAcceptedDTO>
Started in the background: `{ runId }`. Poll `GET /api/v1/businesses/:businessId/background-runs/:runId`; once `status` is `done`, `result` holds the response body this endpoint used to return.
409
APIError
BACKGROUND_RUN_IN_PROGRESS — a Hike Sync All for this business is already running. `data` is `BackgroundRunInProgressDTO` (`runId`, `kind`, `params`, `startedAt`) of the running run.
422
APIError
Validation failed (missing or invalid `connectionIds`, bad date).
GET/api/v1/accounting/hike/tax-mappings auth: jwt (administrator)

List all per-business Hike tax-id → V-SDC label mappings (`Provider='hike'`), active and deactivated.

handlers: HikeTaxMappingsController.list

Inputs

No parameters.

Outputs

200
APIResponseDataList<TaxRateMappingDTO>
Mappings.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
POST/api/v1/accounting/hike/tax-mappings/seed auth: jwt (administrator)

Pull the Hike tax catalogue for one connection and seed unmapped rows. Rate-limited (10/min `open` bucket).

handlers: HikeTaxMappingsController.seed

Inputs

namerequireddefaultdescription
connectionId body
string (uuid)
yes—Connection whose taxes to pull.

Outputs

200
APIResponseDataObject<HikeTaxSeedResult>
Seed result.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
429
APIError
Rate limit exceeded.
PUT/api/v1/accounting/hike/tax-mappings auth: jwt (administrator)

Create or update one Hike tax mapping. `vsdcTaxLabel` is validated against the business's LIVE V-SDC label set.

handlers: HikeTaxMappingsController.upsert

Inputs

namerequireddefaultdescription
providerTaxType body
string
yes—Hike tax id as a string.
providerTaxName body
string | null
no—Human-readable Hike tax name.
providerRate body
number | null
no—Hike tax rate.
vsdcTaxLabel body
string
yes—V-SDC label.
vsdcRate body
number | null
no—V-SDC rate percent.

Outputs

200
APIResponseDataObject<TaxRateMappingDTO>
Upserted mapping.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
422
APIError
Invalid `vsdcTaxLabel`.
DELETE/api/v1/accounting/hike/tax-mappings/:providerTaxType auth: jwt (administrator)

Soft-delete (`IsActive = 0`, row retained).

handlers: HikeTaxMappingsController.remove

Inputs

namerequireddefaultdescription
providerTaxType path
string
yes—Hike's own tax id as a string (immutable key; never the editable tax name).

Outputs

204
empty
Deactivated.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
PATCH/api/v1/accounting/hike/tax-mappings/:providerTaxType/restore auth: jwt (administrator)

Re-activate a deactivated mapping (`IsActive = 1`).

handlers: HikeTaxMappingsController.restore

Inputs

namerequireddefaultdescription
providerTaxType path
string
yes—Hike's own tax id as a string (immutable key; never the editable tax name).

Outputs

204
empty
Re-activated.
409
APIError
BUSINESS_CONTEXT_REQUIRED.
POST/webhooks/hike/:connectionId/:hash auth: none — the URL HMAC (`:hash`) is the credential

Hike-initiated webhook delivery. Hike sends no signature, so `:hash` is verified (constant-time) against the connection id; a mismatch answers a bare 403 and writes a `HIKE_WEBHOOK_AUTH_FAILED` audit. A valid delivery is acked 200 BEFORE any work, then the sale id is enqueued on the Hike webhook Redis Stream for `HikeWebhookWorker`. Hike wraps the payload in a single top-level key named after the event (e.g. `Invoice_Created`); an unreadable body is acked and dropped.

handlers: HikeWebhookController.handle

Inputs

namerequireddefaultdescription
connectionId path
string
yes—Hike connection id.
hash path
string
yes—HMAC of the connection id; the only credential.

Outputs

200
empty
Acked; work is enqueued asynchronously.
403
empty
Hash mismatch — bare 403, no body.
POST/api/v1/accounting/hike/connections/:connectionId/outlets/:outletId/reject auth: jwt (administrator)

Decline a discovered Hike outlet; its sales are held exactly like an unmapped outlet's. Refused while the outlet is mapped — clear the mapping first. Idempotent when already rejected.

handlers: HikeAuthController.rejectOutlet

Inputs

namerequireddefaultdescription
connectionId path
string (uuid)
yes—Hike connection id (one per Hike store).
outletId path
string
yes—Hike's own outlet id (1-100 chars, not validated as a UUID).

Outputs

200
APIResponseDataObject<object>
Outlet summary with proposalStatus 'rejected'.
404
APIError
ACCOUNTING_PROVIDER_NOT_CONFIGURED (connection not found for this business) or HIKE_OUTLET_NOT_FOUND (unknown outlet — run an outlet sync first).
409
APIError
OUTLET_MAPPED_CANNOT_REJECT — the outlet still has a Location; or BUSINESS_CONTEXT_REQUIRED.
501
APIError
NOT_IMPLEMENTED — the outlet mapping service is not wired on this deployment.
POST/api/v1/accounting/hike/connections/:connectionId/outlets/:outletId/accept auth: jwt (administrator)

Accept a previously rejected Hike outlet back: it returns to the ordinary unmapped state for the admin to map. Nothing is released by accepting; held sales are freed by the re-sync once a Location is assigned. No-op for an outlet that is not rejected.

handlers: HikeAuthController.acceptOutlet

Inputs

namerequireddefaultdescription
connectionId path
string (uuid)
yes—Hike connection id (one per Hike store).
outletId path
string
yes—Hike's own outlet id (1-100 chars, not validated as a UUID).

Outputs

200
APIResponseDataObject<object>
Outlet summary with proposalStatus cleared (null).
404
APIError
ACCOUNTING_PROVIDER_NOT_CONFIGURED (connection not found for this business) or HIKE_OUTLET_NOT_FOUND (unknown outlet — run an outlet sync first).
409
APIError
BUSINESS_CONTEXT_REQUIRED.
501
APIError
NOT_IMPLEMENTED — the outlet mapping service is not wired on this deployment.