KYC API

Manages the following endpoints: Session and Merchant.

Installation

dotnet CLI

Install the latest SDK using dotnet CLI:

dotnet add package PingPayment.KYC

NuGet.exe

Install the latest SDK using NuGet.exe:

nuget install PingPayment.KYC

Visual Studio

From within Visual Studio:

  1. Open the Solution Explorer.
  2. Right-click on a project within your solution.
  3. Click on Manage NuGet Packages...
  4. Click on the Browse tab and search for "PingPayments.KYC".
  5. Click on the PingPayments.KYC package, select the appropriate version in the right-tab and click Install.


Client

The client exposes all enpoints and It's operations that let you create and interact with Ping Payments KYC API through your Ping Payments account. Ping Payment KYC Client uses the Http Client for sending and receiving HTTP responses.

Ping Payment KYC Client

The using directive allows you to use types defined in a namespace without specifying the fully qualified namespace of that type. Add the following using directive from the PingPayments.KYC namespace:

using PingPayments.KYC;

Initializing the client with an appropriate environment.

  • For testing use the Sandbox environment, PingEnvironments.KYC.SandboxUri.
  • For Production use PingEnvironments.KYC.ProductionUri.
var httpClient = new HttpClient().ConfigurePingPaymentsClient(PingEnvironments.KYC.SandboxUri, tenantId);
var api = new PingKycApiClient(httpClient);

Or use Dependency injection

services.AddHttpClient<IPingKycApiClient, PingKycApiClient>(client =>
{
    client.ConfigurePingPaymentsClient(PingEnvironments.KYC.SandboxUri, tenantId);
});


Session (Endpoint)

The Session enpoint exposes one method dedicated to dealing with KYC sessions.

Method


Initiate Session

Initiate a new verification session.

Usage:

  1. Create a Ping KYC Client.

  2. Call the Initiate() method with a IntiateSessionRequest.

    1. await api.Session.V1.Initiate(initiateSessionRequest);
      
  3. Handle response.

Parameters

ParameterTypeRequierdDescription
IntiateSessionRequestInitiateSessionRequestYesRequest body required to initiate a new verification session.

Returns

Object is being returned with two fields: validation_url and verification_id. If there is a problem with the request an error response will be returned.


Example Usage

//Create a new InitiateSessionRequest
var initiateSessionRequest = new InitiateSessionRequest("[email protected]", "0706542314", "199409082333")

//Make call to API
var response = await api.Session.V1.Initiate(initiateSessionRequest);

Response

201 CREATED

{
  "validation_url": Uri,
  "verification_id": "string"
}


Merchants (Endpoint)

The Merchant endpoint exposes three methods dedicated to dealing with KYC associated with merchants.

Methods


Get Merchant

Get merchants based on the GetKycRequest .

Usage

  1. Create a Ping KYC Client.
  2. Call the Get() method with a GetKycRequest.
    1. await api.Merchant.V1.Get(getKycRequest);
      
  3. Handle response.
ParameterTypeRequierdDescription
GetKycRequestGetKycRequestYesRequest body required to get merchant

Returns

A list of objects is being returned. Each object in the list contains information about a merchant. If there is a problem with the request an error response will be returned.


Example Usage

//Create a new GetKycRequest
var getKycRequest = new GetKycRequest
{
    Page = 1,
    PageSize = 10,
};

//Make call to API
var response = await api.Merchant.V1.Get(getKycRequest);

Response

200 OK

[
  {
    "addresses": [],
    "bank_account": {
      "bic": "NDEASESS",
      "iban": "SE7280000810340009783242"
    },
    "country": "se",
    "email": "[email protected]",
    "id": "021d404f-0a3f-46c1-8189-6fc27151b1f2",
    "metadata": {},
    "name": "Svante Larsson",
    "person_data": {
      "birthdate": "1985-12-24",
      "firstname": "Svante",
      "gender": "Male",
      "identity": "198002015841",
      "lastname": "Larsson"
    },
    "phone": "0705555555",
    "type": "person"
  }
]


Verify merchant

Send verification data for merchant.

Usage

  1. Create a Ping KYC Client.
  2. Call the Verification() method with a KycVerificationRequest.
    1. await api.Merchant.V1.Verification(kycVerificationRequest);
      
  3. Handle response.

Parameters

ParameterTypeRequierdDescription
KycVerificationRequestKycVerificationRequestYesRequest body required to make a verification.

Returns

Empty response. If there is a problem with the request an error response will be returned.


Example Usage

var kycVerificationRequest = new KycVerificationRequest
 (
    bankAccount,
    "SE",
    "[email protected]",
     merchantId,
     "Svante",
     "0705555555",
     LegalEntityTypeEnum.person,
     personData: personData
);

var response = await api.Merchant.V1.Verification(kycVerificationRequest);

Response

204 No content

{}


Merchant AIS

Account Information Service for Merchants.

Usage

  1. Create a Ping KYC Client.
  2. Call the AIS() method with a aisMerchantRequest.
    1. await api.Merchant.V1.AIS(aisMerchantRequest);
      
  3. Handle response.

Parameters

ParameterTypeRequierdDescription
aisMerchantRequestAisMerchantRequestYesRequest body required to perform a verification.

Returns

Object is being returned with two fields: If the response is 200 ais_url and verification_id is returned, If the response is 201 merchant_id and message is returned. If there is a problem with the request an error response will be returned.


Example Usage

var request = new AisMerchantRequest
(
   "SE",
   merchantId
   distributionObj,
   "[email protected]",
   "0701231212",
   "199611015676",
   redirects,
   style
);
var response = await api.Merchant.V1.AIS(request);

Response

200 ok

{
  "ais_url": "www.somesite.se",
  "verification_id": "id"
}

201 Created

{
  "merchant_id": "88b5dae6-c691-49c4-86f8-8d51b0b2bbc",
  "message": "The entity was already registered, created new merchant"
}