Change order address

POST /api/v1/orders/:order_id/address write:order

Changes where a committed (PENDING) order ships, before the warehouse packs it. The new address is checked the same way as on POST /shipping-quote, and must be in the same country as the current one: an order for another country is a new order: hold this one, cancel it, and quote the cards again. The order keeps its carrier, its service and the shipping you were billed; if the new address costs more or less to ship to, that difference is ours. What happens to the label depends on the order. With no label yet, the order simply points at the new address, after we check that its service delivers there, and its label is bought for that address. An order that already has a label (the warehouse buys it before packing, once the order’s cards are picked) gets a new label for the new address in the same call: a new shippo_tracking_number, the old number in previous_tracking_numbers, an order.tracking_updated event on your activity log, and a refund requested for the old label. A packed order (READY_TO_SHIP or COMPLETED with a label) cannot be changed here, because someone has to find the box and relabel it: contact us. A parcel the carrier has scanned can only be redirected with the carrier. The path takes the integer order_id or the order’s reference. Sending the address the order already ships to changes nothing and returns 200.

Every refusal changes nothing: the order keeps its address and its label.

Try it POST /api/v1/orders/0/address write

These inputs are shared across all docs pages, so an id entered here carries over.

request body
object · 1 keys
{
  "address": {
    "name": "Demo Buyer",
    "street1": "1 Market St",
    "city": "San Francisco",
    "state": "CA",
    "zip": "94105",
    "country": "US"
  }
}
response

Not run yet. Press Run to make a live call against https://service.rip.fun (through this demo's server-side proxy; the API key never reaches the browser).

curl (tracks the inputs above)
curl -X POST 'https://service.rip.fun/api/v1/orders/0/address' \
  -H 'X-API-Key: rip_…' \
  -H 'Content-Type: application/json' \
  -d '{"address":{"name":"Demo Buyer","street1":"1 Market St","city":"San Francisco","state":"CA","zip":"94105","country":"US"}}'

Request fields

FieldTypeRequiredDescription
address.namestringyesRecipient full name, as it should print on the label. It must contain at least one letter or digit: a name of only emoji or symbols is refused with `400`, because no carrier can print it
address.street1stringyesStreet line 1, at most 100 characters (`street2` optional, for a unit, floor or c/o line). Outside the US the label carries both lines exactly as you send them, so send them the way the address is written locally. A `#` is fine: `#12-345`
address.citystringyesCity
address.statestring—State / region. Required for US, CA, AU, IE, VN and every country not listed here. May be blank or left out for: AD, AE, AG, AI, AL, AM, AO, AS, AT, AW, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BW, BZ, CD, CF, CG, CH, CK, CL, CM, CN, CO, CR, CV, CW, CY, CZ, DE, DJ, DK, DM, DZ, EE, EG, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GT, GU, GW, GY, HK, HN, HR, HT, HU, ID, IL, IN, IQ, IS, IT, JE, JM, JO, JP, KE, KG, KI, KM, KN, KR, KZ, LA, LC, LI, LK, LR, LS, LU, LV, LY, MA, MC, MD, ME, MH, MK, ML, MM, MN, MO, MQ, MS, MT, MW, MX, MY, MZ, NA, NC, NE, NI, NL, NO, NP, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SD, SE, SG, SH, SI, SK, SL, SM, SN, SO, SR, SV, SX, SZ, TC, TD, TG, TH, TJ, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UY, UZ, VA, VC, VG, VI, VU, WS, YT, ZA, ZM. Don't send a placeholder such as "N/A". The rule reads the two-letter country code, so a country sent as a name ("Singapore", "UK") still needs a state. A US military address (APO, FPO, DPO) uses `AA`, `AE` or `AP` with country `US`: it is quoted like any US address, and we add the customs declaration USPS asks for
address.zipstring—Postal code. Required everywhere except the countries that have none: AE, AG, AO, AW, BF, BH, BI, BJ, BO, BQ, BS, BW, BZ, CD, CF, CG, CK, CM, CW, DJ, DM, ER, FJ, GA, GH, GM, GN, GQ, GY, HK, JM, KI, KM, KN, LR, LY, ML, MO, MW, NA, NE, NI, NU, PA, PY, QA, RW, SB, SL, SO, SR, SX, TD, TG, TL, TO, TT, TV, UG, VU, WS. Leave it blank or out for those and we fill in what the carriers need. Don't send a placeholder such as "N/A". Singapore is not one of them: send its 6-digit postcode
address.countrystringyesTwo-letter ISO country code, e.g. `US`, `GB`, `SG` (`email`, `company` optional). Send the code, not a name: the blank-state and blank-postcode rules above only apply to a code
address.phonestring—Recipient phone. REQUIRED for any non-US destination — carriers will not issue an international label without one. Any national ("0439 927 773") or international ("+61 439 927 773") format is accepted; we normalise it to E.164 for the destination country. Optional for US addresses

Response fields (data)

FieldDescription
dataThe order after the change, same shape as GET /orders/:order_id. shippo_address_id is the new address
address_change.changedfalse when the address sent is the one the order already ships to
address_change.label"none": no label yet; it will be bought for the new address. "replaced": a new label was bought now; data.shippo_tracking_number is its number. "relabel": the warehouse packed the order while the change ran; a new label was bought, the old one is not refunded yet, and we put the new label on the parcel
address_change.previous_tracking_numberThe tracking number of the replaced label, or null
address_change.previous_label_refund"requested", "not_refundable", "failed" (we retry it), or null when no label was replaced

Errors

StatusCodeWhen
403Insufficient permissionskey is tenant-scoped but carries neither write:order nor admin
400INVALID_ADDRESSa required address field is missing, street1 is over 100 characters, or Shippo could not verify the address — messages[] carries Shippo’s reasons
400PHONE_REQUIREDthe address is outside the US and has no phone
404order not foundorder not part of your account
409ORDER_NOT_COMMITTEDthe order is still a quote (PENDING_PAYMENT): quote again with the new address
409ORDER_PACKEDthe order is packed with its label (READY_TO_SHIP or COMPLETED): contact us to relabel it
409ALREADY_WITH_CARRIERthe carrier has scanned the parcel
409ORDER_CLOSEDthe order is CANCELLED, RETURNED, or COMPLETED without a label
409ORDER_SPLITthe order ships as more than one parcel
409ORDER_ON_HOLDthe order is on hold: release it first
409NO_SHIPPING_ADDRESSthe order has no shipping address on file (one the warehouse ships without a Rip label): contact us
409COUNTRY_UNKNOWNthe country the order ships to could not be read: contact us
409LABEL_PURCHASE_IN_FLIGHT / LABEL_PURCHASE_UNSETTLED / ORDER_CHANGEDthe warehouse is buying the order’s label right now, or the order changed while the address was saved. retryable is true: try again in a minute
422COUNTRY_CHANGEthe new address is in another country
422SERVICE_UNAVAILABLEthe carrier service on the order does not deliver to the new address
502SHIPPO_ERRORShippo could not be reached; retryable. Nothing was changed

See Errors for the response envelope and the full code list.