Service Dog Standards Help

Orders

1. All user orders

Endpoint

GET /api/v1/shop/orders

Request Headers

{ "Authorization": "Bearer token here", "X-API-Key": "123456789", "Content-Type": "application/json" }

Response Body (200)

{ "message": "Orders retrieved successfully", "user_id": 1, "orders": [ { "id": 7, "order_number": "ORD-20250331-IEIK", "status": "pending", "user_id": 1, "total_price": "56.00", "published": 1, "email": "[email protected]", "shipping_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "billing_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "shipping": { "method": "standard", "amount": 0 }, "tax_amount": 0, "discount_amount": 0, "items": [ { "id": 74, "sku": "EH-2", "quantity": 1, "price": "56.00", "total_price": "56.00", "options": { "color": "red", "size": "XL" }, "product": { "id": 2, "title": "Main product 2", "sku": "EH-2", "price": 56 } } ], "notes": "Please leave package at front door", "created_at": "2025-03-31T01:08:47.000000Z", "updated_at": "2025-03-31T01:08:48.000000Z", "meta": { "source": "cart", "item_74_name": "Main product 2", "subtotal": "56", "source_cart_id": "user_1", "created_at": "2025-03-31 01:08:49" } }, { "id": 6, "order_number": "ORD-20250331-D8C3", "status": "processing", "user_id": 1, "total_price": "56.00", "published": 1, "email": "[email protected]", "shipping_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "billing_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "shipping": { "method": "standard", "amount": 0 }, "tax_amount": 0, "discount_amount": 0, "items": [ { "id": 73, "sku": "EH-2", "quantity": 1, "price": "56.00", "total_price": "56.00", "options": { "color": "red", "size": "XsL" }, "product": { "id": 2, "title": "Main product 2", "sku": "EH-2", "price": 56 } } ], "notes": "Please leave package at front door", "created_at": "2025-03-31T00:50:12.000000Z", "updated_at": "2025-03-31T00:52:51.000000Z", "meta": { "source": "cart", "item_73_name": "Main product 2", "subtotal": "56", "source_cart_id": "user_1", "created_at": "2025-03-31 00:50:15", "payment_payment_id": "pi_3R8WaCQ9LjHruSyq1kKAuadA", "payment_payment_provider": "stripe", "payment_payment_method": "pm_1R8WacQ9LjHruSyqwbISwAtu", "payment_payment_status": "succeeded", "payment_id": "pi_3R8WaCQ9LjHruSyq1kKAuadA", "payment_status": "completed", "payment_method": "stripe", "payment_data": "{\"payment_method\":\"pm_1R8WacQ9LjHruSyqwbISwAtu\",\"amount\":56,\"currency\":\"usd\"}" } }, { "id": 5, "order_number": "ORD-20250328-JXIW", "status": "pending", "user_id": 1, "total_price": "66.00", "published": 1, "email": "[email protected]", "shipping_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "billing_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "shipping": { "method": "standard", "amount": 0 }, "tax_amount": 0, "discount_amount": 0, "items": [ { "id": 72, "sku": "EH-1", "quantity": 2, "price": "33.00", "total_price": "66.00", "options": { "color": "red", "size": "XL" }, "product": { "id": 1, "title": "Main product 1", "sku": "EH-1", "price": 33, "cover": "https://servicedog.biz/img/d4abcf7e-1ca7-40e2-9e52-ad5445623141/photo-2024-12-03-10-54-37.jpg?fm=jpg&q=80&fit=max&crop=417%2C235%2C608%2C0", "gallery": [ "https://servicedog.biz/img/d4abcf7e-1ca7-40e2-9e52-ad5445623141/photo-2024-12-03-10-54-37.jpg?fm=jpg&q=80&fit=max&crop=417%2C235%2C608%2C0", "https://servicedog.biz/img/9a1a9304-556b-499d-ba59-9e50b92120a8/screenshot-20241216-122351.png?fm=jpg&q=80&fit=max&crop=1843%2C1038%2C65%2C0" ] } } ], "notes": "Please leave package at front door", "created_at": "2025-03-28T09:43:23.000000Z", "updated_at": "2025-03-28T09:43:24.000000Z", "meta": { "source": "cart", "item_72_name": "Main product 1", "subtotal": "66", "source_cart_id": "user_1", "created_at": "2025-03-28 09:43:25" } } ] }

2. Get one user order by order number

Endpoint

GET /api/v1/shop/orders/number/{orderNumber}

Request Headers

{ "Authorization": "Bearer token here", "X-API-Key": "123456789", "Content-Type": "application/json" }

Response Body (200)

{ "message": "Order retrieved successfully", "order": { "id": 7, "order_number": "ORD-20250331-IEIK", "status": "pending", "user_id": 1, "total_price": "56.00", "published": 1, "email": "[email protected]", "shipping_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "billing_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "shipping": { "method": "standard", "amount": 0 }, "tax_amount": 0, "discount_amount": 0, "items": [ { "id": 74, "sku": "EH-2", "quantity": 1, "price": "56.00", "total_price": "56.00", "options": { "color": "red", "size": "XL" }, "product": { "id": 2, "title": "Main product 2", "sku": "EH-2", "price": 56 } } ], "notes": "Please leave package at front door", "created_at": "2025-03-31T01:08:47.000000Z", "updated_at": "2025-03-31T01:08:48.000000Z", "meta": { "source": "cart", "item_74_name": "Main product 2", "subtotal": "56", "source_cart_id": "user_1", "created_at": "2025-03-31 01:08:49" } } }

3. Get one user order by order Id

Endpoint

GET /api/v1/shop/orders/{orderId}

Request Headers

{ "Authorization": "Bearer token here", "X-API-Key": "123456789", "Content-Type": "application/json" }

Response Body (200)

{ "message": "Order retrieved successfully", "order": { "id": 7, "order_number": "ORD-20250331-IEIK", "status": "pending", "user_id": 1, "total_price": "56.00", "published": 1, "email": "[email protected]", "shipping_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "billing_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "shipping": { "method": "standard", "amount": 0 }, "tax_amount": 0, "discount_amount": 0, "items": [ { "id": 74, "sku": "EH-2", "quantity": 1, "price": "56.00", "total_price": "56.00", "options": { "color": "red", "size": "XL" }, "product": { "id": 2, "title": "Main product 2", "sku": "EH-2", "price": 56 } } ], "notes": "Please leave package at front door", "created_at": "2025-03-31T01:08:47.000000Z", "updated_at": "2025-03-31T01:08:48.000000Z", "meta": { "source": "cart", "item_74_name": "Main product 2", "subtotal": "56", "source_cart_id": "user_1", "created_at": "2025-03-31 01:08:49" } } }

4. Create order

Endpoint

POST /api/v1/shop/orders

Request Headers

{ "Authorization": "Bearer token here", "X-API-Key": "123456789", "Content-Type": "application/json" }

Request Body (200)

{ "customer_name": "John Doe", "customer_email": "[email protected]", "shipping_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "shipping_method": "standard", "notes": "Please leave package at front door" }

Response Body (200)

{ "message": "Order retrieved successfully", "order": { "id": 7, "order_number": "ORD-20250331-IEIK", "status": "pending", "user_id": 1, "total_price": "56.00", "published": 1, "email": "[email protected]", "shipping_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "billing_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "shipping": { "method": "standard", "amount": 0 }, "tax_amount": 0, "discount_amount": 0, "items": [ { "id": 74, "sku": "EH-2", "quantity": 1, "price": "56.00", "total_price": "56.00", "options": { "color": "red", "size": "XL" }, "product": { "id": 2, "title": "Main product 2", "sku": "EH-2", "price": 56 } } ], "notes": "Please leave package at front door", "created_at": "2025-03-31T01:08:47.000000Z", "updated_at": "2025-03-31T01:08:48.000000Z", "meta": { "source": "cart", "item_74_name": "Main product 2", "subtotal": "56", "source_cart_id": "user_1", "created_at": "2025-03-31 01:08:49" } } }

5. Update order (if order status is pending)

Endpoint

PUT /api/v1/shop/orders/{orderId}

Request Headers

{ "Authorization": "Bearer token here", "X-API-Key": "123456789", "Content-Type": "application/json" }

Request Body (200)

{ "cart_id": "user_32", "customer_name": "John Doe", "customer_email": "[email protected]", "shipping_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York3", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "shipping_method": "standard", "notes": "Please leave package at front door", "items": [ { "product_sku": "EH-1", "quantity": 1, "options": { "color": "red" } }, { "product_sku": "EH-2", "quantity": 1 }, { "product_sku": "EH-1-1", "quantity": 2 } ] }

Response Body (200)

{ "message": "Order updated successfully", "order": { "id": 7, "order_number": "ORD-20250331-IEIK", "status": "pending", "user_id": 1, "total_price": "223.00", "published": 1, "email": "[email protected]", "shipping_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York3", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "billing_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "shipping": { "method": "standard", "amount": 0 }, "tax_amount": 0, "discount_amount": 0, "items": [ { "id": 78, "sku": "EH-1", "quantity": 1, "price": "33.00", "total_price": "33.00", "options": { "color": "red" }, "product": { "id": 1, "title": "Main product 1", "sku": "EH-1", "price": 33, "cover": "https://servicedog.biz/img/d4abcf7e-1ca7-40e2-9e52-ad5445623141/photo-2024-12-03-10-54-37.jpg?fm=jpg&q=80&fit=max&crop=417%2C235%2C608%2C0", "gallery": [ "https://servicedog.biz/img/d4abcf7e-1ca7-40e2-9e52-ad5445623141/photo-2024-12-03-10-54-37.jpg?fm=jpg&q=80&fit=max&crop=417%2C235%2C608%2C0", "https://servicedog.biz/img/9a1a9304-556b-499d-ba59-9e50b92120a8/screenshot-20241216-122351.png?fm=jpg&q=80&fit=max&crop=1843%2C1038%2C65%2C0" ] } }, { "id": 79, "sku": "EH-2", "quantity": 1, "price": "56.00", "total_price": "56.00", "options": null, "product": { "id": 2, "title": "Main product 2", "sku": "EH-2", "price": 56 } }, { "id": 80, "sku": "EH-1-1", "quantity": 2, "price": "67.00", "total_price": "134.00", "options": null, "product": { "id": 1, "title": "Main product variation 1", "sku": "EH-1-1", "price": 67, "parent_product": { "id": 1, "title": "Main product 1", "sku": "EH-1" } } } ], "notes": "Please leave package at front door", "created_at": "2025-03-31T01:08:47.000000Z", "updated_at": "2025-03-31T09:32:26.000000Z", "meta": { "source": "cart", "item_74_name": "Main product 2", "subtotal": "223", "source_cart_id": "user_1", "created_at": "2025-03-31 01:08:49" } } }

5. Cancel order (if order status is pending)

Endpoint

POST /api/v1/shop/orders/{orderId}/cancel

Request Headers

{ "Authorization": "Bearer token here", "X-API-Key": "123456789", "Content-Type": "application/json" }

Response Body (200)

{ "message": "Order cancelled successfully", "order": { "id": 8, "order_number": "ORD-20250331-VTD4", "status": "cancelled", "user_id": 1, "total_price": "168.00", "published": 1, "email": "[email protected]", "shipping_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "billing_address": { "first_name": "John", "last_name": "Doe", "address": "123 Main Street", "city": "New York", "state": "NY", "postcode": "10001", "country": "US", "phone": "212-555-1234" }, "shipping": { "method": "standard", "amount": 0 }, "tax_amount": 0, "discount_amount": 0, "items": [ { "id": 81, "sku": "EH-2", "quantity": 3, "price": "56.00", "total_price": "168.00", "options": { "color": "red", "size": "XL" }, "product": { "id": 2, "title": "Main product 2", "sku": "EH-2", "price": 56 } } ], "notes": "Please leave package at front door", "created_at": "2025-03-31T09:40:58.000000Z", "updated_at": "2025-03-31T09:42:03.000000Z", "meta": { "source": "cart", "item_81_name": "Main product 2", "subtotal": "168", "source_cart_id": "user_1", "created_at": "2025-03-31 09:41:01" } } }
31 March 2025