NICEPAY API
API SNAP BI
Request Access Token API - SNAP
9 min
about request access token snap this part contains detail {{information}} related to access token {{api}} with {{snap}} standard uses on {{payment}} {{transaction}} s, {{transaction}} {{status}} checking, and refund request access token api snap get access token service code /#api snap service code api endpoint /nicepay/v1 0/access token/b2b https //dev nicepay co id/nicepay/v1 0/access token/b2b http method post description request token for authentication content type application/json api snap service code service code reference api 73 docid 92feymrqs iebhxrfgxuq docid 92feymrqs iebhxrfgxuq 11 docid\ pevu8 vutjjap0drkqci8 54 docid\ u 7u4pntx3 eswez 94m 55 docid\ za7an0he8c3 2oixvdlna 58 docid\ y cgh6ylek9h3fgmdxuqz 47 docid\ fsuuzk9zhp7przfci32fm 51 docid\ a0i6lo4dvbo6ih5ql6nda 78 docid\ uzpkssmvam0skerr1fn9b get header request access token header header parameter name type attribute content content type string mandatory application/json x timestamp string mandatory yyyy mm ddthh\ mm\ ss (2022 03 21t10 11 40+07 00) x client key string mandatory {{nicepay}} provided ( x client key = client id ) x signature string mandatory generated by {{partner}} / {{merchant}} created using asymmetric signature sha256withrsa algorithm ( private key , stringtosign ) stringtosign = client id + “ | ” + x timestamp request access token body parameter type required description granttype string mandatory only “ client credentials ” additionalinfo object optional response parameter bi parameter nicepay parameter type length required description responsecode responsecd string optional docid\ bjr4kjamzcknln 5zrnvw error code to specify {{th}} error returned responsemessage responsemsg string optional response message debug message to provide more accesstoken string 2048 mandatory a string representing authorization issued by client uses to access protected resources tokentype string mandatory token type value “bearer” expiresin string mandatory session expiry in seconds 900 (15 minutes) sample parameter sample request //header section content type application/json x signature afhq5sndwo5pq2vwzk4ztd9cu3ovblg6nezgwlx3gc2mrjordhpezpr3v+rxrpc8ojcycwqy01fsipma8ydqvz1hoth7aekxzhigycrns34ehyeofgd1ymhvfrvxn2fu8had6wtvpny2x2rbus3hwrjsfa5chu8wkvb7zpcuxnc= x client key normaltest x timestamp 2024 12 31t10 11 40+07 00 { "granttype" "client credentials" "additionalinfo" { } } sample response { "responsecode" "2007300", "responsemessage" "successful", "accesstoken" "xy8duzzavv9bwdxxrxcb89tsuvk4mf4kx4lgfe4acrvxr7xderhbe1", "tokentype" "bearer", "expiresin" "900" }