Issuer DLCM - Click-2-Pay
Issuer DLCM - Click-2-Pay provides services to enrol for online checkouts
URLs
Authorization server Base URL - Production
Authorization server Base URL - Sandbox
https://api-gateway-pp.nets.eu/
Authentication
Before you can use Click-2-Pay service, you must go through on-boarding process.
You will receive two keys, one set for Sandbox and another set for Production access, which are the pairs of unique identifier called "Client ID" and "Client Secret". The Client Secret should not be shared with anyone. The two keys will be needed to authenticate your application to the respective environments. The key for the sandbox environment is used for a test transaction, and that of the production environment for a live transaction.
You need access tokens to invoke Click-2-Pay service's resources. Access tokens are passed in the HTTP header when invoking the API. The Authorization server provides a Token Endpoint that you can use to generate or renew your access token. The response of the Token Endpoint is a JSON message. You extract the token for the JSON and pass it with an HTTP Authorization header to access the API.
In case of theft or a security violation, you can revoke an access token by calling a Revoke Endpoint.
OAuth 2.0
OAuth 2.0 is the industry-standard protocol for authorization. Read more at The OAuth 2.0 Authorization Framework, https://tools.ietf.org/html/rfc6749.
Click-2-Pay service currently supports OAuth 2.0 Specification with confidential client type. A Confidential client is capable of maintaining the confidentiality of its credentials provided by an authorization server. OAuth 2.0 defines four roles:
- Resource owner: An entity capable of granting access to a protected resource.
- Resource server: The server hosting protected resources, capable of accepting and responding to protected resource requests using access tokens.
- Client: An application making protected resource requests on behalf of the resource owner and with its authorization.
- Authorization server: The server issuing access tokens to the client after successfully authenticating the resource owner obtaining authorization.
At a very high-level, it is possible to break the full OAuth flow into two parts.
- Get a token from the authorization server.
- Use the token to access the resource server. OAuth 2.0 defines a concept called "authorization grant" which is a credential representing the resource owner's authorization (to access its protected resources) used by the client to obtain an access token. Click-2-Pay supports Client Credentials grant type.
Authorization server
Token Endpoint
POST /token
With the Client Credentials grant type, the client can request an access token using only its credentials when the client is requesting access to the protected resource under its control. Once the client makes this request to the authorization server, it will return an access token to the protected resource. The access token returned to the client for Click-2-Pay is Bearer type.
The client should request access tokens with the minimal necessary scope and lifetime. The authorization server takes the client identity into account when choosing how to honour the requested scope and lifetime, and may issue an access token with less rights than requested.
Generate access token using Client Credential grant type
- Obtain a valid client_id and Client_secret.
- Combine the pair in the format client_id:client_secret and encode the combined string
- using base64. See Encode to Base64 format, https://www.base64encode.org/
- Use the following sample curl command to obtain the access token.
$ curl -k -d "grant_type=client_credentials" \
-H "Authorization: Basic <Base64 encoded client_id:client_secret>" \
-H 'Content-Type: application/x-www-form-urlencoded' \
https://api-gateway2.nets.eu/token
You receive a response similar to the following:
{
"token_type":"Bearer",
"expires_in":2061,
"access_token":"ca19a540f544777860e44e75f605d927"
}
Note that, according to OAuth2.0 Authorization Framework, the Client Credential grant type does not allow for the issuing the refresh tokens. See https://tools.ietf.org/html/rfc6749#section-4.4.3
Revoke Endpoint
POST /revoke
Parameters
-
token (required)
The token to be revoked
-
<Base64 encoded client_id:client_secret> (required)
Combine the pair in the format client_id:client_secret and encode the combined string using base64.
-
token_type_hint (optional)
If you do not specify this parameter, the authentication server will search in both key spaces (access_token and refresh_token) and if it finds a matching token then it will be revoked. Therefore, if this parameter is not specified, it will take longer to revoke the token. However, if you specify this parameter, the authentication server only searches in the respective token space. Hence, it is much faster to revoke the token. For the Client Credentials grant type, you have only the option of access_token.
Example:
$ curl -X POST \
https://api-gateway2.nets.eu/revoke \
-H 'Authorization: Basic <Base64 encoded client_id:client_secret>' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'token=<token_to_be_revoked>&token_type_hint=<access_token_or_refresh_token>'
Responses
-
Valid token - HTTP Status 200 - OK
You receive an empty response with the HTTP status as 200. The following HTTP headers are returned:
Revokedaccesstoken: a0d210c7a3de7d548e03f1986e9a5c39 Authorizeduser: admin@carbon.super Revokedrefreshtoken: 5e87a8235cd4d066e15c4c989f5ecf94 Content-Type: text/html Pragma: no-cache Cache-Control: no-store Date: Tue, 23 Aug 2018 19:28:52 GMT Transfer-Encoding: chunked -
Invalid token - HTTP Status 200 - OK You still receive an empty response with the HTTP status as 200 but only the following HTTP headers are returned:
Content-Type: text/html Pragma: no-cache Cache-Control: no-store Date: Tue, 23 Aug 2018 19:31:45 GMT Transfer-Encoding: chunkedBecause the authorization server cannot find the token in any key space, you will not see Revokedaccesstoken or Revokedrefreshtoken in the HTTP headers.
API Specification
Headers and payload
Request data must be in JSON format. The Content-Type header value must be application/json.
Response will be in JSON format. The Accept header value must be application/json.
Scroll down for code samples, example requests and responses.
Select a language for code samples from the tabs or the mobile navigation menu.
Health Check
This operation provides health check of the API
Health check
GET /pingThis operation provides health check of the API
Parameters
X-Issuer-IDstringrequired
X-Request-IDstringrequired
X-Provider-IDstringrequired
Health check
- C#
- PHP
- Node
- Shell
var client = new RestClient("https://api-gateway2.nets.eu/lcm/v1/ping"); var request = new RestRequest(Method.GET); request.AddHeader("X-Issuer-ID", "SOME_STRING_VALUE"); request.AddHeader("X-Request-ID", "SOME_STRING_VALUE"); request.AddHeader("X-Provider-ID", "SOME_STRING_VALUE"); IRestResponse response = client.Execute(request);
Responses
200OKoptional
messagestringoptional
statusstringoptional
401Unauthorizedoptional
403Forbiddenoptional
404Not Foundoptional
200
{ "message": "string", "status": "string" }
LCM Click-2-Pay
Inbound API from issuer backend to LCM Click-2-Pay service
Enrol card to click-2-pay
POST /c2p/enrolmentsParameters
X-Issuer-IDstringrequired
X-Provider-IDstringrequired
X-Request-IDstringrequired
Enrol card to click-2-pay
- C#
- PHP
- Node
- Shell
var client = new RestClient("https://api-gateway2.nets.eu/lcm/v1/c2p/enrolments"); var request = new RestRequest(Method.POST); request.AddHeader("content-type", "application/json"); request.AddHeader("X-Issuer-ID", "SOME_STRING_VALUE"); request.AddHeader("X-Provider-ID", "SOME_STRING_VALUE"); request.AddHeader("X-Request-ID", "SOME_STRING_VALUE"); request.AddParameter("application/json", "{\"REPLACE_REQUEST_BODY\":\"REPLACE_REQUEST_BODY\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
Request body
accountInfoobjectoptional
accountstringoptional
accountTypestringoptional
paymentInstrumentProviderobjectoptional
clientDeviceIDstringoptional
isIDnVstringoptional
tokenRequestorIDstringoptional
idvMethodsobjectoptional
idvMethodarrayoptional
idvChannelstringoptional
idvContactInfostringoptional
Request body
{ "accountInfo": { "account": "string", "accountType": "string" }, "paymentInstrumentProvider": { "clientDeviceID": "string", "isIDnV": "string", "tokenRequestorID": "string" }, "idvMethods": { "idvMethod": [ { "idvChannel": "string", "idvContactInfo": "string" } ] } }
Responses
200OKoptional
accountIDstringoptional
c2pEnrolmentIDstringoptional
401Unauthorizedoptional
403Forbiddenoptional
404Not Foundoptional
200
{ "accountID": "string", "c2pEnrolmentID": "string" }
Retrieve eligible merchants
POST /c2p/merchantsParameters
X-Issuer-IDstringrequired
X-Provider-IDstringrequired
X-Request-IDstringrequired
Retrieve eligible merchants
- C#
- PHP
- Node
- Shell
var client = new RestClient("https://api-gateway2.nets.eu/lcm/v1/c2p/merchants"); var request = new RestRequest(Method.POST); request.AddHeader("content-type", "application/json"); request.AddHeader("X-Issuer-ID", "SOME_STRING_VALUE"); request.AddHeader("X-Provider-ID", "SOME_STRING_VALUE"); request.AddHeader("X-Request-ID", "SOME_STRING_VALUE"); request.AddParameter("application/json", "{\"REPLACE_REQUEST_BODY\":\"REPLACE_REQUEST_BODY\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
Request body
accountInfoobjectoptional
accountstringoptional
accountTypestringoptional
Request body
{ "accountInfo": { "account": "string", "accountType": "string" } }
Responses
200OKoptional
profilesarrayoptional
merchantLogoURLstringoptional
merchantNamestringoptional
tokenRequestorIDstringoptional
tokenTypesarrayoptional
401Unauthorizedoptional
403Forbiddenoptional
404Not Foundoptional
200
{ "profiles": [ { "merchantLogoURL": "string", "merchantName": "string", "tokenRequestorID": "string", "tokenTypes": [ "string" ] } ] }
Push provisioning status notification
POST /c2p/enrolments/{c2pEnrolmentID}/stateParameters
X-Issuer-IDstringrequired
X-Provider-IDstringrequired
X-Request-IDstringrequired
c2pEnrolmentIDstringrequired
c2pEnrolmentID
Push provisioning status notification
- C#
- PHP
- Node
- Shell
var client = new RestClient("https://api-gateway2.nets.eu/lcm/v1/c2p/enrolments/{c2pEnrolmentID}/state"); var request = new RestRequest(Method.POST); request.AddHeader("content-type", "application/json"); request.AddHeader("X-Issuer-ID", "SOME_STRING_VALUE"); request.AddHeader("X-Provider-ID", "SOME_STRING_VALUE"); request.AddHeader("X-Request-ID", "SOME_STRING_VALUE"); request.AddParameter("application/json", "{\"REPLACE_REQUEST_BODY\":\"REPLACE_REQUEST_BODY\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
Request body
enrolmentStatusstringoptional
tokenRequestorIDstringoptional
Request body
{ "enrolmentStatus": "string", "tokenRequestorID": "string" }
Responses
204No contentoptional
401Unauthorizedoptional
403Forbiddenoptional
404Not Foundoptional