public final class Batch extends APIResource
/batches endpoint documented at
https://goshippo.com/docs/reference#batches| Modifier and Type | Class and Description |
|---|---|
static class |
Batch.BatchShipmentCollection |
static class |
Batch.BatchStatus |
static class |
Batch.Counts |
static class |
Batch.ShipmentStatus |
APIResource.RequestMethodCHARSETPRETTY_PRINT_GSON| Constructor and Description |
|---|
Batch() |
| Modifier and Type | Method and Description |
|---|---|
static Batch |
addShipments(String id,
String[] shipmentIds)
Add shipments to an existing batch provided by id.
|
static Batch[] |
all()
Get all batches created in the account.
|
static Batch |
create(String carrierAccount,
String serviceLevelToken,
LabelFileType labelFileType,
String metadata,
BatchShipment[] shipments)
Create a batch.
|
static Batch |
get(String id,
int page,
Batch.ShipmentStatus objectResults)
Get batch based on its ID.
|
Batch.BatchShipmentCollection |
getBatchShipments() |
Date |
getCreated() |
String |
getDefaultCarrierAccount() |
String |
getDefaultServiceLevelToken() |
String |
getId() |
LabelFileType |
getLabelFileType() |
String[] |
getLabelURLs() |
String |
getMetadata() |
Batch.Counts |
getObjectResults() |
String |
getOwner() |
Batch.BatchStatus |
getStatus() |
Date |
getUpdated() |
static Batch |
purchase(String id)
Purchase batch provided by id.
|
static Batch |
removeShipments(String id,
String[] shipmentIds)
Remove shipments to an existing batch provided by id.
|
String |
toString() |
_request, classURL, classURLWithTrailingSlash, instanceURL, request, singleClassURL, urlEncodepublic String toString()
toString in class ShippoObjectpublic static Batch[] all() throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException, UnsupportedEncodingException, MalformedURLException
AuthenticationExceptionInvalidRequestExceptionAPIConnectionExceptionAPIExceptionUnsupportedEncodingExceptionMalformedURLExceptionpublic static Batch create(String carrierAccount, String serviceLevelToken, LabelFileType labelFileType, String metadata, BatchShipment[] shipments) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException
carrierAccount - Carrier account ID used if not provided in individual
shipmentsserviceLevelToken - Associated service level token used if not provided in
shipmentslabelFileType - Print format of the labelmetadata - Optional user content associated with the batchshipments - Array of BatchShipment objects that will be added to
the batchAuthenticationExceptionInvalidRequestExceptionAPIConnectionExceptionAPIExceptionpublic static Batch get(String id, int page, Batch.ShipmentStatus objectResults) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException
page and objectResults parameter. This
function corresponds to https://api.goshippo.com/batches/BATCH OBJECT ID
endpoint documented at https://goshippo.com/docs/reference#batches-retrieveid - ID of batch to retrievepage: - the page to return. Is ignored if it is 0.objectResults - filter shipments that have this status. Can be null if
filtering is not required.AuthenticationExceptionInvalidRequestExceptionAPIConnectionExceptionAPIExceptionpublic static Batch addShipments(String id, String[] shipmentIds) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException
Shipment.create(java.util.Map<java.lang.String, java.lang.Object>). This method corresponds to
https://api.goshippo.com/batches/BATCH OBJECT ID/add_shipments endpoint
defined in https://goshippo.com/docs/reference#batches-add-shipmentsid - Batch object IDshipmentIds - Array of shipment Ids to be added to the batchAuthenticationExceptionInvalidRequestExceptionAPIConnectionExceptionAPIExceptionpublic static Batch removeShipments(String id, String[] shipmentIds) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException
id - Batch object IDshipmentIds - Array of shipment Ids to be removed from the batchAuthenticationExceptionInvalidRequestExceptionAPIConnectionExceptionAPIExceptionpublic static Batch purchase(String id) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException
id - Batch object IDAuthenticationExceptionInvalidRequestExceptionAPIConnectionExceptionAPIExceptionpublic String getId()
public String getOwner()
public Batch.BatchStatus getStatus()
public Date getCreated()
public Date getUpdated()
public String getMetadata()
public String getDefaultCarrierAccount()
public String getDefaultServiceLevelToken()
public LabelFileType getLabelFileType()
public Batch.BatchShipmentCollection getBatchShipments()
public String[] getLabelURLs()
public Batch.Counts getObjectResults()
Copyright © 2017 Shippo. All rights reserved.