Skip to content

Account Inquiry

Account Inquiry

Look up a beneficiary account’s name/status before a transfer.

resp, err := transfercredit.AccountInquiryInternal(ctx, transport, hb, transfercredit.AccountInquiryInternalRequest{
	BeneficiaryAccountNo: "1234567890",
})
if err != nil {
	// errors.Is(err, snap.ErrBadRequest), snap.ErrUnauthorized, etc.
}

AccountInquiryInternal

AccountInquiryInternal calls the SNAP Internal Account Inquiry endpoint (Service Code 15, path …/{version}/account-inquiry-internal). hb must already carry every field snap.HeaderBuilder needs except Body, which AccountInquiryInternal sets itself so the exact marshaled bytes are used for both signing and the wire body.

func AccountInquiryInternal(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req AccountInquiryInternalRequest) (AccountInquiryInternalResponse, error)

Request — AccountInquiryInternalRequest

AccountInquiryInternalRequest is the request body for API Internal Account Inquiry (Service Code 15). BeneficiaryAccountNo is the only mandatory field per the Guides tab.

FieldTypePresence
partnerReferenceNostringOptional
beneficiaryAccountNostringMandatory
additionalInfojson.RawMessageOptional

Response — AccountInquiryInternalResponse

AccountInquiryInternalResponse is the response body for API Internal Account Inquiry.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
beneficiaryAccountNamestringMandatory
beneficiaryAccountNostringMandatory
beneficiaryAccountStatusstringOptional
beneficiaryAccountTypestringOptional
currencystringOptional
additionalInfojson.RawMessageOptional

AccountInquiryExternal

AccountInquiryExternal calls the SNAP External Account Inquiry endpoint (Service Code 16, path …/{version}/account-inquiry-external). hb must already carry every field snap.HeaderBuilder needs except Body, which AccountInquiryExternal sets itself so the exact marshaled bytes are used for both signing and the wire body.

func AccountInquiryExternal(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req AccountInquiryExternalRequest) (AccountInquiryExternalResponse, error)

Request — AccountInquiryExternalRequest

AccountInquiryExternalRequest is the request body for API External Account Inquiry (Service Code 16). BeneficiaryAccountNo and BeneficiaryBankCode are mandatory per the Guides tab.

FieldTypePresence
partnerReferenceNostringOptional
beneficiaryAccountNostringMandatory
beneficiaryBankCodestringMandatory
additionalInfojson.RawMessageOptional

Response — AccountInquiryExternalResponse

AccountInquiryExternalResponse is the response body for API External Account Inquiry.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
beneficiaryAccountNamestringMandatory
beneficiaryAccountNostringMandatory
beneficiaryBankNamestringOptional
currencystringOptional
additionalInfojson.RawMessageOptional