Trolley JavaScript SDK > BatchGateway
Gateway class for batcheso class: BatchGateway
BatchGateway
▸ all(): Promise<Batch[]>
Defined in BatchGateway.ts:52
Fetch batch all batches with an Iterator
Returns: Promise<Batch[]>
▸ create(batch: BatchInput, payments?: PaymentInput[]): Promise<Batch>
Defined in BatchGateway.ts:95
Creates a batch with optional payments. This is the interface that is provide by the Create Batch API
const batch = await client.batch.create({
description: "My Batch",
sourceCurrency: "USD",
}, [
{
recipient: {
email: "john@example.com",
},
sourceAmount: "10.20",
},
]);
Parameters:
| Param | Type | Description |
|---|---|---|
| batch | BatchInput |
- |
Optional payments |
PaymentInput[] |
(optional) |
Returns: Promise<Batch>
▸ find(batchId: string): Promise<Batch>
Defined in BatchGateway.ts:67
Retrieves a batch based on the batch id
const batch = await client.batch.find('B-xx999bb');
Parameters:
| Param | Type | Description |
|---|---|---|
| batchId | string |
Trolley payment id (e.g. "B-xx999bb") |
Returns: Promise<Batch>
▸ generateQuote(batchId: string): Promise<Batch>
Defined in BatchGateway.ts:182
Generate a FX quote for this batch
Parameters:
| Param | Type | Description |
|---|---|---|
| batchId | string |
Trolley payment id (e.g. "B-xx999bb") |
Returns: Promise<Batch>
▸ paymentList(batchId: string, page?: number, pageSize?: number): Promise<Payment[]>
Defined in BatchGateway.ts:166
Return a paginated list of payments for this batch
Parameters:
| Param | Type | Default value | Description |
|---|---|---|---|
| batchId | string |
- | Trolley payment id (e.g. "B-xx999bb") |
Default value page |
number |
1 | starting a 1 |
Default value pageSize |
number |
10 | in the range 0...1000 |
Returns: Promise<Payment[]>
▸ remove(batchId: string): Promise<boolean>
Defined in BatchGateway.ts:132
Delete the given batch
const success = client.batch.remove('B-xx999bb');
Parameters:
| Param | Type | Description |
|---|---|---|
| batchId | string |
Trolley payment id (e.g. "B-xx999bb") |
Returns: Promise<boolean>
▸ search(page?: number, pageSize?: number, term?: string): Promise<Batch[]>
Defined in BatchGateway.ts:146
Search for a batch matching the given term
Parameters:
| Param | Type | Default value | Description |
|---|---|---|---|
Default value page |
number |
1 | - |
Default value pageSize |
number |
10 | - |
Default value term |
string |
"" | string search term |
Returns: Promise<Batch[]>
▸ startProcessing(batchId: string): Promise<Batch>
Defined in BatchGateway.ts:194
Start processing this batch
Parameters:
| Param | Type | Description |
|---|---|---|
| batchId | string |
Trolley payment id (e.g. "B-xx999bb") |
Returns: Promise<Batch>
▸ summary(batchId: string): Promise<BatchSummary>
Defined in BatchGateway.ts:206
Get a transaction totaled summary for this batch
Parameters:
| Param | Type | Description |
|---|---|---|
| batchId | string |
Trolley payment id (e.g. "B-xx999bb") |
Returns: Promise<BatchSummary>
▸ update(batchId: string, body: BatchInput): Promise<boolean>
Defined in BatchGateway.ts:117
Update the batch data, note you can only update the information of a batch not the payments via this API
const batch = await client.batch.create({
description: "My Batch for Wednesday",
});
Parameters:
| Param | Type | Description |
|---|---|---|
| batchId | string |
Trolley payment id (e.g. "B-xx999bb") |
| body | BatchInput |
Returns: Promise<boolean>