Send coupons
https://api-v2.test.eldowallet.fr/coupons/:id/passes/send
Sends a coupon to existing clients or to recipients who are not clients. With clientId, the client's store card data is used; without clientId, firstName, lastName and email are required. Accepts multipart/form-data to override the strip image. webhookUrl and forceSync are optional. Returns a bulk operation: track its status and results with GET /bulk-operations/{operationId}.
- 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. clients[].firstNameis required whenclientIdis missing orfalse.clients[].lastNameis required whenclientIdis missing orfalse.clients[].emailis required whenclientIdis missing orfalse.- Send a coupon to existing clients ({clientId}) or to non-clients ({firstName,lastName,email}); per-recipient overrides: barcode, promoCode, description, value, expirationDate. An empty clients array means all wallet clients. Runs as a bulk operation (webhookUrl, forceSync). acceptPartialDelivery covers the case of insufficient credit on some channels (409:INSUFFICIENT_CREDIT_PARTIAL). Accepts application/json or multipart (when overrideStripImage is a file; it may also be a URL string).
Request
idstring requiredID of the coupon template to send.
x-langstringLanguage for responsesenum:en,frdefault:"en"
application/json requiredwebhookUrlstringWebhook URL to receive notification when bulk operation completes. Auth headers: append #headers=Authorization:Bearer%20tokenexample:https://example.com/webhook#headers=Authorization:Bearer%20tokenforceSyncbooleanExecute synchronously (max 1000 items). If true and items >= 1000, request is rejected.default:falseoverrideStripImagestring <binary>Optional strip image override. In form-data: upload image file (PNG/JPEG). In application/json: provide image URL.clientsobject[] requiredclientIdstringfirstNamestringlastNamestringemailstring <email>phoneNumberstringbarcodestringpromoCodestringdescriptionstringvaluestringexpirationDatestring <date-time>
multipart/form-data requiredwebhookUrlstringWebhook URL to receive notification when bulk operation completes. Auth headers: append #headers=Authorization:Bearer%20tokenexample:https://example.com/webhook#headers=Authorization:Bearer%20tokenforceSyncbooleanExecute synchronously (max 1000 items). If true and items >= 1000, request is rejected.default:falseoverrideStripImagestring <binary>Optional strip image override. In form-data: upload image file (PNG/JPEG). In application/json: provide image URL.clientsobject[] requiredclientIdstringfirstNamestringlastNamestringemailstring <email>phoneNumberstringbarcodestringpromoCodestringdescriptionstringvaluestringexpirationDatestring <date-time>
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 415
- 500
application/jsonoperationIdstring requiredUnique identifier for the bulk operationexample:507f1f77bcf86cd799439011totalItemsnumber requiredTotal number of items in the operationexample:100successCountnumber requiredNumber of successfully processed itemsexample:95failureCountnumber requiredNumber of failed itemsexample:5statusstring requiredCurrent status of the operationenum:pending,processing,completed,failedexample:pendingoperationErrorsobject[]Array of errors for failed itemsitemIdstring requiredID of the item that failedexample:507f1f77bcf86cd799439011messagestring requiredError messageexample:Client not foundcodestringError code if availableexample:404:MODEL_NOT_FOUND
resultsobject[]Array of results for successful itemsitemIdstring requiredID of the itemexample:507f1f77bcf86cd799439011resultobjectResult data
createdAtstring <date-time> requiredTimestamp when the operation was createdexample:2024-01-01T00:00:00.000ZcompletedAtstring <date-time>Timestamp when the operation was completedexample:2024-01-01T00:05:00.000Z
VALIDATION_ERROR · INVALID_JSON · INVALID_MULTIPART · MISSING_RECIPIENT_DETAILS_FOR_NON_CLIENT · NO_RECIPIENTS_PROVIDED · NO_CLIENTS_FOUND · NO_CUSTOMERS_FOUND · ALL_CLIENTS_ALREADY_HAVE_COUPON
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 · PASSBUILDER_TOKEN_MISSING
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
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
COUPON_TEMPLATE_NOT_FOUND · MODEL_NOT_FOUND
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
BARCODE_ALREADY_EXISTS
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
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
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