YM REST Services

<back to all web services

MembershipPromoCodes

Requires Authentication
Requires any of the roles:admin, oauthadminRequires the permission:CanAdminMembers
The following routes are available for this service:
GET/Ams/{ClientID}/MembershipPromoCodes/{MembershipID}/{MemberID}Return a list of valid membership promo codes for the given Member
PUT/Ams/{ClientID}/MembershipPromoCodesValidates a Membership Promo Code.
GET/Ams/{ClientID}/MembershipPromoCodes/{MembershipID}/Return a list of membership promo codes for the given Membership
MembershipPromoCodes Parameters:
NameParameterData TypeRequiredDescription
MembershipIDpathintNo
MemberIDpathintNo
PromoCodebodystringNo
BaseDto Parameters:
NameParameterData TypeRequiredDescription
UsingRedisformboolNo
AppInitTimeformDateTimeNo
ServerIDformstringNo
BaseSharedDto Parameters:
NameParameterData TypeRequiredDescription
ClientIDformintNo
ResponseStatusformResponseStatusNo
BypassCacheformboolNo
DateCachedformDateTimeNo
DeviceformDeviceNo
MembershipPromoCodesResponse Parameters:
NameParameterData TypeRequiredDescription
MembershipPromoCodeListformList<MembershipPromoCode>No
MembershipPromoCode Parameters:
NameParameterData TypeRequiredDescription
FriendlyNameformstringNo
FlatDiscountformdouble?No
PercentDiscountformdouble?No
PromoCodeBase Parameters:
NameParameterData TypeRequiredDescription
PromoCodeIDformint?No
ClientIDformintNo
PromoCodeformstringNo
ExpiresformDateTime?No
GLCodeformstringNo
QBClassformstringNo
StartformDateTime?No
UsageLimitformintNo
UsageOnePerUserformboolNo

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /Ams/{ClientID}/MembershipPromoCodes/{MembershipID}/{MemberID} HTTP/1.1 
Host: ws.yourmembership.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"MembershipID":0,"MemberID":0,"PromoCode":"String","UsingRedis":true,"AppInitTime":"2025-01-15T06:16:03.6874989-05:00","ServerID":"WS-5-99-907","ClientID":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"BypassCache":false,"DateCached":"2025-01-15T09:04:17.9310287-05:00","Device":"Desktop"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"MembershipPromoCodeList":[{"FriendlyName":"String","FlatDiscount":0,"PercentDiscount":0,"PromoCodeID":0,"ClientID":0,"PromoCode":"String","Expires":"0001-01-01T00:00:00.0000000","GLCode":"String","QBClass":"String","Start":"0001-01-01T00:00:00.0000000","UsageLimit":0,"UsageOnePerUser":false}],"MembershipID":0,"MemberID":0,"PromoCode":"String","UsingRedis":true,"AppInitTime":"2025-01-15T06:16:03.6874989-05:00","ServerID":"WS-5-99-907","ClientID":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"BypassCache":false,"DateCached":"2025-01-15T09:04:17.9473474-05:00","Device":"Desktop"}