Skip to content

Registration

Registration

Account binding, card registration, and OTP verification — the registration package (Service Codes 01-10, 81). Two flows live here: the account flow (OAuth-based binding, driven by GetOAuthURLAccountBinding) and the card flow (CardRegistration and its Set Limit/Inquiry/Unbinding variants).

resp, err := registration.AccountBinding(ctx, transport, hb, registration.AccountBindingRequest{
	MerchantID: "...",
})
if err != nil {
	// errors.Is(err, snap.ErrBadRequest), snap.ErrUnauthorized, etc.
}

Every function below has the same call shape: fill in hb (everything except Body — the function marshals the request and sets Body itself), call it, and check err. See Core Conventions for the full pattern.

GetOAuthURL

Starts the OAuth account-binding flow by building an authorization URL (Service Code 10). This is a read-only GET call: hb.EndpointURL must be a bare http(s) URL with no query string or fragment — it errors instead of silently merging into one.

func GetOAuthURL(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req GetOAuthURLRequest) (GetOAuthURLResponse, error)

Request — GetOAuthURLRequest

Unlike every other endpoint here, this isn’t JSON — GetOAuthURL builds a URL query string directly from these fields. RedirectURL, Scopes, and State are Mandatory; SeamlessSign is Conditional (required only if SeamlessData is set); everything else is Optional.

Query parameterTypePresence
RedirectURLstringMandatory
Scopes[]string (joined with ,)Mandatory
StatestringMandatory
MerchantIDstringOptional
SubMerchantIDstringOptional
Langstring (ISO 639-1)Optional
AllowRegistration*boolOptional
SeamlessDatastringOptional
MobileNumberstringOptional
VerifiedTimestringOptional
ExternalUIDstringOptional
DeviceIDstringOptional
SeamlessSignstringConditional — required if SeamlessData is set

Response — GetOAuthURLResponse

Every field is Mandatory.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
authCodestringMandatory
statestringMandatory

AccountCreation

Creates an account (Service Code 06).

Not idempotent. On retry, reuse the same X-EXTERNAL-ID — a fresh one risks creating a second account.

func AccountCreation(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req AccountCreationRequest) (AccountCreationResponse, error)

Request — AccountCreationRequest

Every field is Optional — this endpoint covers several onboarding flows (seamless data, OAuth redirect, direct creation), each using a different subset of fields.

FieldTypePresence
partnerReferenceNostringOptional
countryCodestringOptional
customerIdstringOptional
deviceInfo*DeviceInfoOptional
emailstringOptional
langstringOptional
localestringOptional
namestringOptional
onboardingPartnerstringOptional
phoneNostringOptional
redirectUrlstringOptional
scopesstringOptional
seamlessDatastringOptional
seamlessSignstringOptional
statestringOptional
merchantIdstringOptional
subMerchantIdstringOptional
terminalTypejson.RawMessageOptional
additionalInfojson.RawMessageOptional
DeviceInfo fields

DeviceInfo describes the device initiating a registration request.

FieldTypePresence
osstringOptional
osVersionstringOptional
modelstringOptional
manufacturerstringOptional

Response — AccountCreationResponse

apiKey is json.RawMessage because the standard doesn’t say whether it’s sent as a quoted string or a bare number — this accepts either without failing the whole decode.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
authCodestringOptional
apiKeyjson.RawMessageOptional
accountIdstringOptional
statestringOptional
additionalInfojson.RawMessageOptional

AccountBinding

Binds a customer account for B2B2C use (Service Code 07).

Not idempotent. On retry, reuse the same X-EXTERNAL-ID — a fresh one risks a duplicate binding or a second token issuance.

func AccountBinding(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req AccountBindingRequest) (AccountBindingResponse, error)

Request — AccountBindingRequest

MerchantID is the only Mandatory field.

FieldTypePresence
partnerReferenceNostringOptional
actionstringOptional
additionalDatajson.RawMessageOptional
userIdstringOptional
emailstringOptional
postalAddressstringOptional
authCodestringOptional
grantTypestringOptional
isBindAndPaystringOptional
langstringOptional
localestringOptional
merchantIdstringMandatory
subMerchantIdstringOptional
msisdnstringOptional
otpstringOptional
phoneNostringOptional
platformTypestringOptional
redirectUrlstringOptional
referenceIdstringOptional
refreshTokenstringOptional
successParams*BindingSuccessParamsOptional
additionalInfojson.RawMessageOptional
BindingSuccessParams fields

The request-side successParams object.

FieldTypePresence
accountIdstringOptional
terminalIdstringOptional
tokenRequestorIdstringOptional

