Verify a cardholder's email
All four email endpoints require cardholders:verify. Call them from your backend for the signed-in customer’s selected email. Use a JSON body; do not put emails or verification codes into query strings or logs.
The examples use the TOKEN, ZWIPE_BASE_URL, and CARDHOLDER_EMAIL variables from the quickstart.
1. Check whether the issuer knows the email
Section titled “1. Check whether the issuer knows the email”jq -n --arg email "$CARDHOLDER_EMAIL" '{email: $email}' | curl --fail-with-body --silent --show-error \ "$ZWIPE_BASE_URL/v1/cardholders/email/check" \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' --data-binary @-{"email": "jane@example.com", "registered": false}If registered is true, the issuer already recognizes the cardholder and the new-email verification branch can be skipped. This result is not a substitute for your application’s customer login or ownership checks.
2. Check previous verification
Section titled “2. Check previous verification”jq -n --arg email "$CARDHOLDER_EMAIL" '{email: $email}' | curl --fail-with-body --silent --show-error \ "$ZWIPE_BASE_URL/v1/cardholders/email/verification/status" \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' --data-binary @-{"email": "jane@example.com", "verified": false}If already verified, proceed to issuance. Otherwise show a “Send verification code” action.
3. Send a code
Section titled “3. Send a code”jq -n --arg email "$CARDHOLDER_EMAIL" '{email: $email}' | curl --fail-with-body --silent --show-error \ "$ZWIPE_BASE_URL/v1/cardholders/email/verification/send" \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' --data-binary @-{"email": "jane@example.com", "sent": true}sent: true reports the send result; it does not prove delivery or verification. Keep the customer on the code-entry screen. Disable repeated taps while sending and provide a controlled resend action. The public contract does not publish a guaranteed delivery time, code lifetime, or resend quota; do not hard-code these as Zwipe guarantees.
4. Confirm the entered code
Section titled “4. Confirm the entered code”VERIFICATION_CODE below is the code supplied by the customer. Keep it a string.
jq -n --arg email "$CARDHOLDER_EMAIL" --arg code "$VERIFICATION_CODE" \ '{email: $email, verification_code: $code}' | curl --fail-with-body --silent --show-error \ "$ZWIPE_BASE_URL/v1/cardholders/email/verification/confirm" \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' --data-binary @-{"email": "jane@example.com", "verified": true}An incorrect code can return HTTP 200 with verified: false. Check the boolean, keep the form open, and show a clear correction message. Do not treat every successful HTTP response as verified.
Wire it into your own interface
Section titled “Wire it into your own interface”| Backend result | Suggested interface |
|---|---|
registered: true or verified: true |
Continue to the prepared order. |
| Not registered and not verified | Offer “Send verification code”. |
sent: true |
Show code entry and the masked destination email. |
Confirm returns verified: false |
Explain that the code was not accepted; allow correction or controlled resend. |
| Network error | Keep the current step and allow recovery; do not issue automatically. |
If the customer changes the email, restart the checks for that email. Your backend should bind verification to the customer and the exact persisted order email. Protect your own send/confirm routes against abuse; a partner token grants broader access than a customer session.
The Node.js client includes checkEmail, emailStatus, sendEmailCode, and confirmEmailCode methods.
Phone codes
Section titled “Phone codes”Two more endpoints, under the same scope, prove the customer holds a US mobile number (+1 followed by ten digits; the issuer texts US numbers only). Use them as a sign-in check in your own application. They never verify the email: issuance still needs the email steps above.
jq -n --arg phone "$CARDHOLDER_PHONE" '{phone: $phone}' | curl --fail-with-body --silent --show-error \ "$ZWIPE_BASE_URL/v1/cardholders/phone/verification/send" \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' --data-binary @-{"phone": "+13105551234", "sent": true}A second send to the same phone within about three minutes answers 429 rate_limited with Retry-After. Confirm with {"phone": ..., "verification_code": ...} at /v1/cardholders/phone/verification/confirm; as with email, a wrong code is 200 with verified: false.

