Create a coupon template
POST
https://api-v2.test.eldowallet.fr/coupons
Creates a coupon template in your wallet along with its pass template. Send the request as multipart/form-data with the strip image (strip). Returns the created template; then use POST /coupons/{id}/passes/send to send coupons to your clients.
Good to know
- Body is
multipart/form-data: nested objects (colors,security,locations…) are sent as a JSON string, booleans as"true"/"false". Images: PNG or JPEG, 1 KB to 5 MB.
Request
header parameters
x-langstringLanguage for responsesenum:en,frdefault:"en"
Body
multipart/form-data requiredstripstring <binary> requiredbarcodeFormatstring requiredenum:AZTEC,CODE_128,PDF_417,QR_CODE,NONEnamestring requireddescriptionstring requiredpromoCodestringvaluestringexpirationDatestring <date-time>isMultipleInstancebooleanisWelcomeCouponbooleanstatusstringenum:ACTIVE,INACTIVE,EXPIREDsourcestringenum:INTERNAL,EXTERNAL,CRM,ALLvalueLabelstringenum:VALUE,AMOUNT,PRESTATIONcolorsobject requiredbackgroundColorstring requiredlabelColorstring requiredforegroundColorstring required
emailSubscriptionMessagestringsubscriptionMessagestringsecurityobjectoneTimeToUseJwtLinkbooleandisableIOSPassSharingbooleanenableOneTimeUsebooleandisableMultipleHoldersbooleanenableSecurityAnimationbooleanenableRotatingBarcodeboolean
iosHeaderobjectlabelEnumstring requiredenum:FULLNAME,CUSTOM_TEXT,INACTIVEvalueEnumstring requiredenum:FULLNAME,CUSTOM_TEXT,INACTIVEcustomLabelstringcustomValuestring
Responses
- 201
- 400
- 401
- 403
- 415
- 500
- 503
Schema
application/jsonwalletoneOf required- Wallet
namestring requiredlogostring requirediconstring requiredandroidLogostringdisplayIdentifiantboolean requiredpassBuilderPassTemplateIdstringpassBuilderBusinessIdstringpassBuilderTokenstringidentifierstring requiredidentifierQrstring requiredaddressstringwebsitestring requiredservicePhonestring requiredbusinessPhonestring requiredsocialMediaobject requiredlinkedinstringfacebookstringinstagramstringtiktokstringtwitterstringyoutubestringsnapchatstringpintereststringredditstringwhatsappstringtelegramstring
additionalContactsobject[] requiredtitlestring requiredvaluestring requiredkindstring requiredenum:URL,PHONE,EMAIL
termsAndConditionsobject requiredtypestring requiredenum:PDF,URL,NONEcustomUrlstringpdfUrlstring
webHookUrlstring requiredrootDomainstring requiredtimezonestringallowedPassesstring[] requiredenum:ALL,EVENT_TICKET,TRANSIT,CINEMA,BOARDING_PASS,COUPON,GENERIC,STORE_CARD,OFFER,HOTELexpiredCleanupEnabledboolean required_idstring requiredcreatedAtstring <date-time> requiredupdatedAtstring <date-time> required
- option 2
- Wallet
barcodeFormatstring requiredenum:AZTEC,CODE_128,PDF_417,QR_CODE,NONEnamestring requireddescriptionstring requiredpromoCodestringvaluestringexpirationDatestring <date-time>isMultipleInstanceboolean requiredisWelcomeCouponboolean requiredstatusstring requiredenum:ACTIVE,INACTIVE,EXPIREDsourcestring requiredenum:INTERNAL,EXTERNAL,CRM,ALLcolorsobject requiredlabelColorstring requiredbackgroundColorstring requiredforegroundColorstring required
stripstringemailSubscriptionMessagestringsubscriptionMessagestringsecurityobjectoneTimeToUseJwtLinkboolean requireddisableIOSPassSharingbooleanenableOneTimeUsebooleandisableMultipleHoldersbooleanenableSecurityAnimationbooleanenableRotatingBarcodeboolean
valueLabelstring requiredenum:VALUE,AMOUNT,PRESTATIONiosHeaderobjectlabelEnumstring requiredenum:FULLNAME,CUSTOM_TEXT,INACTIVEvalueEnumstring requiredenum:FULLNAME,CUSTOM_TEXT,INACTIVEcustomLabelstringcustomValuestring
passBuilderPassTemplateIdstring_idstring requiredcreatedAtstring <date-time> requiredupdatedAtstring <date-time> required
VALIDATION_ERROR · INVALID_JSON · INVALID_MULTIPART · PROMO_CODE_ALREADY_EXISTS · ACTIVE_WELCOME_COUPON_ALREADY_EXISTS
Schema
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
UNAUTHORIZED
Schema
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
FORBIDDEN
Schema
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
UNSUPPORTED_MEDIA_TYPE
Schema
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
UNKNOWN_ERROR
Schema
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
PASS_BUILDER_ERROR
Schema
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email