Skip to main content

CALLBACK API Reference

Module Information

Service Files:

  • Private: service/callback.js
  • Public: service/callback.js

Available Services: 3 Documented Services: 3


callback.stripe

Stripe webhook receiver. Validates the incoming request signature using the stripe-signature header and the configured endpoint secret, then dispatches to the appropriate handler based on the Stripe event type. Handles: invoice.paid (triggers renewal_update, quota update, success email, and live notification), invoice.payment_failed (triggers renewal_update, subscription cleanup if incomplete, failure email, and live notification), customer.subscription.created (triggers subscription_update), customer.subscription.updated (triggers subscription_update, and subscription cleanup if status is incomplete_expired), customer.subscription.deleted (triggers subscription removal, quota reset to advanced plan, live notification, invoice void if open, and expiry email).

PropertyValue
ScopeHub (requires hub context)
PermissionRead (2)

Endpoint:

https://hostname/-/svc/callback.stripe

Parameters

ParameterTypeRequiredDefaultDescription
stripe-signaturestringYes-Stripe webhook signature. Read from the stripe-signature HTTP request header. Used by stripe.webhooks.constructEvent to verify the payload authenticity.
raw_bodystringYes-Raw unparsed request body read via input.raw(). Required by the Stripe SDK for signature verification; must not be pre-parsed as JSON.

Returns

FieldTypeDescription
dataobjectEmpty object. The mysession variable is initialized as an empty object and is not populated before output. Side-effects (database updates, emails, live notifications) are the primary outcome of this endpoint.

Possible Errors

Error CodeHTTP StatusDescription
WEBHOOK_ERROR400Stripe signature verification failed or event construction failed

callback.check_out_success

Stripe checkout success callback. Retrieves the completed checkout session from Stripe using the session_id query parameter and redirects the browser to the desk payment success route with the resulting subscription_id. Response is an HTML page containing a JavaScript redirect.

PropertyValue
ScopeHub (requires hub context)
PermissionRead (2)

Endpoint:

https://hostname/-/svc/callback.check_out_success

Parameters

ParameterTypeRequiredDefaultDescription
session_idstringYes-Stripe checkout session ID passed by Stripe as a query parameter on redirect. Used to retrieve the full session object including the subscription ID.

Returns

FieldTypeDescription
contentstringHTML page with an inline JavaScript redirect to the desk route: #/desk/?payment=true&success=true&subscription_id=VALUE where VALUE is the subscription ID retrieved from the Stripe checkout session

Possible Errors

Error CodeHTTP StatusDescription
INTERNAL_ERROR500Failed to retrieve the Stripe checkout session

callback.check_out_cancel

Stripe checkout cancellation callback. Redirects the browser to the desk payment cancelled route. Response is an HTML page containing a JavaScript redirect. No input parameters are required.

PropertyValue
ScopeHub (requires hub context)
PermissionRead (2)

Endpoint:

https://hostname/-/svc/callback.check_out_cancel

Parameters

No parameters

Returns

FieldTypeDescription
contentstringHTML page with an inline JavaScript redirect to the desk route: #/desk/?payment=false&cancel=true

  • ACL System - Permission model
  • Service Routing - URL patterns
  • Error Handling - Error codes