Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Action API

Read, update and delete the entries (actions) that make up a customer's balance with the Shopwaive Action API (2026-11)

Every change to a balance is saved as an entry, which the API calls an action. The Action API reads entries, changes an entry's note, expiry or media, and deletes entries. Every request needs your Shopwaive API key in the X-Shopwaive-Access-Token header and shopify in the X-Shopwaive-Platform header. POST and DELETE also need an Idempotency-Key header: see Retry safely.

Request
What it does

GET /api/actions

Searches entries by customer and date.

GET /api/action/{actionid}

Returns the entries with this id.

POST /api/action/{actionid}

Changes an entry's note, expiry or media.

DELETE /api/action/{actionid}

Deletes the entries with this id, and reverses their amount on the balance.

Base URL: https://app.shopwaive.com

An entry's id is the id of the Customer API answer that made it, or the id of an entry in activity.

To give a customer several amounts that expire on different dates, choose Multiple expiry dates in the Shopwaive app under Settings > Balances > Expiration. Then send each amount with its own expirationdate and expires in a PUT customer request.

GET actions endpoint

Searches entries. Filter by customer with email and by date with created_at_min and created_at_max.

Search entries

get

Returns entries (actions) of the store's balances. Filter by customer with email and by date with created_at_min and created_at_max.

An email that is not a valid address is ignored, and entries of every customer are returned.

Authorizations
X-Shopwaive-Access-TokenstringRequired

Your Shopwaive API key. Create it in the Shopwaive app under Settings > Develop > Shopwaive API keys. It starts with swak_.

Query parameters
emailstring · emailOptional

Only this customer's entries.

Example: customer@example.com
created_at_minstringOptional

Only entries from this date on, for example 2026-10-01T00:00:00Z.

Example: 2026-10-01T00:00:00Z
created_at_maxstringOptional

Only entries up to this date. Without it, entries up to now.

Example: 2026-10-26T23:59:59Z
Header parameters
X-Shopwaive-Platformstring · enumRequired

Always shopify.

Default: shopifyExample: shopifyPossible values:
Responses
200

The entries found. actions is empty when none match.

application/json
get/api/actions
GET /api/actions HTTP/1.1
Host: app.shopwaive.com
X-Shopwaive-Access-Token: swak_YOUR_API_KEY
X-Shopwaive-Platform: shopify
Accept: */*
{
  "actions": [
    {
      "id": "1761500000000",
      "date": "2026-10-26T15:00:00.000Z",
      "note": "Thank you gift",
      "type": "rest_api",
      "amount": 10,
      "expires": "false",
      "validity": "does not expire",
      "message": "amount field must be set greater than 0 and expires set to true to assign an expiration"
    }
  ]
}

GET action endpoint

Returns the entries with this id in actions. The list is empty when no entry has it.

Get an entry

get

Returns the entries with this id. actions is empty when none has it.

Authorizations
X-Shopwaive-Access-TokenstringRequired

Your Shopwaive API key. Create it in the Shopwaive app under Settings > Develop > Shopwaive API keys. It starts with swak_.

Path parameters
actionidstringRequired

The id of an entry, as in the id of a Customer API answer or of an entry in activity.

Example: 1761500000000
Header parameters
X-Shopwaive-Platformstring · enumRequired

Always shopify.

Default: shopifyExample: shopifyPossible values:
Responses
200

The entries with this id.

application/json
get/api/action/{actionid}
GET /api/action/{actionid} HTTP/1.1
Host: app.shopwaive.com
X-Shopwaive-Access-Token: swak_YOUR_API_KEY
X-Shopwaive-Platform: shopify
Accept: */*
{
  "actions": [
    {
      "id": "1761500000000",
      "date": "2026-10-26T15:00:00.000Z",
      "note": "Spring Budget",
      "type": "rest_api",
      "amount": 20,
      "expires": "true",
      "expirationdate": "2027-04-21",
      "validity": "expires in less than 6 months"
    }
  ]
}

The fields of an entry

Which fields an entry has depends on how it was made.

key
value

id

The entry's id

date

When the entry was made or last changed

note

The entry's note

type

How the entry was made, for example rest_api

amount

The amount the entry added (negative when it took)

expirationdate

When the amount expires, if expires is true

expires

true or false, as text

status

For example expired or redeemed

media

A media link

orderid

The order of the latest spend from this entry

lineitemid

The order line that made this entry

segment_query

The customer segment query the entry was made with

collectionids

Collection ids where the amount can be spent

productids

Product ids where the amount can be spent

remaining

What is left of the entry after earlier orders

partial_amount

What can be spent now, when the balance is lower than remaining

validity

How long until the amount expires, in words, for example expires in less than 3 months, expired or does not expire

message

A note about the entry, for example why it does not expire

An entry has an expiry only when its amount is above 0 and expires is true. Otherwise validity is does not expire.

POST action endpoint

Changes an entry's note, expiry or media link. It does not change any amount or balance.

Update an entry's note, expiry or media

post

Changes the note, the expiry or the media link of an entry. It does not change any amount or balance.

An expiry is changed only when the request has both expirationdate and expires. An expired entry cannot be changed.

An answer of HTTP 200 with the plain text OK means the update was sent for processing. Read the entry again with GET to see the change.

Authorizations
X-Shopwaive-Access-TokenstringRequired

Your Shopwaive API key. Create it in the Shopwaive app under Settings > Develop > Shopwaive API keys. It starts with swak_.

Path parameters
actionidstringRequired

The id of an entry, as in the id of a Customer API answer or of an entry in activity.

Example: 1761500000000
Header parameters
X-Shopwaive-Platformstring · enumRequired

Always shopify.

Default: shopifyExample: shopifyPossible values:
Idempotency-Keystring · min: 1 · max: 255Required

