Skip to main content

Automating actions with your memberships

Zapier automations driven by Loyalzoo Webhook events

Max Woodhams avatar
Written by Max Woodhams
Updated over a month ago

With this guide, you will be able to trigger a variety of business actions immediately after a membership payment is taken, a membership is created, or a membership ends. We’ll do this using a combination of triggers and actions in Zapier.


Scenario - Creating Order Shipments

GOAL: To create an order shipment every time a membership payment is charged to a customer.

We need the following data points;

  • Customer

    • Name

    • Email

    • Phone

  • Payment Information

    • Status

    • Card Type

    • First 6

    • Last 4

    • Amount

    • Order ID

    • Payment ID

  • Membership Plan

    • Name

    • ID

Diagram

Data

Trigger / Action

Customer Email

New Charge Trigger

Customer Name

New Charge Trigger

Customer Phone

New Charge Trigger

Payment Status

New Charge Trigger

Payment Amount

New Charge Trigger

Payment ID

New Charge Trigger

Order ID

New Charge Trigger

Membership Plan Name

New Charge Trigger

Membership Plan ID

New Charge Trigger

Payment Card Type

Get Payment Method

Payment Card First 6

Get Payment Method

Payment Card Last 4

Get Payment Method

Reacting to the Charge


For this we need the New Charge trigger. The New Charge trigger will fire whenever a payment is charged to a customer, including for memberships, recurring payments and one time payments.

This will give us the membership_id.

Getting the Payment Method


Next we need the Get Membership action which will return us the payment_method_id.

After this we will use the Get Payment Method action which will return the remainder of the data points we need.

Now that we have all the data points we need, we can use the Zapier Webhooks action to deliver this information to our order shipping service.


Creating the shipping order

I've chosen XPS as an example but the pattern will be the same for any company that offers an API.

Looking at the documentation, https://xpsshipper.com/restapi/docs/v1-ecommerce/endpoints/put-order/ the required fields are;

  • orderId - Use Order ID from the New Charge Trigger

  • orderDate - Use today's date

  • orderNumber - Use Order ID also

  • fulfillmentStatus - For this purpose "pending"

  • shippingService - For this purpose, can be "standard" or "expedited"

  • shippingTotal (field must be present but can be null)

  • weightUnit (field must be present but can be null)

  • dimUnit (field must be present but can be null)

  • dueByDate (field must be present but can be null)

  • orderGroup (field must be present but can be null)

  • sender.name

  • sender.address1

  • sender.city

  • sender.state

  • sender.zip

  • sender.country

  • receiver.name - Customer name

  • receiver.address1 - Customer address

  • receiver.city - Customer City

  • receiver.state - Customer State

  • receiver.zip - Customer ZIP

  • receiver.country - Customer Country

  • items (field must be present but can be null) - If helpful, provide the membership name here

  • packages (field must be present but can be null)

Example JSON

{
"orderId": "ORDER_ID",
"orderDate": "ORDER_DATE",
"orderNumber": "ORDER_NUMBER",
"fulfillmentStatus": "pending",
"shippingService": "Standard",
"shippingTotal": null,
"weightUnit": null,
"dimUnit": null,
"dueByDate": null,
"orderGroup": null,
"contentDescription": "MEMBERSHIP_PLAN_NAME",
"sender": {
"name": "SENDER_NAME",
"company": "SENDER_COMPANY",
"address1": "SENDER_ADDRESS_1",
"city": "SENDER_CITY",
"state": "SENDER_STATE",
"zip": "SENDER_ZIP",
"country": "SENDER_COUNTRY",
"phone": "SENDER_PHONE",
"email": "SENDER_EMAIL"
},
"receiver": {
"name": "RECEIVER_NAME",
"address1": "RECEIVER_ADDRESS",
"city": "RECEIVER_CITY",
"state": "RECEIVER_STATE",
"zip": "RECEIVER_ZIP",
"country": "RECEIVER_COUNTRY",
"phone": "RECEIVER_PHONE",
"email": "RECEIVER_EMAIL"
},
"items": [
{
"name": "MEMBERSHIP_NAME",
"sku": "MEMBERSHIP_PLAN_ID",
"qty": 1
}
],
"packages": null
}

Note, authentication must be handled according to the documentation of the relevant platform and attached to the Webhooks request in your Zap.

Did this answer your question?