Skip to content

Bulk Cash In

Bulk Cash In

Submit a batch of cash-in instructions; settlement results arrive as an inbound notification, not a synchronous response.

resp, err := transfercredit.SubmitBulkCashIn(ctx, transport, hb, transfercredit.SubmitBulkCashInRequest{
	TransactionDate: "2026-09-14T10:00:00+07:00",
})
if err != nil {
	// errors.Is(err, snap.ErrBadRequest), snap.ErrUnauthorized, etc.
}

SubmitBulkCashIn

SubmitBulkCashIn calls the SNAP Submit Bulk Cash In endpoint (Service Code 40, path …/{version}/emoney/bulk-cashin-payment). hb must already carry every field snap.HeaderBuilder needs except Body, which SubmitBulkCashIn sets itself so the exact marshaled bytes are used for both signing and the wire body.

This operation is not idempotent and this package does not retry. Callers that retry a failed or timed-out call should reuse the same X-EXTERNAL-ID, since the server’s own duplicate-detection keys on it.

func SubmitBulkCashIn(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req SubmitBulkCashInRequest) (SubmitBulkCashInResponse, error)

Request — SubmitBulkCashInRequest

SubmitBulkCashInRequest is the request body for API Submit Bulk Cash In (Service Code 40). TransactionDate is the only top-level mandatory field per the Guides tab.

FieldTypePresence
partnerBulkIdstringOptional
transactionDatestringMandatory
currencystringOptional
bulkObject[]BulkCashInItemOptional
feeTypestringOptional
additionalInfojson.RawMessageOptional
BulkCashInItem fields

BulkCashInItem is one entry in Submit Bulk Cash In’s request “bulkObject[]” array. AccountNumber and PartnerReferenceNo are mandatory per the Guides tab.

FieldTypePresence
accountNumberstringMandatory
accountNamestringOptional
amount*snap.MoneyOptional
partnerReferenceNostringMandatory
additionalInfojson.RawMessageOptional

Response — SubmitBulkCashInResponse

SubmitBulkCashInResponse is the response body for API Submit Bulk Cash In. Note its field is bulkid (lowercase d) — likely a typo in the standard, but this package matches the documented wire casing exactly since no worked example confirms a fix. The Notify Bulk Cash In response below uses the normal camelCase bulkId instead.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
bulkidstringMandatory
partnerBulkIdstringOptional

Notify Bulk Cash In

Inbound only — this package does not call an endpoint for this. A partner/switcher POSTs it to your callback URL; unmarshal the body into NotifyBulkCashInRequest after verifying it with snap.ServerVerifier (see Verifying inbound requests), then reply with the shape below.

Received — NotifyBulkCashInRequest

NotifyBulkCashInRequest is the request body for API Notify Bulk Cash In (Service Code 41, path …/{version}/emoney/bulk-cashin-notify). This is a settlement callback the PJP receives, not a call this package makes — wire your own HTTP handler for this path, authenticate the request with ServerVerifier.VerifyTransactionRequest, then json.Unmarshal the body into this type. BulkID and PartnerBulkID are Mandatory.

FieldTypePresence
bulkIdstringMandatory
partnerBulkIdstringMandatory
bulkObject[]BulkCashInNotificationItemMandatory
BulkCashInNotificationItem fields

BulkCashInNotificationItem is one entry in the notification’s bulkObject[] array — a settlement-result shape, distinct from BulkCashInItem’s transfer-instruction shape. CustomerNumber, ReferenceNo, PartnerReferenceNo, ResponseCode, and ResponseMessage are all Mandatory.

FieldTypePresence
customerNumberstringMandatory
customerNamestringOptional
amount*snap.MoneyOptional
referenceNostringMandatory
partnerReferenceNostringMandatory
responseCodestringMandatory
responseMessagestringMandatory
additionalInfojson.RawMessageOptional

Your handler replies with — NotifyBulkCashInResponse

NotifyBulkCashInResponse is the response body your handler sends back. BulkID and PartnerBulkID are Mandatory. Its bulkId field is normal camelCase — unlike SubmitBulkCashInResponse’s lowercase bulkid above.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
bulkIdstringMandatory
partnerBulkIdstringMandatory