Single Paycode

This section guides you on generating a single paycode.

Step 1 - Generate token
This is a request to generate a one-time access code also known as a token for a Paycode transaction at a merchant location. For more information on this endpoint please see the Generate single token endpoint on the API reference

Request

curl https://sandbox.interswitchng.com/api/v1/pwm/subscribers/{subscriberId}/tokens \
-H "Authorization: <token>" \
-H "Content-Type: application/json" \
-d '{
"frontEndPartnerId": "WEMA",
"ttid”: "12345",
"paymentMethodTypeCode": "MMO",
"paymentMethodCode": "WEMA",
"payWithMobileChannel": "ATM",
"tokenLifeTimeInMinutes": "60",
"amount": "50000",
"oneTimePin":"1234",
"codeGenerationChannel": "INTERNET_BANKING",
"codeGenerationChannelProvider": "WEMA",
"accountNo": "1234567890",
"accountType": "10",
"autoEnroll" : "true",
"transactionRef":"12345"
}' 
-X POST

Response

{
“subscriberId”: “2348012233220”,
“payWithMobileToken”: “57889026616”,
“tokenLifeTimeInMinutes”: “60”
}

Step 2- Get the token status
A Get Token Status message is a request to get the details of an already generated Token. For more information on this endpoint point please see the Get token status endpoint on the API reference

Request

curl https://sandbox.interswitchng.com/api/v1/pwm/subscribers/{subscriberId}/tokens \
-H "Authorization: <token>" \
-H "Content-Type: application/json" \
-d '{
"frontEndPartnerId": "WEMA",
"ttid”: "12345",
"paymentMethodTypeCode": "MMO",
"paymentMethodCode": "WEMA",
"payWithMobileChannel": "ATM",
"tokenLifeTimeInMinutes": "60",
"amount": "50000",
"oneTimePin":"1234",
"codeGenerationChannel": "INTERNET_BANKING",
"codeGenerationChannelProvider": "WEMA",
"accountNo": "1234567890",
"accountType": "10",
"autoEnroll" : "true",
"transactionRef":"12345"
}' 
-X POST

Response

{
"channel": "ATM",
"token": "1260591524",
"code": "0",
"description": "Successful",
"paymentMethodCode": "VEC",
"surcharge": "10000",
"paymentMethodIdentifier": "E192F3F3B3BA4596BC9704C44EA801BC",
"paymentMethodTypeCode": "QTA",
"tokenLifeTimeInMinutes": "90",
"amount": "500000",
"subscriberId": "2348124888436",
"settlementCode": "3LFANTA",
"status": "0",
"frontEndPartner": "455"
}

Step 3- Cancel token
A Cancel Token message is a request to cancel/deactivate an already generated Token.

Request

curl --request POST \
     --url https://sandbox.interswitchng.com/cardless-service/api/v1/cardless-services/cancel-token \
     --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJmaXJzdE5hbWUiOiJEZWJvcmFoIiwibGFzdE5hbWUiOiJBZHViaWFybyIsImF1ZCI6WyJjYXJkbGVzcy1zZXJ2aWNlIiwicGFzc3BvcnQiLCJwcm9qZWN0LXgtY29uc3VtZXIiXSwidXNlcl9uYW1lIjoiZGFkdWJpYXJvQGludGVyc3dpdGNoLmNvbSIsInNjb3BlIjpbInByb2ZpbGUiXSwibW9iaWxlTm8iOiIyMzQ4MTI0ODg4NDM2IiwiZXhwIjozMDIyOTQxNjU3LCJqdGkiOiIxMGRjNzllZC03NmZiLTRmYTYtYmU5Yy03MjkwZmE5NzMwMTkiLCJlbWFpbCI6ImRhZHViaWFyb0BpbnRlcnN3aXRjaC5jb20iLCJjbGllbnRfaWQiOiJwcm9qZWN0LXgtYXBwIn0.bUG_FlxK2Wiyy6DZnSlVlosj7LfMaqzxXM_NysmOnAelvguWEv9-dE9v_R6eufZ6vCpUWIgK5ESXKVbEANoV6vauwZEps3rTzLmTtvX2_z0sq5dSKqG3Lswc5V6Q14bTKH6sxMuCvgVQ7dz5K23UJFv1Q6Wd2cuiy2pOnTe3Y-c8FD3rmEp7Bo3xsxcsL5_9GEyWvCVvGbo0ZsHoNYjJmRe-7PJl4LKy3ODKtChrgjeow7oYlgTxFezWiDvcD2hFn3JLOzuPisX-HqnZNAsBV5l_xheuQmkFESmmP6t7FgDYWnaKZIjCF__kkxK4e-lXhImYP1jDak1k7ctNm1uhlg' \
     --header 'Content-Type: applicaton/json' \
     --header 'accept: application/json' \
     --data '{"referenceId":"12345673489012","frontEndPartner":"455"}'

Response

{
 "code": "00",
 "description": "Successfully queued to be cancelled"
}

📘

Recommended

NB: We recommend that the ttid and transactionRef have the same value.