Update an easypost pickup
How to update an existing easypost pickup via API
To update an existing easypost pickup, send a PATCH request to the /api/easypost_pickups/:id endpoint, where id is the ID of the resource that you want to update.
Here below the list of all the possible arguments that you can pass with the request body.
Request
PATCH https://yourdomain.commercelayer.io/api/easypost_pickups/:id
Arguments
type
string
Required
id
string
Required
attributes.reference
string
Optional
attributes.reference_origin
string
Optional
attributes.metadata
object
Optional
attributes.selected_rate_id
string
Optional
attributes._purchase
boolean
Optional
relationships.shipment
object
Optional
Example
The following request updates the easypost pickup identified by the ID "XAyRWNUzyN":
curl -g -X PATCH \
'https://yourdomain.commercelayer.io/api/easypost_pickups/XAyRWNUzyN' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "easypost_pickups",
"id": "xYZkjABcde",
"attributes": {
"reference": "ANY-EXTERNAL-REFEFERNCE"
},
"relationships": {
"shipment": {
"data": {
"type": "shipments",
"id": "ABCRtyUpBa"
}
}
}
}
}'On success, the API responds with a 200 OK status code, returning the updated resource object:
{
"data": {
"id": "XAyRWNUzyN",
"type": "easypost_pickups",
"links": {
"self": "https://yourdomain.commercelayer.io/api/easypost_pickups/XAyRWNUzyN"
},
"attributes": {
"type": "easypost_pickups",
"status": "unknown",
"internal_id": "pickup_13e5d7e2a7824432a07975bc553944bc",
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANY-EXTERNAL-REFEFERNCE",
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
"metadata": {
"foo": "bar"
},
"selected_rate_id": "pickuprate_a6cd2647a898410aa5d33febde44e1b2",
"rates": [
{
"id": "pickuprate_a6cd2647a898410aa5d33febde44e1b2",
"rate": "45.59",
"carrier": "USPS",
"service": "NextDay"
}
],
"instructions": "Knock loudly",
"min_datetime": "2018-01-01T12:00:00.000Z",
"max_datetime": "2018-01-01T12:00:00.000Z",
"purchase_started_at": "2018-01-01T12:00:00.000Z",
"purchase_completed_at": "2018-01-01T12:00:00.000Z"
},
"relationships": {
"shipment": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/easypost_pickups/XAyRWNUzyN/relationships/shipment",
"related": "https://yourdomain.commercelayer.io/api/easypost_pickups/XAyRWNUzyN/shipment"
}
},
"parcels": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/easypost_pickups/XAyRWNUzyN/relationships/parcels",
"related": "https://yourdomain.commercelayer.io/api/easypost_pickups/XAyRWNUzyN/parcels"
}
},
"events": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/easypost_pickups/XAyRWNUzyN/relationships/events",
"related": "https://yourdomain.commercelayer.io/api/easypost_pickups/XAyRWNUzyN/events"
}
},
"event_stores": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/easypost_pickups/XAyRWNUzyN/relationships/event_stores",
"related": "https://yourdomain.commercelayer.io/api/easypost_pickups/XAyRWNUzyN/event_stores"
}
}
},
"meta": {
"mode": "test",
"organization_id": "xRRkjDFafe",
"trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74"
}
}
}Last updated

