Overview

Namespaces

  • ShippoClient
    • Entity
    • Http
      • Request
        • Addresses
        • Parcels
        • Shipments
        • Transactions
      • Response
        • Exception

Classes

  • CreateObject
  • CreateObjectByNested
  • CreateReturnObject
  • Overview
  • Namespace
  • Class

Class CreateObject

The heart of the Shippo API, a Shipment is made up of "to" and "from" Address and the Parcel to be shipped. Once created, a Shipment object can be used to retrieve shipping Rates and purchase a shipping Label.

ShippoClient\Http\Request\CommonParameter uses TurmericSpice\ReadWriteAttributes (not available)
Extended by ShippoClient\Http\Request\Shipments\CreateObject uses TurmericSpice\ReadWriteAttributes (not available)

Direct known subclasses

ShippoClient\Http\Request\Shipments\CreateObjectByNested, ShippoClient\Http\Request\Shipments\CreateReturnObject
Namespace: ShippoClient\Http\Request\Shipments
Located at Http/Request/Shipments/CreateObject.php
Methods summary
public string
# getObjectPurpose( )

Quote Shipment can only be used to obtain quote Rates; at the same time, they accept any valid or completed Address object. Purchase Shipment can be used to obtain Rates and purchase Labels, but only accept purchase Address that have been fully entered.

Quote Shipment can only be used to obtain quote Rates; at the same time, they accept any valid or completed Address object. Purchase Shipment can be used to obtain Rates and purchase Labels, but only accept purchase Address that have been fully entered.

Required

Returns

string

Throws

TurmericSpice\Container\InvalidAttributeException
public string
# getAddressFrom( )

ID of the Address object that should be used as sender Address.

ID of the Address object that should be used as sender Address.

Required

Returns

string

Throws

TurmericSpice\Container\InvalidAttributeException
public string
# getAddressTo( )

ID of the Address object that should be used as recipient Address.

ID of the Address object that should be used as recipient Address.

Required

Returns

string

Throws

TurmericSpice\Container\InvalidAttributeException
public string
# getParcel( )

ID of the Parcel object to be shipped.

ID of the Parcel object to be shipped.

Required

Returns

string

Throws

TurmericSpice\Container\InvalidAttributeException
public string
# getSubmissionType( )

Indicates whether the parcel will be dropped off at a carrier location or will be picked up. Selecting 'PICKUP' does not request a carrier pickup. A pickup always needs to be requested separately.

Indicates whether the parcel will be dropped off at a carrier location or will be picked up. Selecting 'PICKUP' does not request a carrier pickup. A pickup always needs to be requested separately.

Optional, defaults to DROPOFF

Returns

string

Throws

TurmericSpice\Container\InvalidAttributeException
public string
# getReturnOf( )

ID of the Transaction object of the outbound shipment. This field triggers the creation of a scan-based return shipments. See the Create a return shipment section for more details.

ID of the Transaction object of the outbound shipment. This field triggers the creation of a scan-based return shipments. See the Create a return shipment section for more details.

Required for return labels

Returns

string
public string
# getSubmissionDate( )

Desired pickup date. Must be in the format "2014-01-18T00:35:03.463Z" (ISO 8601 date). Please note that for some carriers, not all pickup dates are available. The API will return the corresponding error message if not available. If no pickup_date is given, the value will default to tomorrow's date (including Saturday or Sunday, which can lead to no carrier availability).

Desired pickup date. Must be in the format "2014-01-18T00:35:03.463Z" (ISO 8601 date). Please note that for some carriers, not all pickup dates are available. The API will return the corresponding error message if not available. If no pickup_date is given, the value will default to tomorrow's date (including Saturday or Sunday, which can lead to no carrier availability).

Required if submission_type is 'PICKUP'. Defaults to current date (UTC) for 'DROPOFF'

Returns

string

Throws

TurmericSpice\Container\InvalidAttributeException
public string
# getAddressReturn( )

ID of the Address object where the shipment will be sent back to if it is not delivered (Only available for UPS, USPS, and Fedex shipments). If this field is not set, your shipments will be returned to the address_form.

