Action API
Get, edit, or delete account actions by id; make updates to expiration dates and meta data for existing actions with the Shopwaive Action API
Last updated
Was this helpful?
Get, edit, or delete account actions by id; make updates to expiration dates and meta data for existing actions with the Shopwaive Action API
Last updated
Was this helpful?
Create multiple promotional credits for the same customer with independent expiration dates or promotional periods with the and then edit, delete, or update expirations and meta data with the
When multiple expirations are enabled from , and if a promotional credit associated with an action expires, then a debit is created on the customer account balance automatically at the time defined by expirationdate
. The debit transacted on the account balance is equal to the value of the amount
field of the promotional credit action object. If the account has insufficient funds to transact a debit of amount
(i.e. customer's available balance
is less than the previous credited amount
at the time the action is deleted), then the customer's balance is set equal to 0.00. Customer account balances cannot be negative
GET
action endpointFetch an action by id
. When you make a or request to the , a reference id
is provided in the response body, this is equivalent to the url parameter actionid
required for the endpoint
X-Shopwaive-Access-Token
Store's platform API key for store (required)
X-Shopwaive-Platform
Store's platform (required)
Content-Type
Content type
status
Status message
validity
Description of time left until expiration
action
Object of action requested
Customer email address
message
If exists, a tip or hint for developer reference
expirationdate
Date the action amount or balance expires
expires
True or false boolean string
date
Date action was created or last updated
id
Action id. This is set to the order id if created by an order or line item of an order
note
Transaction note
type
Type of transaction (i.e. rest_api)
Customer's available balance after action
lineitemid
If defined, line item id associated or resulted in creation of action amount
orderid
If defined, order id associated with the latest redemption event of action amount
status
If defined, status string (i.e. expired)
amount
If defined, amount the balance is incremented
media
If defined, url of media associated with offer
segment_query
If defined, customer segment query string i.e. customer_tags CONTAINS 'FALL2023'
collectionids
If defined, collection ids available for redemption
productids
If defined, product ids available for redemption
partial_amount
If defined, remaining available offer amount (i.e. constrained by current available balance)
remaining
If defined, remaining available offer amount (i.e. constrained by previous order transaction)
validity
Description of time left until expiration
partial_amount
and remaining
can be equivalent in value. The edge case when partial_amount
is less than remaining
is when a previous order partially reduces the original offer available redemption amount at the same time that a customers available balance
is less than remaining
because of a manual adjustment made to balance
for example. This means even though a remaining
amount is still attached to that offer, the customers balance
is not enough to cover the full remaining offer amount
GET
actions endpointSearch actions by including any combination of query key value pairs id
,email
,created_at_min
, or created_at_max
appended to the /api/actions endpoint. A maximum of 250 records per request are returned in the response body. Dates should use ISOString format when appended as a query string, for example, new Date().toISOString().
POST
action endpointUpdate an actions expirationdate
, expires
, media
or note
field(s). This route is useful when updating the validity of an existing promotional credit thats dynamic in nature, for example, when events or customer actions trigger a customers eligibility or access to the promotional credit.
X-Shopwaive-Access-Token
Store's platform API key for store (required)
X-Shopwaive-Platform
Store's platform (required)
Content-Type
Content type
note*
If defined, description of transaction
expirationdate*
If defined, date of balance expiration. Accepted formats include April 21, 2028
or 2028-04-21
(i.e. YYYY-mm-dd)
expires*
If defined, true or false boolean string
media*
If defined, url of media associated with offer
status
Status message (i.e. success)
DELETE
action endpointUse this endpoint to delete an action. If an amount
field is defined for the action, deleting the action will automatically reverse the increment the action imposed on the balance by triggering either a debit or deposit to the customer account balance equal to the negated value of amount
in the action
object.
Otherwise, if multiple actions are associated with the{actionid}
sent in the endpoint path, then each action associated with the order will be deleted and debited. If this is your intent, use an order id for the{actionid}
path parameter to conveniently delete all actions (i.e. deposits) associated with that order. The deletion of each action will create an associated debit as described above
X-Shopwaive-Access-Token
Store's platform API key for store (required)
X-Shopwaive-Platform
Store's platform (required)
Content-Type
Content type
status
Status message (i.e. success)
The expirationdate
field is only applicable if the expires
field is equal to true. If multiple expiry dates are enabled in , the expirationdate
applies to the action
object defined in the activity
array if a corresponding amount
field is defined (i.e. the action was created using the request or through an action using the drag-and-drop editor in the app)
If single expiry dates is enabled in , thenexpirationdate
field represents the date that was used to define the top-level account balance expiration at the time the action was created if expires
was also equal to true
Debits made using the Customer APIare not eligible for Action API updates or expiration, only deposits (i.e. amount
values greater than 0)
Only the expirationdate
, expires
, and note
field values can be updated on a previously created action; updates to amount
are not allowed. If changes to amount
are required, use the Action API, which triggers the same process as if the action expired; at the time the delete request is made if status
is not equal to expired, a debit is created on the customer account balance equal to the value of the amount
field of the promotional credit action object
Deleting actions of type rest_api
that do not have an amount
field are allowed (actions created by the Customer API endpoint or via a action in the app), however, no automatic adjustments to an account balance are triggered as a result of deleting the action, and if required, balance adjustments must be created by your integration with an additional request to the or endpoints
If an order triggers the creation of the action (i.e. via Shopify Flow and the Increment balance action), then the action id
is automatically set equal to the order id that created it. Therefore, if multiple deposits occur on the same order, to uniquely define the action object send the Increment balance Shopify Flow action the Line Item ID by using a For each loop action in the Shopify Flow to make the deposits on a line item level. Then you can use the , , or endpoints using the lineitemid
of the action instead of id
for the{actionid}
path parameter.
The id of the action to update
New balance reflects redemption of 3Q sales incentive and restock of inventory
April 20, 2024
true