Verification API

Note: This part of API is only for paywalls and eshops don’t need to implement it. Verification API is currently disabled.

This API is for customer verification. Code is sent to customer via SMS or app. This code is entered on your web. Code is than compared to what was sent to user. If there’s a match invoice can be created.

For test of this API you need to create order with customer email sms.test@example.com, so object Customer needs to have email set to this value. This customer wil be accepted in our testing API (response will have status set to accepted-verification-required). Verification code 1234 will always be accepted, anything else will be rejected. Without verification is not possible to create invoice.

Request verification code

curl --include \ --request POST \ --header "Content-Type: application/json" \ --header "Authorization: your-public-key,your-secret-key" \ 'https://api.twisto.cz/v2/check/12312312123/verification/send/'

Response

Response of send verification code has two parts: message_id and message. message_id is number of message and message contains text itself. Messages are only in English.

  • Verification code can be send right after evaluation ended. Second request needs to be at least 10 seconds after the end of the evaluation to verification code resend. Otherwise response with message_id 1 is returned.
  • Verification code can be send at most 2 times. In case customer exceeds this number response with message_id 2 is returned.

Query params for searching

Message_idMessageActionsFinal stateHTTP Status
0Verification code has been sent200
1Resend requested too early400
2Resends exceededDisable resent400
3Cannot verify the paymentDisable resent400
{ "message_id": 0, "message": "Verification code has been sent" }
{ "message_id": 1, "message": "Resend requested too early" }
{ "message_id": 2, "message": "Resends exceeded" }
{ "message_id": 3, "message": "Cannot verify transaction" }

Send verification code

curl --include \ --request POST \ --header "Content-Type: application/json" \ --header "Authorization: your-public-key,your-secret-key" \ --data '{"code": "1234"}' \ 'https://api.twisto.cz/v2/check/0f38de72lkxjpk55evbid62k/verification/'

Response

Response of Verification code validation has two parts: message_id and message. message_id is number of message and message contains text itself. Messages are only in English.

  • The maximum number of attempts to enter the verification code is 50.
  • Empty requests are not counted towards this limit.
  • Transaction is expired after one hour after evaluation ended. Verification code resend has no effect on this.

Query params for searching

Message_idMessageActionsFinal stateHTTP Status
0Successful verificationCreate invoice200
1Verification code does not match400
2Transaction has expiredDisable Twisto payment400
3Maximum tries exceededDisable Twisto payment400
4Cannot verify the paymentDisable Twisto payment400
{ "message_id": 0, "message": "Successful verification" }
{ "message_id": 1, "message": "Verification code does not match" }
{ "message_id": 2, "message": "Transaction has expired" }
{ "message_id": 3, "message": "Maximum tries exceeded" }
{ "message_id": 4, "message": "Cannot verify transaction" }