Required with a Shopwaive API key. A key you choose for this change: 1 to 255 printable ASCII characters, with no space at either end. A UUID is a good choice. Use a new key for each change, and send the same key again to retry: Shopwaive answers with the first answer and changes nothing again. Without it, the request returns 400 idempotency_key_required and changes nothing.

Example: 3f9c2b8e-1d4a-4c7e-9b2f-6a1e5d0c7b3a
Body
notestringOptional

The new note.

expirationdatestringOptional

The new expiry date, for example 2028-04-21 or April 21, 2028. Needs expires.

expiresstring | booleanOptional

true when the amount expires on expirationdate, else false. Sent and stored as text.

Example: true
mediastring · uriOptional

A new link to an image.

Responses
200

Sent for processing, with the plain text OK. When an entry with this id has expired, the answer is JSON that lists it with a message, and it is not changed.

Responseconst: OK
post/api/action/{actionid}
POST /api/action/{actionid} HTTP/1.1
Host: app.shopwaive.com
X-Shopwaive-Access-Token: swak_YOUR_API_KEY
X-Shopwaive-Platform: shopify
Idempotency-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 48

{
  "expirationdate": "2027-04-21",
  "expires": "true"
}
text

Request body

key
value

note

The new note

expirationdate

The new expiry date, for example 2028-04-21 or April 21, 2028

expires

true or false

media

A new media link

Send only the fields you want to change. An expiry is changed only when the request has both expirationdate and expires.

Answer

Status
Body
When

200

The plain text OK

The update was sent for processing. Read the entry again with GET to see the change.

200

actions, each with message "action has already expired and cannot be updated"

An entry with this id has expired. It is not changed.

405

message "Failed. No document found or malformed request body"

No entry has this id.

DELETE action endpoint

Deletes the entries with this id. This changes real balances in your store.

When a deleted entry added or took an amount, and it is not marked redeemed or expired, Shopwaive asks for that amount to be reversed on the balance: only remaining when it is above 0 and below the amount, otherwise the whole amount. Read the customer's balance with GET customer to confirm.

Delete an entry

delete

Deletes the entries with this id. This changes real balances in your store.

When a deleted entry added or took an amount, and it is not marked redeemed or expired, Shopwaive asks for that amount to be reversed on the balance: only remaining when it is above 0 and below the amount, else the whole amount. Each entry in the answer says what happened to it. Read the balance with GET customer to confirm.

This route takes up to 20 requests a second.

Authorizations
X-Shopwaive-Access-TokenstringRequired

Your Shopwaive API key. Create it in the Shopwaive app under Settings > Develop > Shopwaive API keys. It starts with swak_.

Path parameters
actionidstringRequired

The id of an entry, as in the id of a Customer API answer or of an entry in activity.

Example: 1761500000000
Header parameters
X-Shopwaive-Platformstring · enumRequired

Always shopify.

Default: shopifyExample: shopifyPossible values:
Idempotency-Keystring · min: 1 · max: 255Required

Required with a Shopwaive API key. A key you choose for this change: 1 to 255 printable ASCII characters, with no space at either end. A UUID is a good choice. Use a new key for each change, and send the same key again to retry: Shopwaive answers with the first answer and changes nothing again. Without it, the request returns 400 idempotency_key_required and changes nothing.

Example: 3f9c2b8e-1d4a-4c7e-9b2f-6a1e5d0c7b3a
Responses
200

What happened to each entry with this id. actions is empty when none has it.

application/json
delete/api/action/{actionid}
DELETE /api/action/{actionid} HTTP/1.1
Host: app.shopwaive.com
X-Shopwaive-Access-Token: swak_YOUR_API_KEY
X-Shopwaive-Platform: shopify
Idempotency-Key: text
Accept: */*
{
  "actions": [
    {
      "status": "success",
      "actionid": "1761500000000"
    }
  ]
}

Answer

actions lists what happened to each entry with this id:

Item
Meaning

{"status": "success", "actionid": "..."}

Deleted. When it had an amount, its reversal on the balance was confirmed.

The entry, with message "action deleted but is not eligible for balance adjustments. If required, update balance with the Customer API"

Deleted. The balance did not change.

The entry, with message "action is not eligible for deletion"

Not deleted.

One id can belong to several entries, for example the entries of one order. Each of them is deleted.

Status
When

401 with status failed_credential

No X-Shopwaive-Access-Token was sent.

503 with status failed_temporary

Another request is deleting the same entry. Nothing was changed. Retry after Retry-After.

502 with reason reversal_not_confirmed

An entry was deleted, but its balance reversal was not confirmed. actions lists each entry: the one not confirmed has status failed. Do not send the request again. Read the customer's balance with GET customer, and contact support@shopwaive.com with the request id.

This route takes up to 20 requests a second.

Retry safely

POST and DELETE need an Idempotency-Key header: a key you choose, 1 to 255 printable ASCII characters with no space at either end. A UUID is a good choice. Use a new key for each change. Send the same request with the same key again and Shopwaive answers with the first answer, with the header Idempotent-Replayed: true. Nothing is done twice.

Status
Body
When

400

idempotency_key_required

The request was made with a Shopwaive API key and has no Idempotency-Key header. Nothing was changed.

400

IDEMPOTENCY_KEY_INVALID

The key is not 1 to 255 printable ASCII characters, or it starts or ends with a space.

409

IDEMPOTENCY_CONCURRENT_REQUEST

A request with the same key is still running. Retry after Retry-After.

422

IDEMPOTENCY_KEY_PARAMETER_MISMATCH

The key was already used with a different entry or different fields.

503

pending

The outcome is not known yet. Read the entry with GET, then retry with the same key after Retry-After.

Last updated