Easy Labs
SDKsNode.jsResources

Transfers

Transfers — methods, parameters, and examples for @easylabs/node.

A transfer is the money-movement record produced by a charge. Most transfers are created indirectly (by checkout, payInvoice, subscription billing, or captureAuthorization); this resource lets you create raw transfers, list and read them, update tags, and reverse them via refunds.

Methods

createTransfer(data)

POST /transfer.

const { data: transfer } = await easy.createTransfer({
  amount: 4999,           // smallest currency unit (cents for USD)
  currency: "USD",
  source: instrumentId,   // payment-instrument ID to debit
  tags: { internal_order_id: "ord_42" },
});

updateTransfer(transferId, data)

PATCH /transfer/:id. The body is a free-form Record<string, unknown> — currently used to attach or replace tags.

await easy.updateTransfer(transfer.id, { tags: { fulfilment: "shipped" } });

getTransfer(transferId)

GET /transfer/:id.

getTransfers(params?)

GET /transfer. Standard pagination.

createRefund(transferId, body)

See refunds — under the hood this issues a POST /transfer/:id/reversals and the response is itself a TransferData with type: "REVERSAL".

Object shape

TransferData is the underlying processor record. The fields you'll touch most:

FieldTypeNotes
idstringTransfer ID.
amount / amount_requestednumberIn smallest currency units.
currencystringISO 4217.
source / destinationstring | nullPayment-instrument IDs.
stateTransferStatePENDING, SUCCEEDED, FAILED, CANCELED, DISPUTED, etc.
typeTransferTypeDEBIT, CREDIT, REVERSAL, FEE, DISPUTE.
subtypeTransferSubtypeE.g. API, PUSH, PLATFORM.
failure_code / failure_messagestring | nullPopulated on FAILED.
fee / supplemental_feenumberProcessor + platform fees.
parent_transferstring | nullSet on reversals to point at the original.
tagsRecord<string, string>Application metadata.
_linksobjectHATEOAS links — reversals, disputes, fees, etc.

Examples

Find every refund issued against a transfer

const refunds = (await easy.getTransfers({ limit: 100 })).data.filter(
  (t) => t.type === "REVERSAL" && t.parent_transfer === originalId,
);

Tag a charge with your internal order number

await easy.updateTransfer(transferId, {
  tags: { internal_order_id: "ord_42", channel: "web" },
});

Read failure details

const { data: t } = await easy.getTransfer(transferId);
if (t.state === "FAILED") {
  console.error(t.failure_code, t.failure_message);
}

On this page