Skip to content

    Nexi Domestic Tokenization Services - Issuer GW - API

    The product goal is to securely enable card tokenization and maintain accurate card lifecycle data. First, Verify Card ensures the card is valid and eligible before tokenization is approved. Then, Notify Card V2 keeps your system continuously updated with all card status changes and operations to maintain synchronization with D1.

    URLs

    Authorization server Base URL - Production

    https://api-gateway2.nets.eu/

    Authorization server Base URL - Sandbox

    https://api-gateway-pp.nets.eu/

    Authentication

    Before you can use the Ecom Tokenization APIs, your application must complete the on-boarding process.

    You will receive two sets of credentials:

    • Sandbox credentials (for test transactions)
    • Production credentials (for live transactions)

    Each set consists of a Client ID and a Client Secret. The Client Secret is confidential and must not be shared.

    To invoke this API you must obtain an OAuth 2.0 access token and send it in the HTTP Authorization header as a Bearer token.

    Important: The OAuth2 Token/Revoke endpoints are exposed by the Authorization Server (separate host) and are documented here for convenience. They are not part of the Resource Server paths in this OpenAPI document.

    OAuth 2.0

    OAuth 2.0 is the industry-standard protocol for authorization. See: RFC 6749.

    This API supports OAuth 2.0 with the confidential client type. A confidential client can keep its credentials secret when interacting with the Authorization Server.

    OAuth 2.0 defines four roles:

    1. Resource owner: Entity capable of granting access to a protected resource.
    2. Resource server: Server hosting protected resources, accepting requests using access tokens.
    3. Client: An application requesting protected resources on behalf of the resource owner.
    4. Authorization server: The server issuing access tokens to the client after successful authentication/authorization.

    At a high level, the flow is:

    1. Get an access token from the Authorization Server.
    2. Use the access token to call this API (the Resource Server).

    OAuth 2.0 uses an "authorization grant" to represent the authorization used to obtain an access token. This API supports the Client Credentials grant type.

    Authorization Server

    Token Endpoint

    POST /token

    With the Client Credentials grant type, the client requests an access token using only its own credentials. The access token returned for this API is of type Bearer.

    Clients should request the minimal necessary scope and lifetime. The Authorization Server may issue an access token with fewer rights than requested.

    Generate an access token (Client Credentials grant):

    1. Obtain a valid client_id and client_secret.
    2. Combine them as client_id:client_secret and Base64-encode the result.
    3. Call the Token Endpoint. Example:
    # NOTE: Only use -k in sandbox/test environments if TLS verification cannot be performed.
    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
    

    Example response (access token may be opaque, not necessarily a JWT):

    {
      "token_type": "Bearer",
      "expires_in": 2061,
      "access_token": "ca19a540f544777860e44e75f605d927"
    }
    

    Note: Per RFC 6749, the Client Credentials grant type does not issue refresh tokens.

    Revoke Endpoint

    POST /revoke

    In case of credential theft or a security incident, revoke an access token using the Revoke Endpoint.

    Parameters

    • token (required): The token to revoke.
    • Basic Authorization header (required): Authorization: Basic <Base64 encoded client_id:client_secret>
    • token_type_hint (optional): Use access_token for Client Credentials. If omitted, the server searches multiple token spaces and revocation may take longer.

    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"
    

    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: chunked
      

      Because the authorization server cannot find the token in any key space, you will not see Revokedaccesstoken or Revokedrefreshtoken

    API Specification

    Headers and payload

    Request headers are case-sensitive. Request data must be sent as JSON message. The Content-Type header value must be application/json. Responses are sent as JSON messages. The Accept header value must be application/json.

    Error code

    Error codeDescription
    LCM-3514-02Missing mandatory parameter
    LCM-3514-03Bad parameter format
    LCM-3517-01Unknown Token
    LCM-3013-03Invalid FPAN
    LCM-3029-01Unknown issuer
    LCM-3515-01Configuration item missing
    LCM-3525-01Connection to Issuer Data Service has been timed out.
    LCM-3513-06Invalid expiry date
    LCM-3513-07PAN not found

    Encrypt sensitive data

    JWE requirements

    Use JWE compact serialization (a single Base64URL-encoded string). The D1 backend expects the following JWE configuration:

    alg: ECDH-ES
    enc: A256GCM
    kid: key identifier of the recipient public key
    EC-curve: P-256
    

    Example payload to Encrypt the following JSON fields:

    JSON fieldDescriptionMOCLength
    panPANMUp to 19
    expExpiry date (MMYY)M4

    Recipient EC public key (JWK):

    {
      "kty": "EC",
      "kid": "ASDsL-Jx2XOkRnFtqW-QblWY-mDnQW2LgapadFx75tA",
      "crv": "P-256",
      "x": "UbInEqNbZZZ9SJptBwKTKO6qslSyuWvMkVK44Bx_d8U",
      "y": "PUxeHMNVL0VRxOYJrkHcpe6sap7IG-Are0QborZDngI",
    }
    

    Clear data (JSON to encrypt):

    {
    "pan":"1234567891234567",
    "exp":"1223"
    }
    

    Generate a P-256 key pair

    Use OpenSSL to generate a P-256 key pair for JWE encryption and decryption.

    Generate a private key for your issuer backend. Protect it in your environment.

    openssl ecparam -name prime256v1 -genkey -noout -out issuerId-jwe-priv-key.pem

    Generate a public key to provision in the D1 backend.

    openssl ec -in issuerId-jwe-priv-key.pem -pubout > issuerId-jwe-pub-key.pem

    Keep the private key in your issuer backend to decrypt payloads sent by the D1 backend.

    Provide the public key and its kid to the Thales Delivery Team during D1 Onboarding. The D1 backend uses the public key to encrypt sensitive data for your issuer backend.

    Scroll down for code samples, example requests and responses.
    Select a language for code samples from the tabs or the mobile navigation menu.

    Verify card

    POST /cms/api/v1/issuers/{issuerId}/cards/credentials

    When a tokenization request reaches D1, D1 can call your backend with this method to verify the status of the card for which the tokenization has been requested. This call will be done if the CVK used to compute the card CVV/DCVV has not been shared with D1 during the onboarding process.

    It is expected that your backend verifies the consistency between the card information provided versus the card information known by the backend itself. As a minimum, you should check the following:

    • that the PAN is valid

    • if no expiration date is provided, that the card has not expired

    • if a CVV is provided, that it is valid

    It is important that you provide a proper result response because D1 uses this result when making a decision regarding the tokenization request of the card.

    If the card is not already registered in D1, and if it has been configured during the on boarding to not reject an unknow card. Then along with the card details, D1 provides a unique card reference : the cardId. You can, OPTIONALLY, override this value by providing your own card ID in the response. In this case, however, you must guarantee the uniqueness of the ID. It is also required to provide a reference of the cardholder information (consumerId). If D1 accepts the card verification, then the consumer and the card will be automatically registered in D1.

    If the card is not already registered in D1, and if it has been configured during the on boarding to reject an unknow card. Then the tokenization flow will be stopped before calling your backend, and you will have to register the card using D1 register card API.

    Decrypted card payload (inside JWE, for reference only): Once decrypted, encryptedData contains:

    {
      "pan": "123456789012345",
      "exp": "1228",
      "name": "Cardholder Name",
      "cvv": "123"
    }
    
    JSON field parameterDescriptionM/OFormat
    panThe funding pan value.Mstring - up to 19 digits
    expThe expiry date of the card.Mstring - 4 digits, following the format MMYY
    nameThe card holder name.Ostring - up to 128 characters
    cvvThe CVV2 value of the funding card.Ostring - 3 or 4 digits

    Parameters

    • issuerIdstringrequired

      The id of the issuer

    • x-correlation-idstringoptional

      Random identifier which can be used to correlate the different API calls done as part of a single use-case. This identifier will be the one primarily used for troubleshooting.There is no strong guarantee of the uniqueness of this identifier, so please refrain from using it for other purpose than logging and troubleshooting

    Verify card

    var client = new RestClient("https://api-gateway2.nets.eu/cms/api/v1/issuers/{issuerId}/cards/credentials");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("x-correlation-id", "SOME_STRING_VALUE");
    request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
    request.AddParameter("application/json", "{\"REPLACE_REQUEST_BODY\":\"REPLACE_REQUEST_BODY\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

    Request body

    • encryptedDatastringrequired

      JWE Compact Serialization consisting of 5 dot-separated Base64URL segments: protectedHeader.encryptedKey.iv.ciphertext.tag

      example: eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIiwia2lkIjoiazEifQ.O4HcKx8Q9u0gCw2y8b2zJrJxgq8n3Q0m0yQ6g6lqgYwZP2VqJw.48V1_ALb6US04U3b.VbQw0KQ0YyBv1m8yVq2wq7yQp1f8rWw1vZ8sT2d8p9d3wQ.2xvTq9RjQd7e3m1nPzv2mQ
    • cardIdstringrequired

      Unique identifier of the card

      example: 16754388174828889548282836
    • cardBinstringrequired

      The first 6 digits of the PAN

      example: 123456789

    Encrypted card data (JWE)

    {
        "encryptedData": "eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIiwia2lkIjoiazEifQ.O4HcKx8Q9u0gCw2y8b2zJrJxgq8n3Q0m0yQ6g6lqgYwZP2VqJw.48V1_ALb6US04U3b.VbQw0KQ0YyBv1m8yVq2wq7yQp1f8rWw1vZ8sT2d8p9d3wQ.2xvTq9RjQd7e3m1nPzv2mQ",
        "cardId": "16754388174828889548282836",
        "cardBin": "1234567891234567"
    }

    Responses

    • 200OKoptional
      • cardIdstringoptional

        Card identifier

        example: 16754388174828889548282836
      • consumerIdstringoptional

        Cardholder identifier

        example: 123456789
      • verificationResultsobjectrequired
        • securityCodeobjectoptional
          • validbooleanoptionalexample: true
          • verificationAttemptsExceededbooleanoptionalexample: true
        • cardobjectrequired
          • lostOrStolenbooleanoptionalexample: false
          • expiredbooleanoptionalexample: false
          • invalidbooleanoptionalexample: false
          • fraudSuspectbooleanoptionalexample: false
    • 400Bad Requestoptional
      • errorCodestringoptional

        The type of the error

      • errorstringoptional

        Provide more error details if possible.For example name of the field with invalid format.

    • 401Authorization missing or invalidoptional
      • errorCodestringoptional

        The type of the error

      • errorstringoptional

        Provide more error details if possible.For example name of the field with invalid format.

    • 404Resource not foundoptional
      • errorCodestringoptional

        The type of the error

      • errorstringoptional

        Provide more error details if possible.For example name of the field with invalid format.

    • 500Internal Server Erroroptional
      • errorCodestringoptional

        The type of the error

      • errorstringoptional

        Provide more error details if possible.For example name of the field with invalid format.

    {
        "errorCode": "LCM-3514"
    }

    Notify card

    POST /notifications/d1/v2/issuers/{issuerId}/cards

    This request is used by D1 to notify the system of the bank about any card status update. There is a retry mechanism in case the notification has not been sent. Thus the bank system can use this notification to synchronize card status with their card repository.

    The number max of card status update in the notification is defined at onboarding time according to bank's system capability. Each update is linked to a given card id, and can contain a message dedicated for the final end-user.

    Parameters

    • issuerIdstringrequired

      The id of the issuer

    • x-correlation-idstringoptional

      Random identifier which can be used to correlate the different API calls done as part of a single use-case. This identifier will be the one primarily used for troubleshooting.There is no strong guarantee of the uniqueness of this identifier, so please refrain from using it for other purpose than logging and troubleshooting.

    Notify card

    var client = new RestClient("https://api-gateway2.nets.eu/notifications/d1/v2/issuers/1234567890/cards");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("x-correlation-id", "SOME_STRING_VALUE");
    request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
    request.AddParameter("application/json", "{\"REPLACE_REQUEST_BODY\":\"REPLACE_REQUEST_BODY\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

    Request body

    • operationsarrayrequired

      List of card operations notified by D1

      • operationIdstringrequired
      • operationstringrequired

        DIGITIZE, ACTIVATE, SUSPEND, DELETE, RESUME, RENEW, UPDATE

      • statusstringrequired

        PENDING, SUCCESSFUL, FAILED

      • startTimestring (date-time)required
      • endTimestring (date-time)optional
      • cardIdstringrequired
      • detailsobjectrequired
        • deviceInformationobjectrequired
          • deviceIdstringrequired
          • digitalCardStorageTypestringoptional
          • manufacturerstringoptional
          • brandstringoptional
          • modelstringoptional
          • osVersionstringoptional
          • firmwareVersionstringoptional
          • phoneNumberstringoptional
          • fourLastDigitPhoneNumberstringoptional
          • deviceNamestringoptional
          • deviceParentIdstringoptional
          • languagestringoptional
          • serialNumberstringoptional
          • timeZonestringoptional
          • timeZoneSettingstringoptional
          • simSerialNumberstringoptional
          • IMEIstringoptional
          • networkOperatorstringoptional
          • networkTypestringoptional
        • digitalCardsDetailsarrayrequired
          • isPrimarybooleanoptional
          • generalInformationobjectrequired
            • digitalCardIdstringrequired
            • panSuffixstringoptional
            • statestringoptional
            • typestringoptional
            • provisioningTimestring (date-time)optional
            • digitalCardRequestorInformationobjectoptional
              • idstringoptional
              • walletIdstringoptional
              • namestringoptional
              • tspIdstringoptional
              • originalDigitalCardRequestorIdstringoptional
          • credentialsstringrequired
        • eligibilityInformationobjectrequired
          • cardBINstringrequired
          • eligiblebooleanrequired
          • cardProductobjectoptional
            • idstringoptional
            • namestringoptional
        • digitizationInformationobjectrequired
          • digitizationChecksobjectrequired
            • decisionEngineVerificationsobjectrequired

              Decision engine validation results

            • digitalCardRequestorAssessmentobjectrequired
              • averageScorestringrequired
              • deviceScorestringrequired
              • accountScorestringrequired
              • recommendationstringrequired
              • reasonCodesRecommendationDescriptionarrayoptional
              • verificationCodesarrayoptional
              • matchedRuleobjectrequired
                • idstringrequired
                • namestringoptional
                • scenarioobjectoptional
                  • idstringoptional
                  • namestringoptional
          • digitizationResultobjectrequired
            • flowstringrequired
            • scorestringoptional
            • idAndVMethodsobjectoptional
              • supportedarrayoptional
              • selectedstringoptional
            • digitizationDecisionTimestampstring (date-time)optional
      • messageobjectoptional
        • formatstringoptional
        • titlestringoptional
        • contentstringoptional
      • errorCodestringoptional
      • errorstringoptional

    Request body

    {
        "operations": [
            {
                "operationId": "string",
                "operation": "DIGITIZE",
                "status": "PENDING",
                "startTime": "2019-08-24T14:15:22Z",
                "endTime": "2019-08-24T14:15:22Z",
                "cardId": "string",
                "details": {
                    "deviceInformation": {
                        "deviceId": "string",
                        "digitalCardStorageType": "string",
                        "manufacturer": "string",
                        "brand": "string",
                        "model": "string",
                        "osVersion": "string",
                        "firmwareVersion": "string",
                        "phoneNumber": "string",
                        "fourLastDigitPhoneNumber": "string",
                        "deviceName": "string",
                        "deviceParentId": "string",
                        "language": "string",
                        "serialNumber": "string",
                        "timeZone": "string",
                        "timeZoneSetting": "string",
                        "simSerialNumber": "string",
                        "IMEI": "string",
                        "networkOperator": "string",
                        "networkType": "string"
                    },
                    "digitalCardsDetails": [
                        {
                            "isPrimary": true,
                            "generalInformation": {
                                "digitalCardId": "string",
                                "panSuffix": "string",
                                "state": "string",
                                "type": "string",
                                "provisioningTime": "2019-08-24T14:15:22Z",
                                "digitalCardRequestorInformation": {
                                    "id": "string",
                                    "walletId": "string",
                                    "name": "string",
                                    "tspId": "string",
                                    "originalDigitalCardRequestorId": "string"
                                }
                            },
                            "credentials": "string"
                        }
                    ],
                    "eligibilityInformation": {
                        "cardBIN": "string",
                        "eligible": true,
                        "cardProduct": {
                            "id": "string",
                            "name": "string"
                        }
                    },
                    "digitizationInformation": {
                        "digitizationChecks": {
                            "decisionEngineVerifications": {},
                            "digitalCardRequestorAssessment": {
                                "averageScore": "string",
                                "deviceScore": "string",
                                "accountScore": "string",
                                "recommendation": "string",
                                "reasonCodesRecommendationDescription": [
                                    "string"
                                ],
                                "verificationCodes": [
                                    "string"
                                ],
                                "matchedRule": {
                                    "id": "string",
                                    "name": "string",
                                    "scenario": {
                                        "id": "string",
                                        "name": "string"
                                    }
                                }
                            }
                        },
                        "digitizationResult": {
                            "flow": "string",
                            "score": "string",
                            "idAndVMethods": {
                                "supported": [
                                    "string"
                                ],
                                "selected": "string"
                            },
                            "digitizationDecisionTimestamp": "2019-08-24T14:15:22Z"
                        }
                    }
                },
                "message": {
                    "format": "string",
                    "title": "string",
                    "content": "string"
                },
                "errorCode": "string",
                "error": "string"
            }
        ]
    }

    Responses

    • 204Successfuloptional
    • 400optional
      Bad Request, Invalid request URI or header, or unsupported nonstandard parameter
      • errorstringoptional
    • 401optional
      The provided Authorization header is missing or invalid
    • 404optional
      Resource not found. Unknown issuerId or consumerId or accountId or cardId
      • errorstringoptional
    • 500Internal Server Erroroptional
    {
        "error": "string"
    }

    Notify digital card

    POST /notifications/d1/v1/issuers/{issuerId}/digitalCards/{digitalCardId}/notifications

    This request is used by D1 to notify the issuer's backend about an operation done on a digital card.

    Parameters

    • issuerIdstringrequired

      The id of the issuer.

    • digitalCardIdstringrequired

      The id of the digital card.

    • x-correlation-idstringoptional

      Random identifier which can be used to correlate the different API calls done as part of a single use-case. This identifier will be the one primarily used for troubleshooting.There is no strong guarantee of the uniqueness of this identifier, so please refrain from using it for other purpose than logging and troubleshooting.

    Notify digital card

    var client = new RestClient("https://api-gateway2.nets.eu/notifications/d1/v1/issuers/1234567890/digitalCards/dc_123456789/notifications");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("x-correlation-id", "SOME_STRING_VALUE");
    request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
    request.AddParameter("application/json", "{\"REPLACE_REQUEST_BODY\":\"REPLACE_REQUEST_BODY\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

    Request body

    • operationIdstringoptional

      Unique identifier of the operation.

    • operationstringoptional

      The lifecycle operation name performed on the target digital card. A digital card can be activated(i.e. resumed), suspended, deleted from the wallet application or CCI portal; it can also be renewed when expired by the TSP and updated after a card update/renewal operation (concerning a PAN and/or expiry date update).

      SUSPEND, DELETE, RESUME, RENEW, UPDATE

    • statusstringoptional

      Status of the operation.

      SUCCESSFUL, FAILED

    Request body

    {
        "operationId": "string",
        "operation": "SUSPEND",
        "status": "SUCCESSFUL"
    }

    Responses

    • 204Successfuloptional
    • 400optional
      Bad Request, Invalid request URI or header, or unsupported nonstandard parameter
      • errorstringoptional
    • 401optional
      The provided Authorization header is missing or invalid
    • 404optional
      Resource not found. Unknown issuerId or consumerId or accountId or cardId
      • errorstringoptional
    • 500Internal Server Erroroptional
    {
        "error": "string"
    }