Progress Adjustments .: Create

API Reference / v15

Create a Progress Adjustment

This endpoint creates a progress adjustment for a user on a given campaign.

Supported campaigns are item-based, visit-based and spend-based progress campaigns.

Request Endpoint

POST /v15/progress_adjustments

Authorization Required – Merchant User Token in Header

To create a progress adjustment, you must have a merchant access token with the give_merchant_funded_credit permission.

Authorization: token merchant="1123-15d2aeedc9f4e0e7094a9d283868f8fbe873cb85ceaa0c511727245aec8c9e"

Request Body

{
  "progress_adjustment": {
    "adjustment": 1,
    "audit_comment": "Adjustment for order made as guest",
    "campaign_id": 444,
    "user_id": 34593,
    "suppress_email": false
  }
}

Request Parameters

Parameter Type Required Description
adjustment Integer Yes Number of items, visits or amount of cents to adjust (adjustment type determined by campaign).
audit_comment String No Reason for adjustment.
campaign_id Integer Yes ID of progress based campaign to create adjustment for.
email String Yes/No Email of existing user to create adjustment for (must supply one of email or ID).
user_id Integer Yes/No ID of existing user to create adjustment for (must supply one of email or ID).
suppress_email Boolean No If true, will suppress accomplishment notification emails if goals are accomplished for the user.

Example Call

curl https://sandbox.thelevelup.com/v15/progress_adjustments \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: token merchant="123548-WQJasbuWaaNrRUABjMCF1FZnaR381C2cQMM7JHEGebMDZLDKWFMqbRMkuVmQr7"' \
  -d '{
    "progress_adjustment": {
      "adjustment": 1,
      "audit_comment": "Adjustment for order made as guest",
      "campaign_id": 444,
      "user_id": 34593,
      "suppress_email": false
    }
  }'

Example Response

HTTP/1.1 204 No Content

Errors

Email does not match existing User

HTTP/1.1 422 Unprocessable Entity

[
  {
    "error": {
      "message": "Email does not match any User",
      "object": "progress_adjustment",
      "property": "email"
    }
  }
]

Adjustment is non-integer

HTTP/1.1 422 Unprocessable Entity

[
  {
    "error": {
      "message": "Adjustment must be an integer",
      "object": "progress_adjustment",
      "property": "adjustment"
    }
  }
]

Merchant token not associated with given campaign

HTTP/1.1 401 Unauthorized