KYC Match Reference
The KYC Match client is scoped to a single user, so in order to interact with the KYC Match service, you need to create a KYCMatchUserClient
instance for the user you want to verify.
KYCMatchUserClient
s are created using the KYCMatchClient
accessible from the Client
instance.
KYCMatchClient Reference
Methods
1. ForUser
Description:
ForUser
creates a KYCMatchUserClient
instance for the specified user.
Signature:
func (c *KYCMatchClient) ForUser(ctx context.Context, identifier *UserIdentifier) (*KYCMatchUserClient, error)
Parameters:
Parameter | Type | Description |
---|---|---|
ctx | context.Context | Context for the request |
identifier | *UserIdentifier | User identifier struct |
UserIdentifier Structure:
type UserIdentifier struct {
PhoneNumber string
IPAddress string
UserID string
}
Only one of the fields should be set.
Returns:
*KYCMatchUserClient
: A client instance for the specified usererror
: Any error that occurred
Example:
package main
import (
"context"
"log"
"github.com/opengateway/glide-sdk"
)
func main() {
ctx := context.Background()
client, err := glide.NewClient(
glide.WithClientID("your-client-id"),
glide.WithClientSecret("your-client-secret"),
)
if err != nil {
log.Fatal(err)
}
kycMatchClient, err := client.KYCMatch().ForUser(ctx, &glide.UserIdentifier{
PhoneNumber: "+555123456789",
})
if err != nil {
log.Fatal(err)
}
}
KYCMatchUserClient Reference
The KYCMatchUserClient
is used to interact with the KYC Match service for a specific user.
Methods
1. Match
Description:
Match
verifies if the provided KYC data matches with the user's information.
Signature:
func (c *KYCMatchUserClient) Match(ctx context.Context, data *KYCMatchData) (*KYCMatchResponse, error)
Parameters:
Parameter | Type | Description |
---|---|---|
ctx | context.Context | Context for the request |
data | *KYCMatchData | KYC data to match |
KYCMatchData Structure:
type KYCMatchData struct {
IDDocument string
Name string
GivenName string
FamilyName string
NameKanaHankaku string
NameKanaZenkaku string
MiddleNames string
FamilyNameAtBirth string
Address string
StreetName string
StreetNumber int
PostalCode int
Region string
Locality string
Country string
HouseNumberExtension string
Birthdate string // ISO format (YYYY-MM-DD)
Email string
Gender string
}
Returns:
*KYCMatchResponse
: The match resultserror
: Any error that occurred
KYCMatchResponse Structure:
type KYCMatchResponse struct {
Status string
Data KYCMatchResult
}
type KYCMatchResult struct {
IDDocumentMatch string // "true", "false", or "not_available"
NameMatch string
GivenNameMatch string
FamilyNameMatch string
NameKanaHankakuMatch string
NameKanaZenkakuMatch string
MiddleNamesMatch string
FamilyNameAtBirthMatch string
AddressMatch string
StreetNameMatch string
StreetNumberMatch string
PostalCodeMatch string
RegionMatch string
LocalityMatch string
CountryMatch string
HouseNumberExtensionMatch string
BirthdateMatch string
EmailMatch string
GenderMatch string
}
Example:
package main
import (
"context"
"fmt"
"log"
"github.com/opengateway/glide-sdk"
)
func main() {
ctx := context.Background()
client, err := glide.NewClient()
if err != nil {
log.Fatal(err)
}
kycMatchClient, err := client.KYCMatch().ForUser(ctx, &glide.UserIdentifier{
PhoneNumber: "+555123456789",
})
if err != nil {
log.Fatal(err)
}
matchData := &glide.KYCMatchData{
IDDocument: "66666666q",
Name: "Federica Sanchez Arjona",
// ... other fields
}
result, err := kycMatchClient.Match(ctx, matchData)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Match result: %+v\n", result)
}