Import discount codes
curl --request POST \
--url https://api.letsdothis.com/v0/discount-codes/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"discountCodes": [
{
"code": "FLEETFEET5",
"description": "Fleet Feet post-race in-store incentive",
"flatRate": 500,
"maxValue": 500,
"startDate": "2026-09-01T00:00:00Z",
"expiresAt": "2026-12-31T23:59:59Z",
"limitUsage": 1,
"limitUsagePerUser": 1,
"eventOccurrenceIds": [
"21111177799"
],
"group": "fleet-feet-2026"
},
{
"code": "EARLYBIRD15",
"percentage": 15,
"eventIds": [
"268365"
],
"appliesTo": [
"TICKETS",
"BOOKING_FEE"
],
"appliesPer": "ENTRY"
},
{
"code": "CLUBMEMBER",
"description": "Club members, tracked for reporting",
"flatRate": 0,
"group": "club-members-2026"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
discountCodes: [
{
code: 'FLEETFEET5',
description: 'Fleet Feet post-race in-store incentive',
flatRate: 500,
maxValue: 500,
startDate: '2026-09-01T00:00:00Z',
expiresAt: '2026-12-31T23:59:59Z',
limitUsage: 1,
limitUsagePerUser: 1,
eventOccurrenceIds: ['21111177799'],
group: 'fleet-feet-2026'
},
{
code: 'EARLYBIRD15',
percentage: 15,
eventIds: ['268365'],
appliesTo: ['TICKETS', 'BOOKING_FEE'],
appliesPer: 'ENTRY'
},
{
code: 'CLUBMEMBER',
description: 'Club members, tracked for reporting',
flatRate: 0,
group: 'club-members-2026'
}
]
})
};
fetch('https://api.letsdothis.com/v0/discount-codes/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.letsdothis.com/v0/discount-codes/import"
payload = { "discountCodes": [
{
"code": "FLEETFEET5",
"description": "Fleet Feet post-race in-store incentive",
"flatRate": 500,
"maxValue": 500,
"startDate": "2026-09-01T00:00:00Z",
"expiresAt": "2026-12-31T23:59:59Z",
"limitUsage": 1,
"limitUsagePerUser": 1,
"eventOccurrenceIds": ["21111177799"],
"group": "fleet-feet-2026"
},
{
"code": "EARLYBIRD15",
"percentage": 15,
"eventIds": ["268365"],
"appliesTo": ["TICKETS", "BOOKING_FEE"],
"appliesPer": "ENTRY"
},
{
"code": "CLUBMEMBER",
"description": "Club members, tracked for reporting",
"flatRate": 0,
"group": "club-members-2026"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"jobId": "661718293a4b5c6d7e8f901a",
"status": "queued"
}{
"statusCode": 400,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 409,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 413,
"error": "<string>",
"message": "<string>"
}{
"error": "validation_failed",
"message": "<string>",
"totalRows": 123,
"rowsWithErrors": 123,
"errorCount": 123,
"summary": [
{
"code": "<string>",
"count": 123,
"message": "<string>",
"examples": [
{
"rowIndex": 123,
"discountCode": "<string>",
"value": "<string>"
}
],
"fieldId": "<string>"
}
],
"errors": [
{
"rowIndex": 123,
"errors": [
{
"code": "<string>",
"message": "<string>",
"fieldId": "<string>"
}
],
"discountCode": "<string>"
}
],
"truncated": true
}{
"statusCode": 429,
"error": "<string>",
"message": "<string>"
}Discount codes
Import discount codes
Imports a batch of discount codes, created in the background as a job you poll. See how imports work.
Each code is imported once. Importing a code that already exists leaves it unchanged and reports alreadyImported.
POST
/
v0
/
discount-codes
/
import
Import discount codes
curl --request POST \
--url https://api.letsdothis.com/v0/discount-codes/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"discountCodes": [
{
"code": "FLEETFEET5",
"description": "Fleet Feet post-race in-store incentive",
"flatRate": 500,
"maxValue": 500,
"startDate": "2026-09-01T00:00:00Z",
"expiresAt": "2026-12-31T23:59:59Z",
"limitUsage": 1,
"limitUsagePerUser": 1,
"eventOccurrenceIds": [
"21111177799"
],
"group": "fleet-feet-2026"
},
{
"code": "EARLYBIRD15",
"percentage": 15,
"eventIds": [
"268365"
],
"appliesTo": [
"TICKETS",
"BOOKING_FEE"
],
"appliesPer": "ENTRY"
},
{
"code": "CLUBMEMBER",
"description": "Club members, tracked for reporting",
"flatRate": 0,
"group": "club-members-2026"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
discountCodes: [
{
code: 'FLEETFEET5',
description: 'Fleet Feet post-race in-store incentive',
flatRate: 500,
maxValue: 500,
startDate: '2026-09-01T00:00:00Z',
expiresAt: '2026-12-31T23:59:59Z',
limitUsage: 1,
limitUsagePerUser: 1,
eventOccurrenceIds: ['21111177799'],
group: 'fleet-feet-2026'
},
{
code: 'EARLYBIRD15',
percentage: 15,
eventIds: ['268365'],
appliesTo: ['TICKETS', 'BOOKING_FEE'],
appliesPer: 'ENTRY'
},
{
code: 'CLUBMEMBER',
description: 'Club members, tracked for reporting',
flatRate: 0,
group: 'club-members-2026'
}
]
})
};
fetch('https://api.letsdothis.com/v0/discount-codes/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.letsdothis.com/v0/discount-codes/import"
payload = { "discountCodes": [
{
"code": "FLEETFEET5",
"description": "Fleet Feet post-race in-store incentive",
"flatRate": 500,
"maxValue": 500,
"startDate": "2026-09-01T00:00:00Z",
"expiresAt": "2026-12-31T23:59:59Z",
"limitUsage": 1,
"limitUsagePerUser": 1,
"eventOccurrenceIds": ["21111177799"],
"group": "fleet-feet-2026"
},
{
"code": "EARLYBIRD15",
"percentage": 15,
"eventIds": ["268365"],
"appliesTo": ["TICKETS", "BOOKING_FEE"],
"appliesPer": "ENTRY"
},
{
"code": "CLUBMEMBER",
"description": "Club members, tracked for reporting",
"flatRate": 0,
"group": "club-members-2026"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"jobId": "661718293a4b5c6d7e8f901a",
"status": "queued"
}{
"statusCode": 400,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 409,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 413,
"error": "<string>",
"message": "<string>"
}{
"error": "validation_failed",
"message": "<string>",
"totalRows": 123,
"rowsWithErrors": 123,
"errorCount": 123,
"summary": [
{
"code": "<string>",
"count": 123,
"message": "<string>",
"examples": [
{
"rowIndex": 123,
"discountCode": "<string>",
"value": "<string>"
}
],
"fieldId": "<string>"
}
],
"errors": [
{
"rowIndex": 123,
"errors": [
{
"code": "<string>",
"message": "<string>",
"fieldId": "<string>"
}
],
"discountCode": "<string>"
}
],
"truncated": true
}{
"statusCode": 429,
"error": "<string>",
"message": "<string>"
}This endpoint is restricted and not generally available: organizations that have not been enabled receive a
403. Contact your Let’s Do This representative if you’d like access.Authorizations
Body
application/json
An asynchronous discount code import request: the whole batch is accepted or none of it.
The first row takes the defaults: it discounts entries only, once per transaction. The second widens what it reaches with appliesTo, which replaces the default rather than adding to it, and uses appliesPer to come off every entry in the basket instead of the basket as a whole. The third has flatRate: 0, so it applies no discount and is kept only for tracking.
Was this page helpful?

