> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # RefreshPayload # Package: triggers # Namespace: TriggerProviderService # Method link: https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/refresh-payload.md ## Introduction If an automation's action is delayed, implement this method to retrieve the latest data in the trigger payload before the action fires. For example, if an automation is triggered but its action is set to fire only 24 hours later, Wix calls Refresh Payload before starting the action. This fetches the latest data in the trigger payload. The returned data can be used to update the trigger payload that is passed to the action. --- ## REST API ### Schema ``` Method: refreshPayload Description: If an automation's action is delayed, implement this method to retrieve the latest data in the trigger payload before the action fires. For example, if an automation is triggered but its action is set to fire only 24 hours later, Wix calls Refresh Payload before starting the action. This fetches the latest data in the trigger payload. The returned data can be used to update the trigger payload that is passed to the action. URL: null Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: payload Method parameters: param name: externalEntityId | type: externalEntityId | description: GUID of the related resource in GUGUID format. param name: payload | type: payload | description: Payload to update. | required: true param name: triggerKey | type: triggerKey | description: Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`. Return type: RefreshPayloadResponse - name: payload | type: object | description: Updated payload. - name: cancelActivation | type: boolean | description: Whether the automation activation should be canceled. Default: `false`. ``` ### Examples ### Refresh payload request sent by Wix A Refresh payload sample request for an event that had it's start date updated since the time the payload was sent ```curl curl -X POST \ 'https://www..com/refresh-payload' \ -H 'user-agent: Wix' \ -H 'accept-encoding: gzip, deflate' \ -H 'content-type: text/plain; charset=utf-8' \ -d '{ "triggerKey": "event-starts", "payload": { "event_id": "13453-w33e", "title": "My Party", "start_date": "2026-01-07T07:45:00" } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.triggers.TriggerProviderService.refreshPayload(request, metadata) Description: If an automation's action is delayed, implement this method to retrieve the latest data in the trigger payload before the action fires. For example, if an automation is triggered but its action is set to fire only 24 hours later, Wix calls Refresh Payload before starting the action. This fetches the latest data in the trigger payload. The returned data can be used to update the trigger payload that is passed to the action. Method parameters: param name: metadata | type: Context | description: this message is not directly used by any service, it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform. e.g. SPIs, event-handlers, etc.. NOTE: this context object MUST be provided as the last argument in each Velo method signature. Example: ```typescript export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) { ... } ``` - name: requestId | type: string | description: A unique identifier of the request. You may print this GUID to your logs to help with future debugging and easier correlation with Wix's logs. - name: currency | type: string | description: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. - name: identity | type: IdentificationData | description: An object that describes the identity that triggered this request. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: languages | type: array | description: A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. - name: instanceId | type: string | description: The service provider app's instance GUID. param name: request | type: RefreshPayloadRequest - name: triggerKey | type: string | description: Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`. - name: externalEntityId | type: string | description: GUID of the related resource in GUGUID format. - name: payload | type: object | description: Payload to update. Return type: PROMISE - name: payload | type: object | description: Updated payload. - name: cancelActivation | type: boolean | description: Whether the automation activation should be canceled. Default: `false`. ``` ### Examples ### refreshPayload ```javascript import { triggerProvider } from '@wix/automations/service-plugins'; async function refreshPayload(request,metadata) { const response = await triggerProvider.refreshPayload(request,metadata); }; ``` ### refreshPayload (with elevated permissions) ```javascript import { triggerProvider } from '@wix/automations/service-plugins'; import { auth } from '@wix/essentials'; async function myRefreshPayloadMethod(request,metadata) { const elevatedRefreshPayload = auth.elevate(triggerProvider.refreshPayload); const response = await elevatedRefreshPayload(request,metadata); } ``` ### refreshPayload (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { triggerProvider } from '@wix/automations/service-plugins'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { triggerProvider }, // Include the auth strategy and host as relevant }); async function refreshPayload(request,metadata) { const response = await myWixClient.triggerProvider.refreshPayload(request,metadata); }; ``` ---