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.
| Field | Type | Presence |
|---|---|---|
partnerReferenceNo | string | Optional |
customerNumber | string | Optional |
amount | snap.Money | Mandatory |
transactionDate | string | Optional |
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.
| Field | Type | Presence |
|---|---|---|
responseCode | string | Mandatory |
responseMessage | string | Mandatory |
referenceNo | string | Optional |
partnerReferenceNo | string | Optional |
sessionId | string | Optional |
customerNumber | string | Optional |
customerName | string | Mandatory |
customerMonthlyInLimit | json.RawMessage | Optional |
minAmount | *snap.Money | Optional |
maxAmount | *snap.Money | Optional |
amount | *snap.Money | Optional |
feeAmount | *snap.Money | Optional |
feeType | string | Optional |
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.
| Field | Type | Presence |
|---|---|---|
partnerReferenceNo | string | Mandatory |
customerNumber | string | Optional |
customerName | string | Optional |
amount | *snap.Money | Optional |
feeAmount | *snap.Money | Optional |
transactionDate | string | Optional |
sessionId | string | Optional |
categoryId | json.RawMessage | Optional |
notes | string | Optional |
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.
| Field | Type | Presence |
|---|---|---|
responseCode | string | Mandatory |
responseMessage | string | Mandatory |
referenceNo | string | Optional |
partnerReferenceNo | string | Optional |
sessionId | string | Optional |
customerNumber | string | Optional |
amount | *snap.Money | Optional |
referenceNumber | string | Optional |
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.
| Field | Type | Presence |
|---|---|---|
originalPartnerReferenceNo | string | Optional |
originalReferenceNo | string | Optional |
originalExternalId | string | Optional |
serviceCode | string | Mandatory |
transactionDate | string | Optional |
amount | *snap.Money | Optional |
additionalInfo | json.RawMessage | Optional |
Response — CustomerTopUpInquiryStatusResponse
CustomerTopUpInquiryStatusResponse is the response body for Customer Top Up Inquiry Status — the same shape as TransactionStatusInquiryBankResponse, under its own type name.
| Field | Type | Presence |
|---|---|---|
responseCode | string | Mandatory |
responseMessage | string | Mandatory |
originalPartnerReferenceNo | string | Optional |
originalReferenceNo | string | Optional |
originalExternalId | string | Optional |
serviceCode | string | Optional |
transactionDate | string | Optional |
amount | *snap.Money | Optional |
beneficiaryAccountNo | string | Mandatory |
beneficiaryBankCode | string | Optional |
previousResponseCode | string | Optional |
referenceNumber | string | Mandatory |
sourceAccountNo | string | Mandatory |
transactionId | string | Optional |
latestTransactionStatus | string | Mandatory |
transactionStatusDesc | string | Optional |
additionalInfo | json.RawMessage | Optional |