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.
| Field | Type | Presence |
|---|---|---|
partnerBulkId | string | Optional |
transactionDate | string | Mandatory |
currency | string | Optional |
bulkObject | []BulkCashInItem | Optional |
feeType | string | Optional |
additionalInfo | json.RawMessage | Optional |
BulkCashInItem fields
BulkCashInItem is one entry in Submit Bulk Cash In’s request “bulkObject[]” array. AccountNumber and PartnerReferenceNo are mandatory per the Guides tab.
| Field | Type | Presence |
|---|---|---|
accountNumber | string | Mandatory |
accountName | string | Optional |
amount | *snap.Money | Optional |
partnerReferenceNo | string | Mandatory |
additionalInfo | json.RawMessage | Optional |
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.
| Field | Type | Presence |
|---|---|---|
responseCode | string | Mandatory |
responseMessage | string | Mandatory |
bulkid | string | Mandatory |
partnerBulkId | string | Optional |
Notify Bulk Cash In
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.
| Field | Type | Presence |
|---|---|---|
bulkId | string | Mandatory |
partnerBulkId | string | Mandatory |
bulkObject | []BulkCashInNotificationItem | Mandatory |
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.
| Field | Type | Presence |
|---|---|---|
customerNumber | string | Mandatory |
customerName | string | Optional |
amount | *snap.Money | Optional |
referenceNo | string | Mandatory |
partnerReferenceNo | string | Mandatory |
responseCode | string | Mandatory |
responseMessage | string | Mandatory |
additionalInfo | json.RawMessage | Optional |
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.
| Field | Type | Presence |
|---|---|---|
responseCode | string | Mandatory |
responseMessage | string | Mandatory |
bulkId | string | Mandatory |
partnerBulkId | string | Mandatory |