Link Search Menu Expand Document

Adding points, monetary or progress wallet value

Overview

  • Call name: add-user-purchase-progress
  • Endpoint URL: https://api0.spaaza.com/auth/add-user-purchase-progress
  • Request methods: POST
  • Response Content-Type: application/json
  • Auth required: yes

This API endpoint adds a points, monetary or entries wallet amount, or a progress or item purchase account amount, to that campaign for a specified user. The amount that can be added by an admin_user is limited by the Campaigns max_manual_daily_amount. However, a user with super_user permissions is not limited by this constraint.

The endpoint works with the following campaign types:

  • Wallets
    • Wallet (monetary)
    • Points
    • Entries
  • Progress Campaign
  • Item Purchase Count Campaign

Permissions and Authentication

This API call requires valid Spaaza authentication. The following authentication schemes are permitted:

  • Admin authentication: the performing user needs to be logged in and have write access to the entity chain to which the user is connected.
  • Privileged authentication: the use of privileged authentication is permitted for this endpoint.

HTTP Parameters

The following HTTP parameters can be passed to the API:

Parameter Description
user_id OR member_number OR username OR authentication_point_identifier OR auxiliary_identifier (one parameter mandatory) the ID in the Spaaza system (user_id - integer), email address (username - email address), member number (member_number - string, normally numeric) or identity in a third-party authentication system (authentication_point_identifier - string), third-party identifier (auxiliary_identifier - string) of the user to whose wallet the amount is to be added.
campaign_id (integer, mandatory) the ID of the campaign of the (points) wallet.
amount (integer, mandatory) the currency amount to be added (positive value) to or subtracted (negative value) from the user’s cashback account. This amount should have maximum two (2) decimal places.
log_message (string, mandatory, max 1024) a text log message used for recording why the amount was added or subtracted.

Example Request & Response

Request (#request)

Example curl request:

curl --location 'https://api0.spaaza.com/auth/add-user-purchase-progress' \
--header 'X-Spaaza-API-version: 1.5.3' \
--header 'X-Spaaza-Session-User-Id: 1234567' \
--header 'X-Spaaza-Session-Key: 9641a5c5633404b175126ec2032917119a2b02aef29dc163bc65e857cfa7906d' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'user_id=3927169' \
--data-urlencode 'campaign_id=299' \
--data-urlencode 'amount=15' \
--data-urlencode 'log_message=Test amount added to points wallet'

Response (#response)

Example response:

{
    "result": {
        "code": 1,
        "status": "ok"
    },
    "results": {
        "params": {
            "amount": "15",
            "campaign_id": "299",
            "log_message": "Test amount added to points wallet",
            "user_id": "3927169"
        },
        "result_method": "post",
        "user_purchase_progress": {
            "id": 837267,
            "user_id": 3927169,
            "currency_id": 6,
            "amount": 15,
            "progress_type": "manual",
            "log_message": "Test amount added to points wallet",
            "created_date": "2024-09-02T13:22:18+00:00",
            "mutation_owner_id": 1
        },
        "username": "acme.test@spaaza.com",
        "result_type": "add-user-purchase-progress"
    }
}