Search...
onOrderMarkedAsPaid( )
An event that triggers when an offline order is marked as paid.
Description
The onOrderMarkedAsPaid()
event handler runs when an offline order is marked as paid.
The received OrderMarkedAsPaidEvent
object contains information about the offline order that was paid.
Note: Backend events don't work when previewing your site.
Syntax
function onOrderMarkedAsPaid(event: OrderMarkedAsPaidEvent): void
onOrderMarkedAsPaid Parameters
NAME
TYPE
DESCRIPTION
event
OrderMarkedAsPaidEvent
Information about the offline order that was paid and metadata for the event.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
An event triggered when an offline order is marked as paid
Copy Code
1// Place this code in the events.js file2// of your site's Backend section.3// Add the file if it doesn't exist.45export function wixPricingPlans_onOrderMarkedAsPaid(event) {6 const orderId = event.data.order._id;7 const eventId = event.metadata.id;8 const eventTime = event.metadata.eventTime;9}1011/* Full event object:12 * {13 * "metadata": {14 * "id":"823f11e2-84fc-402a-b9a3-28a40a3a473d",15 * "entityId":"beaf5979-536b-4659-b3fc-78cc08579eab",16 * "eventTime":"2022-07-26T15:19:06.150998Z",17 * "triggeredByAnonymizeRequest":false18 * },19 * "data": {20 * "order": {21 * "_id":"beaf5979-536b-4659-b3fc-78cc08579eab",22 * "planId":"a4d57b6c-42eb-4416-b8dd-196f1c321b78",23 * "subscriptionId":"09c34718-6735-435c-8dd4-9ba7d7dcaa3e",24 * "wixPayOrderId":"c83359a7-833f-4689-8451-0f1211bdf184",25 * "buyer": {26 * "memberId":"ea3d74df-b7dc-4ca1-a7c9-c416b9017a86",27 * "contactId":"ea3d74df-b7dc-4ca1-a7c9-c416b9017a86"28 * },29 * "priceDetails": {30 * "subtotal":"33",31 * "discount":"0",32 * "total":"33",33 * "planPrice":"33",34 * "currency":"EUR",35 * "singlePaymentForDuration": {36 * "count":6,37 * "unit":"MONTH"38 * }},39 * "pricing": {40 * "singlePaymentForDuration": {41 * "count":6,42 * "unit":"MONTH"43 * },44 * "prices": [{45 * "duration": {46 * "cycleFrom":1,47 * "numberOfCycles":148 * },49 * "price": {50 * "subtotal":"33",51 * "discount":"0",52 * "total":"33",53 * "currency":"EUR"54 * }55 * }]},56 * "type":"OFFLINE",57 * "orderMethod":"UNKNOWN",58 * "status":"PENDING",59 * "lastPaymentStatus":"PAID",60 * "startDate":"2022-08-01T16:23:00.000Z",61 * "endDate":"2023-02-01T16:23:00.000Z",62 * "pausePeriods":[],63 * "earliestEndDate":"2023-02-01T16:23:00.000Z",64 * "planName":"One and Done",65 * "planDescription":"",66 * "planPrice":"33",67 * "_createdDate":"2022-07-24T08:17:04.278Z",68 * "_updatedDate":"2022-07-26T15:19:06.118Z"69 * }70 * }71 * }72 */