Show / Hide Table of Contents

Class BatchService

Class representing a set of batch-related functionality.

Inheritance
System.Object
EasyPostService
BatchService
Implements
IEasyPostService
IDisposable
Inherited Members
EasyPostService.Client
EasyPostService.RequestAsync<T>(Method, String, CancellationToken, Nullable<Dictionary<String, Object>>, Nullable<String>, ApiVersion)
EasyPostService.RequestAsync(Method, String, CancellationToken, Nullable<Dictionary<String, Object>>, ApiVersion)
EasyPostService.Dispose()
EasyPostService.Dispose(Boolean)
Namespace: EasyPost.Services
Assembly: EasyPost.dll
Syntax
public class BatchService : EasyPostService, IEasyPostService

Methods

| Improve this Doc View Source

AddShipments(String, Dictionary<String, Object>, CancellationToken)

Add Shipments to a Batch. Related API documentation.

Declaration
public async Task<Batch> AddShipments(string id, Dictionary<string, object> parameters, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to add Shipments to.

Dictionary<System.String, System.Object> parameters

Parameters for the Shipments to add.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch object.

| Improve this Doc View Source

AddShipments(String, AddShipments, CancellationToken)

Add Shipments to a Batch. Related API documentation.

Declaration
public async Task<Batch> AddShipments(string id, AddShipments parameters, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to add Shipments to.

AddShipments parameters

Parameters for the Shipments to add.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch object.

| Improve this Doc View Source

AddShipments(String, IEnumerable<String>, CancellationToken)

Add Shipments to a Batch. Related API documentation.

Declaration
public async Task<Batch> AddShipments(string id, IEnumerable<string> shipmentIds, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to add Shipments to.

IEnumerable<System.String> shipmentIds

List of IDs of Shipments to add to the Batch.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch object.

| Improve this Doc View Source

AddShipments(String, List<Shipment>, CancellationToken)

Add Shipments to a Batch. Related API documentation.

Declaration
public async Task<Batch> AddShipments(string id, List<Shipment> shipmentsToAdd, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to add Shipments to.

List<Shipment> shipmentsToAdd

List of Shipments to add to the Batch.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch object.

| Improve this Doc View Source

All(All, CancellationToken)

List all Batch objects. Related API documentation.

Declaration
public async Task<BatchCollection> All(All parameters, CancellationToken cancellationToken = null)
Parameters
Type Name Description
All parameters

All parameter set.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<BatchCollection>

A BatchCollection instance.

| Improve this Doc View Source

All(Nullable<Dictionary<String, Object>>, CancellationToken)

List all Batch objects. Related API documentation.

Declaration
public async Task<BatchCollection> All(Dictionary<string, object>? parameters = null, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.Nullable<Dictionary<System.String, System.Object>> parameters

Dictionary containing parameters to filter the result list with.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<BatchCollection>

A BatchCollection instance.

| Improve this Doc View Source

Buy(String, CancellationToken)

Purchase all Shipments within a Batch. The State must be "created" before purchasing. Related API documentation.

Declaration
public async Task<Batch> Buy(string id, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to purchase Shipments from.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch object.

| Improve this Doc View Source

Create(Create, CancellationToken)

Create a Batch. Related API documentation.

Declaration
public async Task<Batch> Create(Create parameters, CancellationToken cancellationToken = null)
Parameters
Type Name Description
Create parameters

Data to use to create the Batch.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

A Batch object.

| Improve this Doc View Source

Create(Nullable<Dictionary<String, Object>>, CancellationToken)

Create a Batch. Related API documentation.

Declaration
public async Task<Batch> Create(Dictionary<string, object>? parameters = null, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.Nullable<Dictionary<System.String, System.Object>> parameters

Data to use to create the Batch.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

A Batch object.

| Improve this Doc View Source

GenerateLabel(String, GenerateLabel, CancellationToken)

Asynchronously generate a PostageLabel containing all of the Shipment labels belonging to this Batch. Related API documentation.

Declaration
public async Task<Batch> GenerateLabel(string id, GenerateLabel parameters, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to generate a label for.

GenerateLabel parameters

GenerateLabel parameter set.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch object.

| Improve this Doc View Source

GenerateLabel(String, String, CancellationToken)

Asynchronously generate a PostageLabel containing all of the Shipment labels belonging to a Batch. Related API documentation.

Declaration
public async Task<Batch> GenerateLabel(string id, string fileFormat, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to generate a label for.

System.String fileFormat

Format to generate the label in. Must be "pdf" or "zpl".

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch object.

| Improve this Doc View Source

GenerateScanForm(String, GenerateScanForm, CancellationToken)

Asynchronously generate a ScanForm for this Batch. Related API documentation.

Declaration
public async Task<Batch> GenerateScanForm(string id, GenerateScanForm parameters, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

String representing a Batch. Starts with "batch_".

GenerateScanForm parameters

GenerateScanForm parameter set.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

This updated Batch instance.

| Improve this Doc View Source

GenerateScanForm(String, String, CancellationToken)

Asynchronously generate a ScanForm for a Batch. Related API documentation.

Declaration
public async Task<Batch> GenerateScanForm(string id, string fileFormat, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

String representing a Batch. Starts with "batch_".

System.String fileFormat

Format to generate the label in. Valid formats: "pdf", "zpl" and "epl2".

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch instance.

| Improve this Doc View Source

RemoveShipments(String, Dictionary<String, Object>, CancellationToken)

Remove Shipments from a Batch. Related API documentation.

Declaration
public async Task<Batch> RemoveShipments(string id, Dictionary<string, object> parameters, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to remove Shipments from.

Dictionary<System.String, System.Object> parameters

Parameters for the Shipments to remove.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch object.

| Improve this Doc View Source

RemoveShipments(String, RemoveShipments, CancellationToken)

Remove Shipments from a Batch. Related API documentation.

Declaration
public async Task<Batch> RemoveShipments(string id, RemoveShipments parameters, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to remove Shipments from.

RemoveShipments parameters

Parameters for the Shipments to remove.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch object.

| Improve this Doc View Source

RemoveShipments(String, IEnumerable<String>, CancellationToken)

Remove Shipments from a Batch. Related API documentation.

Declaration
public async Task<Batch> RemoveShipments(string id, IEnumerable<string> shipmentIds, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to remove Shipments from.

IEnumerable<System.String> shipmentIds

List of IDs of Shipments to remove from the Batch.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch object.

| Improve this Doc View Source

RemoveShipments(String, List<Shipment>, CancellationToken)

Remove Shipments from a Batch. Related API documentation.

Declaration
public async Task<Batch> RemoveShipments(string id, List<Shipment> shipmentsToRemove, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to remove Shipments from.

List<Shipment> shipmentsToRemove

List of Shipments to remove from the Batch.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

An updated Batch object.

| Improve this Doc View Source

Retrieve(String, CancellationToken)

Retrieve a Batch. Related API documentation.

Declaration
public async Task<Batch> Retrieve(string id, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String id

The ID of the Batch to retrieve.

CancellationToken cancellationToken

to use for the HTTP request.

Returns
Type Description
Task<Batch>

The requested Batch.

Implements

IEasyPostService
IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX