/admin/addresses/:id/items
Path: /admin/addresses/:id/items
Namespace: admin
Parent Resource: addresses
Overview
Items represent products or services associated with an address. This nested resource provides access to items linked to a specific address.
Available Operations
List Items (GET)
Endpoint: GET /admin/addresses/:id/items.json
Description: Retrieve all items for a specific address.
Request Example:
GET /admin/addresses/123/items.jsonResponse (200 OK):
{
"items": [
{
"id": 1,
"address_id": 123,
"name": "Product Name",
"sku": "SKU-001",
"price_cents": 10000
}
]
}Show Item (GET /:id)
Endpoint: GET /admin/addresses/:id/items/:id.json
Description: Retrieve a specific item.
Request Example:
GET /admin/addresses/123/items/1.jsonResponse (200 OK):
{
"item": {
"id": 1,
"address_id": 123,
"name": "Product Name",
"sku": "SKU-001",
"price_cents": 10000
}
}Create Item (POST)
Endpoint: POST /admin/addresses/:id/items.json
Description: Create a new item for an address.
Request Example:
POST /admin/addresses/123/items.json
Content-Type: application/json
{
"item": {
"name": "New Product",
"sku": "SKU-002",
"price_cents": 15000
}
}Response (201 Created):
{
"item": {
"id": 2,
"address_id": 123,
"name": "New Product"
}
}Update Item (PATCH /:id)
Endpoint: PATCH /admin/addresses/:id/items/:id.json
Description: Update an existing item.
Request Example:
PATCH /admin/addresses/123/items/1.json
Content-Type: application/json
{
"item": {
"price_cents": 12000
}
}Response (200 OK):
{
"item": {
"id": 1,
"price_cents": 12000
}
}Delete Item (DELETE /:id)
Endpoint: DELETE /admin/addresses/:id/items/:id.json
Description: Delete an item.
Request Example:
DELETE /admin/addresses/123/items/1.jsonResponse (204 No Content)
Batch Actions (POST /batch_action)
Endpoint: POST /admin/addresses/:id/items/batch_action.json
Description: Perform batch operations on selected items.
Request Example:
POST /admin/addresses/123/items/batch_action.json
Content-Type: application/json
{
"batch_action": "update",
"collection_selection": [1, 2, 3],
"batch_action_inputs": {
"price_cents": 10000
}
}Response (200 OK):
{
"message": "Batch action completed",
"affected_count": 3
}Related Documentation
- Address Resource - Parent address resource
- Item Resource - Item management