ID of the Address object where the shipment will be sent back to if it is not delivered (Only available for UPS, USPS, and Fedex shipments). If this field is not set, your shipments will be returned to the address_form.

Optional

Returns

string
public string
# getCustomsDeclaration( )

ID of the Customs Declarations object for an international shipment.

ID of the Customs Declarations object for an international shipment.

Optional

Returns

string
public float
# getInsuranceAmount( )

Total Parcel value to be insured. Please note that you need to specify the "insurance_currency" as well as the "insurance_content" (via the extra field below, if your package content is not general cargo) as well.

Total Parcel value to be insured. Please note that you need to specify the "insurance_currency" as well as the "insurance_content" (via the extra field below, if your package content is not general cargo) as well.

Optional

Returns

float
public string
# getInsuranceCurrency( )

Currency used for insurance_amount. The official ISO 4217 currency codes are used, e.g. "USD" or "EUR".

Currency used for insurance_amount. The official ISO 4217 currency codes are used, e.g. "USD" or "EUR".

Required if insurance_amount is set

Returns

string

Throws

TurmericSpice\Container\InvalidAttributeException
public array
# getExtra( )

An array of extra services to be requested. The following services are currently available. We are continuously adding new ones. - signature_confirmation (string, "standard" for standard signature confirmation, "adult" for adult signature) - insurance_content (string, specify package content for insurance) - saturday_delivery (boolean, marks shipment as to be delivered on a Saturday) - bypass_address_validation (boolean, bypassed address validation, if applicable) - use_manifests (boolean, shipment to be linked with a manifest (Canada Post only), if applicable) - saturday_delivery (boolean, marks shipment as to be delivered on a Saturday. Available for UPS and FedEx.) - bypass_address_validation (boolean, bypassed address validation. Available for USPS, FedEx and UPS.) - request_retail_rates (boolean, request retail/list rates. Available for FedEx.) - use_manifests (boolean, shipment to be linked with a manifest (Canada Post only), if applicable)

An array of extra services to be requested. The following services are currently available. We are continuously adding new ones. - signature_confirmation (string, "standard" for standard signature confirmation, "adult" for adult signature) - insurance_content (string, specify package content for insurance) - saturday_delivery (boolean, marks shipment as to be delivered on a Saturday) - bypass_address_validation (boolean, bypassed address validation, if applicable) - use_manifests (boolean, shipment to be linked with a manifest (Canada Post only), if applicable) - saturday_delivery (boolean, marks shipment as to be delivered on a Saturday. Available for UPS and FedEx.) - bypass_address_validation (boolean, bypassed address validation. Available for USPS, FedEx and UPS.) - request_retail_rates (boolean, request retail/list rates. Available for FedEx.) - use_manifests (boolean, shipment to be linked with a manifest (Canada Post only), if applicable)

Optional

Returns

array
public string
# getReference1( )

Optional text to be printed on the shipping label.

Optional text to be printed on the shipping label.

Optional

Returns

string
public string
# getReference2( )

Optional text to be printed on the shipping label.

Optional text to be printed on the shipping label.

Optional

Returns

string
public string
# getCarrierAccounts( )

An array of object_ids of the carrier account objects to be used for getting shipping rates for this shipment. If no carrier account object_ids are set in this field, Shippo will attempt to generate rates using all the carrier accounts that have the 'active' field set.

An array of object_ids of the carrier account objects to be used for getting shipping rates for this shipment. If no carrier account object_ids are set in this field, Shippo will attempt to generate rates using all the carrier accounts that have the 'active' field set.

Returns

string
public
# toArray( )
Methods inherited from ShippoClient\Http\Request\CommonParameter
getMetadata()
Constants summary
string OBJECT_PURPOSE_QUOTE
# 'QUOTE'
string OBJECT_PURPOSE_PURCHASE
# 'PURCHASE'
string SUBMISSION_TYPE_DROPOFF
# 'DROPOFF'
string SUBMISSION_TYPE_PICKUP
# 'PICKUP'
API documentation generated by ApiGen