Skip to content

Customer Top Up

Customer Top Up

Top-up an e-money/e-wallet account: inquiry, top-up, and status check.

resp, err := transfercredit.CustomerTopUp(ctx, transport, hb, transfercredit.CustomerTopUpRequest{
	PartnerReferenceNo: "2020102900000000000001",
})
if err != nil {
	// errors.Is(err, snap.ErrBadRequest), snap.ErrUnauthorized, etc.
}

AccountInquiryCustomerTopUp

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

func AccountInquiryCustomerTopUp(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req AccountInquiryCustomerTopUpRequest) (AccountInquiryCustomerTopUpResponse, error)

Request — AccountInquiryCustomerTopUpRequest

AccountInquiryCustomerTopUpRequest is the request body for Account Inquiry - Customer Top Up (Service Code 37). Amount is the only Mandatory field. CustomerNumber is Conditional — required unless a B2B2C access token already identifies the customer.

FieldTypePresence
partnerReferenceNostringOptional
customerNumberstringOptional
amountsnap.MoneyMandatory
transactionDatestringOptional

Response — AccountInquiryCustomerTopUpResponse

AccountInquiryCustomerTopUpResponse is the response body for Account Inquiry - Customer Top Up. customerNumber comes back masked (e.g. "XXXXXXXXX1857"). customerMonthlyInLimit is json.RawMessage because the standard shows it as a quoted number — a plain string field can’t safely assume every issuer sends it the same way.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
sessionIdstringOptional
customerNumberstringOptional
customerNamestringMandatory
customerMonthlyInLimitjson.RawMessageOptional
minAmount*snap.MoneyOptional
maxAmount*snap.MoneyOptional
amount*snap.MoneyOptional
feeAmount*snap.MoneyOptional
feeTypestringOptional

CustomerTopUp

CustomerTopUp calls the SNAP Customer Top Up endpoint (Service Code 38, path …/{version}/emoney/topup). hb must already carry every field snap.HeaderBuilder needs except Body, which CustomerTopUp sets itself so the exact marshaled bytes are used for both signing and the wire body.

This operation is not idempotent and isn’t retried automatically. If you retry a failed or timed-out call, reuse the same X-EXTERNAL-ID — the server’s duplicate-detection keys on it, so a fresh one risks a duplicate top-up.

func CustomerTopUp(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req CustomerTopUpRequest) (CustomerTopUpResponse, error)

Request — CustomerTopUpRequest

CustomerTopUpRequest is the request body for Customer Top Up (Service Code 38). partnerReferenceNo is the only Mandatory field. categoryId is json.RawMessage for the same reason as customerMonthlyInLimit above: the standard shows it as a quoted number, not a guaranteed string.

FieldTypePresence
partnerReferenceNostringMandatory
customerNumberstringOptional
customerNamestringOptional
amount*snap.MoneyOptional
feeAmount*snap.MoneyOptional
transactionDatestringOptional
sessionIdstringOptional
categoryIdjson.RawMessageOptional
notesstringOptional

Response — CustomerTopUpResponse

CustomerTopUpResponse is the response body for Customer Top Up. referenceNumber isn’t in the standard’s field table, but it does appear in the standard’s own worked example, so it’s included here too.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
sessionIdstringOptional
customerNumberstringOptional
amount*snap.MoneyOptional
referenceNumberstringOptional

CustomerTopUpInquiryStatus

CustomerTopUpInquiryStatus calls the SNAP Customer Top Up Inquiry Status endpoint (Service Code 39, path …/{version}/emoney/topup-status). hb must already carry every field snap.HeaderBuilder needs except Body, which CustomerTopUpInquiryStatus sets itself so the exact marshaled bytes are used for both signing and the wire body.

func CustomerTopUpInquiryStatus(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req CustomerTopUpInquiryStatusRequest) (CustomerTopUpInquiryStatusResponse, error)

Request — CustomerTopUpInquiryStatusRequest

CustomerTopUpInquiryStatusRequest is the request body for Customer Top Up Inquiry Status (Service Code 39) — the same shape as TransactionStatusInquiryBankRequest, under its own type name. serviceCode is the only Mandatory field.

FieldTypePresence
originalPartnerReferenceNostringOptional
originalReferenceNostringOptional
originalExternalIdstringOptional
serviceCodestringMandatory
transactionDatestringOptional
amount*snap.MoneyOptional
additionalInfojson.RawMessageOptional

Response — CustomerTopUpInquiryStatusResponse

CustomerTopUpInquiryStatusResponse is the response body for Customer Top Up Inquiry Status — the same shape as TransactionStatusInquiryBankResponse, under its own type name.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
originalPartnerReferenceNostringOptional
originalReferenceNostringOptional
originalExternalIdstringOptional
serviceCodestringOptional
transactionDatestringOptional
amount*snap.MoneyOptional
beneficiaryAccountNostringMandatory
beneficiaryBankCodestringOptional
previousResponseCodestringOptional
referenceNumberstringMandatory
sourceAccountNostringMandatory
transactionIdstringOptional
latestTransactionStatusstringMandatory
transactionStatusDescstringOptional
additionalInfojson.RawMessageOptional