Skip to main content
PUT
/
promotional-codes
Update a promotional code
curl --request PUT \
  --url https://www.pushlapgrowth.com/api/v1/promotional-codes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "promotionalCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "code": "<string>",
  "active": true,
  "expiresAt": "2023-11-07T05:31:56Z",
  "maxRedemptions": 123,
  "firstTimeOrder": true,
  "minimumAmount": 123,
  "minimumAmountCurrency": "<string>",
  "limitToCustomers": true,
  "customerId": "<string>",
  "limitToAffiliate": true
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "code": "<string>",
  "couponId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "affiliateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "externalId": "<string>",
  "active": true,
  "expiresAt": "2023-11-07T05:31:56Z",
  "maxRedemptions": 123,
  "timesRedeemed": 123,
  "firstTimeOrder": true,
  "minimumAmount": 123,
  "minimumAmountCurrency": "<string>",
  "limitToCustomers": true,
  "customerId": "<string>",
  "limitToAffiliate": true,
  "isAutoGenerated": true,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "coupon": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "externalId": "<string>",
    "couponType": "PERCENTAGE",
    "percentOff": 123,
    "amountOff": 123,
    "currency": "<string>",
    "duration": "once",
    "durationInMonths": 123,
    "maxRedemptions": 123,
    "limitToProducts": true,
    "productIds": [
      "<string>"
    ],
    "valid": true,
    "redeemBy": "2023-11-07T05:31:56Z",
    "integrationType": "<string>",
    "affiliateProgramId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "promotionalCodes": [
      {}
    ]
  },
  "affiliate": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "firstName": "<string>",
    "lastName": "<string>",
    "email": "jsmith@example.com"
  }
}

Updating Promotional Codes

Update an existing promotional code’s properties. You can modify settings like activation status, expiration, and redemption limits.

Common Updates

  • Change the code string itself
  • Activate or deactivate a code
  • Update expiration dates
  • Modify redemption limits
  • Change affiliate assignment
You cannot change the parent coupon of a promotional code. If you need different discount terms, create a new promotional code with a different coupon.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Promotional code update details

promotionalCodeId
string<uuid>
required

The promotional code ID to update

code
string

The promotional code string

active
boolean

Whether the code is active

expiresAt
string<date-time>

Expiration date

maxRedemptions
integer

Maximum redemptions

firstTimeOrder
boolean

Limit to first-time orders

minimumAmount
number

Minimum purchase amount

minimumAmountCurrency
string

Currency for minimum amount

limitToCustomers
boolean

Limit to specific customers

customerId
string

Specific customer ID

limitToAffiliate
boolean

Only affiliate can use

Response

Promotional code updated successfully

id
string<uuid>

The promotional code ID

code
string

The actual promotional code string

couponId
string<uuid>

The parent coupon ID

affiliateId
string<uuid> | null

The affiliate ID this code is assigned to

externalId
string | null

External ID (e.g., Stripe promotion code ID)

active
boolean

Whether the promotional code is active

expiresAt
string<date-time> | null

Expiration date for the code

maxRedemptions
integer | null

Maximum number of times this code can be used

timesRedeemed
integer

Number of times this code has been redeemed

firstTimeOrder
boolean

Whether this code is limited to first-time orders

minimumAmount
number | null

Minimum purchase amount required

minimumAmountCurrency
string | null

Currency for minimum amount

limitToCustomers
boolean

Whether code is limited to specific customers

customerId
string | null

Specific customer ID this code is limited to

limitToAffiliate
boolean

Whether only the affiliate can use this code

isAutoGenerated
boolean

Whether this code was auto-generated

createdAt
string<date-time>

Timestamp when the code was created

updatedAt
string<date-time>

Timestamp when the code was last updated

coupon
object

The parent coupon details

affiliate
object | null

Affiliate details

I