Response — AccountBindingResponse

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
accountTokenstringOptional
accessTokenInfo*BindingAccessTokenInfoOptional
linkIdstringOptional
nextActionstringOptional
linkageTokenstringOptional
paramsjson.RawMessageOptional
pinWebViewUrlstringOptional
redirectToDeeplinkstringOptional
redirectUrlstringOptional
userInfo*BindingUserInfoOptional
additionalInfojson.RawMessageOptional
BindingAccessTokenInfo fields

The response-side accessTokenInfo object. expiresIn/reExpiresIn here are ISO 8601 datetime strings — a different shape from the B2B/B2B2C access-token endpoints’ Token.ExpiresIn (a duration parsed from a seconds count). Same field name, different endpoint, different meaning.

FieldTypePresence
accessTokenstringOptional
expiresInstringOptional
refreshTokenstringOptional
reExpiresInstringOptional
tokenStatusstringOptional
BindingUserInfo fields

The response-side userInfo object.

FieldTypePresence
publicUserIdstringOptional

AccountBindingInquiry

Looks up a bound account’s details (Service Code 08).

func AccountBindingInquiry(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req AccountBindingInquiryRequest) (AccountBindingInquiryResponse, error)

Request — AccountBindingInquiryRequest

The standard doesn’t define an account-identifier field for this call; if your PJP needs one, put it in AdditionalInfo.

FieldTypePresence
partnerReferenceNostringOptional
additionalInfojson.RawMessageOptional

Response — AccountBindingInquiryResponse

Flatter than AccountBindingResponse — no accessTokenInfo/userInfo nesting. accountTransactionLimit is json.RawMessage since the standard doesn’t guarantee it’s always sent as a quoted string across every PJP.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
accountCurrencystringOptional
accountNamestringOptional
accountNostringOptional
accountTransactionLimitjson.RawMessageOptional
endDatePeriodstringOptional
startDatePeriodstringOptional
additionalInfojson.RawMessageOptional

AccountUnbinding

Removes an account binding (Service Code 09).

Not idempotent. On retry, reuse the same X-EXTERNAL-ID.

func AccountUnbinding(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req AccountUnbindingRequest) (AccountUnbindingResponse, error)

Request — AccountUnbindingRequest

MerchantID is the only Mandatory field. LinkID and TokenID — which actually identify the binding to remove — are both Optional per the standard; this package doesn’t enforce that at least one is set, since that’s a business rule, not a wire-shape rule.

FieldTypePresence
partnerReferenceNostringOptional
linkIdstringOptional
merchantIdstringMandatory
subMerchantIdstringOptional
tokenIdstringOptional
additionalInfojson.RawMessageOptional

Response — AccountUnbindingResponse

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
merchantIdstringOptional
subMerchantIdstringOptional
linkIdstringOptional
unlinkResultstringOptional
additionalInfojson.RawMessageOptional

OTP

Triggers OTP delivery, e.g. SMS (Service Code 81).

Triggers a real external side effect. On retry, reuse the same X-EXTERNAL-ID — a fresh one risks a duplicate OTP delivery.

func OTP(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req OTPRequest) (OTPResponse, error)

Request — OTPRequest

JourneyID is the only Mandatory field. For a B2B2C-shaped call, set HeaderBuilder.B2B2C (and AuthorizationCustomer/DeviceID) the same as for any other B2B2C endpoint — no special field is needed here. BankCardToken is Conditional.

FieldTypePresence
partnerReferenceNostringOptional
journeyIdstringMandatory
merchantIdstringOptional
subMerchantstringOptional
externalStoreIdstringOptional
trxDateTimestringOptional
bankCardTokenstringConditional
otpTrxCodestringOptional
otpReasonCodestringOptional
otpReasonMessagestringOptional
additionalInfojson.RawMessageOptional

Response — OTPResponse

chargeToken is Mandatory here (it’s Optional on CardRegistrationResponse — same field name, different endpoint).

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
chargeTokenstringMandatory
additionalInfojson.RawMessageOptional

VerifyOTP

Verifies a previously issued OTP (Service Code 04, Direct Integration).

Not idempotent — verifying consumes server-side state (invalidates the OTP, likely counts as an attempt). On retry, reuse the same X-EXTERNAL-ID — a fresh one risks burning an extra attempt or re-processing an already-completed call.

func VerifyOTP(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req VerifyOTPRequest) (VerifyOTPResponse, error)

Request — VerifyOTPRequest

Every field is Optional.

FieldTypePresence
originalPartnerReferenceNostringOptional
originalReferenceNostringOptional
actionstringOptional
merchantIdstringOptional
otpstringOptional
chargeTokenstringOptional
typestringOptional
additionalInfojson.RawMessageOptional

