Record a coupon’s result at checkout
record_coupon_resultAfter applying a coupon at checkout with your own browser tools (on staging with test payments only, never real card details: Proxy Mail QA never checks out), records whether the app accepted it, refused it (rejected) or failed with an error, with the app’s own message. Answers with every result for that coupon and the coupon_result verdict: it fails a coupon accepted after its end date, accepted for an offer already given to another version of the address (check_offers), or accepted twice when one_time is true; it warns on an error or a refusal with no reason. With run_id, a failed verdict fails the run. The coupon: code (default: the newest coupon at the address) or email_id. In Labs: works once the person who connected you switches on Marketing and offer emails in Account settings → Labs; until then it answers with an error that says so.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | The coupon code applied. Default: the newest coupon at the address. | |
| test | No | With run_id: the test or step this call belongs to, shown beside what it saw in the report. | |
| result | Yes | What checkout did with the coupon. | |
| run_id | No | A run from start_run: what this call sees is added to its report. | |
| address | Yes | A test address in this project. A variant works too (capitals, or a +tag such as name+o'brien@…): it acts on the plain address, and a wait on a +tag variant only finds mail sent to it. | |
| message | No | What the app said, such as "Code already used". | |
| email_id | No | The email the coupon came in. | |
| one_time | No | The offer is one per person, so a second acceptance fails. | |
| discount_applied | No | What checkout took off, as shown, such as -£5.00. |