Response — VerifyOTPResponse

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
originalReferenceNostringOptional
originalPartnerReferenceNostringOptional
accountNostringOptional
bankCardTokenstringOptional
cardPanstringOptional
customerIdstringOptional
emailstringOptional
expiredDatetimestringOptional
expiryDatestringOptional
identificationNostringOptional
linkageTokenstringOptional
phoneNostringOptional
qParamsURLstringOptional
qParamsjson.RawMessageOptional
sendOtpFlagstringOptional
subscribeDatetimestringOptional
tokenExpiryTimestringOptional
transactionTimestampstringOptional
additionalInfojson.RawMessageOptional

CardRegistration

Registers a card and mints a BankCardToken (Service Code 01).

Not idempotent — it mints a new token each call. On retry, reuse the same X-EXTERNAL-ID — a fresh one risks a duplicate card bind.

func CardRegistration(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req CardRegistrationRequest) (CardRegistrationResponse, error)

Request — CardRegistrationRequest

BankCardNo and CustIDMerchant are the two Mandatory fields. CardData and Limit are json.RawMessage — the standard allows a non-string JSON form (a bare object or number) for both. If you’re assigning a Go string, quote it yourself first (e.g. json.RawMessage(“1000000”), not json.RawMessage(limitStr)) so it matches the expected wire shape.

FieldTypePresence
partnerReferenceNostringOptional
accountNamestringOptional
cardDatajson.RawMessageOptional
bankAccountNostringOptional
bankCardNostringMandatory
bankCardTypestringOptional
dateOfBirthstringOptional
emailstringOptional
expiredDatetimestringOptional
expiryDatestringOptional
identificationNostringOptional
identificationTypestringOptional
custIdMerchantstringMandatory
isBindAndPaystringOptional
merchantIdstringOptional
terminalIdstringOptional
journeyIdstringOptional
subMerchantIdstringOptional
externalStoreIdstringOptional
limitjson.RawMessageOptional
merchantLogoUrlstringOptional
phoneNostringOptional
sendOtpFlagstringOptional
typestringOptional
additionalInfojson.RawMessageOptional

Response — CardRegistrationResponse

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
bankCardTokenstringMandatory
chargeTokenstringOptional
randomStringstringOptional
tokenExpiryTimestringOptional
additionalInfojson.RawMessageOptional

CardRegistrationInquiry

Looks up registered card accounts by merchant customer ID (Service Code 03). This is the package’s only read-only GET endpoint; custIDMerchant is passed as a URL path segment, validated and safely joined onto hb.EndpointURL.

func CardRegistrationInquiry(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, custIDMerchant string) (CardRegistrationInquiryResponse, error)

This endpoint takes no typed request body beyond the call parameters shown above.

Response — CardRegistrationInquiryResponse

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
accountList[]CardRegistrationInquiryAccountOptional
additionalInfojson.RawMessageOptional
CardRegistrationInquiryAccount fields

One entry in accountList, wrapping the nested accountData object.

FieldTypePresence
accountDataCardRegistrationInquiryAccountDataMandatory
CardRegistrationInquiryAccountData fields

The nested accountData object. maxLimit and credentialNo are masked/formatted display strings (e.g. "************0750"), not raw values.

FieldTypePresence
accountIdstringOptional
createdDatestringOptional
credentialNostringOptional
credentialTypestringOptional
maxLimitstringOptional
statusstringOptional

CardRegistrationSetLimit

Sets a spending limit on a registered card (Service Code 02).

func CardRegistrationSetLimit(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req CardRegistrationSetLimitRequest) (CardRegistrationSetLimitResponse, error)

Request — CardRegistrationSetLimitRequest

BankCardToken is the only Mandatory field. Limit is json.RawMessage for the same reason as in CardRegistrationRequest — quote a Go string yourself before assigning it (e.g. json.RawMessage(“1000000”)).

FieldTypePresence
partnerReferenceNostringOptional
bankAccountNostringOptional
bankCardNostringOptional
limitjson.RawMessageOptional
bankCardTokenstringMandatory
otpstringOptional
additionalInfojson.RawMessageOptional

Response — CardRegistrationSetLimitResponse

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
additionalInfojson.RawMessageOptional

CardRegistrationUnbinding

Removes a card registration (Service Code 05).

Not idempotent. On retry, reuse the same X-EXTERNAL-ID.

func CardRegistrationUnbinding(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req CardRegistrationUnbindingRequest) (CardRegistrationUnbindingResponse, error)

Request — CardRegistrationUnbindingRequest

Token is the only Mandatory field.

FieldTypePresence
partnerReferenceNostringOptional
tokenstringMandatory
bankCardNostringOptional
typestringOptional
partstringOptional
merchantIdstringOptional
subMerchantIdstringOptional
terminalIdstringOptional
tokenRequestorIdstringOptional
journeyIdstringOptional
transactionDatestringOptional
additionalInfojson.RawMessageOptional

Response — CardRegistrationUnbindingResponse

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
messagestringOptional
customerIdstringOptional
unsubscribeDatestringOptional
additionalInfojson.RawMessageOptional