/products/physical/update/{uuid}
| 1 | const response = await fetch("https://api.tamio.com/v2/products/physical/update/{uuid}", { |
| 2 | method: "POST", |
| 3 | headers: { |
| 4 | "Authorization": "Bearer YOUR_API_KEY", |
| 5 | "Content-Type": "application/json" |
| 6 | }, |
| 7 | body: JSON.stringify({ |
| 8 | "tax_category": "123e4567-e89b-12d3-a456-426614174000", |
| 9 | "languages": "...", |
| 10 | "pricing_model": [ |
| 11 | { |
| 12 | "id": "660e8400-e29b-41d4-a716-446655440001", |
| 13 | "currency": "EUR", |
| 14 | "price": 2999, |
| 15 | "acquisition_price": 1200, |
| 16 | "recommended_seller_price": 3499, |
| 17 | "billing_cycle": "month", |
| 18 | "interval": 1 |
| 19 | } |
| 20 | ], |
| 21 | "stock": 100, |
| 22 | "unlimited_stock": false, |
| 23 | "stock_limit_warning": 10, |
| 24 | "min_units": 1, |
| 25 | "max_units": 50, |
| 26 | "weight": 1.5, |
| 27 | "net_weight": 1.2, |
| 28 | "dimensions": { |
| 29 | "height": 0, |
| 30 | "width": 0, |
| 31 | "length": 0 |
| 32 | }, |
| 33 | "on_sale": false, |
| 34 | "buyable": true, |
| 35 | "shown": true, |
| 36 | "sample": false, |
| 37 | "discount_allowed": true, |
| 38 | "reviews_allowed": true, |
| 39 | "exclude_from_feed": false, |
| 40 | "hide_if_no_stock": true, |
| 41 | "allow_negative_stock": false, |
| 42 | "whitelist": [], |
| 43 | "google_category": 0, |
| 44 | "release_date": "string", |
| 45 | "expiry_date": "string", |
| 46 | "new_from": "string", |
| 47 | "new_to": "string", |
| 48 | "sku": "string", |
| 49 | "ean": "string", |
| 50 | "upc": "string", |
| 51 | "isbn": "string", |
| 52 | "gtin": "string", |
| 53 | "mpn": "string", |
| 54 | "asin": "string", |
| 55 | "hscode": "string", |
| 56 | "brand": "string", |
| 57 | "model": "string", |
| 58 | "condition": "new", |
| 59 | "packaging_type": "box", |
| 60 | "country_of_origin": "string", |
| 61 | "related_products": [], |
| 62 | "gallery": [], |
| 63 | "variations": {}, |
| 64 | "custom_fields": [ |
| 65 | { |
| 66 | "language": "string", |
| 67 | "name": "string", |
| 68 | "type": "dropdown", |
| 69 | "required": false, |
| 70 | "values": [], |
| 71 | "range_from": "string", |
| 72 | "range_to": "string" |
| 73 | } |
| 74 | ], |
| 75 | "custom_attributes": [ |
| 76 | { |
| 77 | "id": "00000000-0000-0000-0000-000000000000", |
| 78 | "values": { |
| 79 | "text": {}, |
| 80 | "link": {}, |
| 81 | "image": "00000000-0000-0000-0000-000000000000" |
| 82 | } |
| 83 | } |
| 84 | ], |
| 85 | "stock_breakdown": [ |
| 86 | { |
| 87 | "warehouse": "00000000-0000-0000-0000-000000000000", |
| 88 | "stock": 0 |
| 89 | } |
| 90 | ], |
| 91 | "packs": [ |
| 92 | { |
| 93 | "label": {}, |
| 94 | "stock": 0, |
| 95 | "multiples": false |
| 96 | } |
| 97 | ] |
| 98 | }) |
| 99 | }); |
| 100 | const data = await response.json(); |
| 1 | require "uri" |
| 2 | require "net/http" |
| 3 | require "json" |
| 4 | |
| 5 | url = URI("https://api.tamio.com/v2/products/physical/update/{uuid}") |
| 6 | |
| 7 | https = Net::HTTP.new(url.host, url.port) |
| 8 | https.use_ssl = true |
| 9 | |
| 10 | request = Net::HTTP::Post.new(url) |
| 11 | request["Accept"] = "application/json" |
| 12 | request["Authorization"] = "Bearer YOUR_API_KEY" |
| 13 | request["Content-Type"] = "application/json" |
| 14 | request.body = { |
| 15 | tax_category: "123e4567-e89b-12d3-a456-426614174000", |
| 16 | languages: "...", |
| 17 | pricing_model: [ |
| 18 | { |
| 19 | id: "660e8400-e29b-41d4-a716-446655440001", |
| 20 | currency: "EUR", |
| 21 | price: 2999, |
| 22 | acquisition_price: 1200, |
| 23 | recommended_seller_price: 3499, |
| 24 | billing_cycle: "month", |
| 25 | interval: 1 |
| 26 | } |
| 27 | ], |
| 28 | stock: 100, |
| 29 | unlimited_stock: false, |
| 30 | stock_limit_warning: 10, |
| 31 | min_units: 1, |
| 32 | max_units: 50, |
| 33 | weight: 1.5, |
| 34 | net_weight: 1.2, |
| 35 | dimensions: { |
| 36 | height: 0, |
| 37 | width: 0, |
| 38 | length: 0 |
| 39 | }, |
| 40 | on_sale: false, |
| 41 | buyable: true, |
| 42 | shown: true, |
| 43 | sample: false, |
| 44 | discount_allowed: true, |
| 45 | reviews_allowed: true, |
| 46 | exclude_from_feed: false, |
| 47 | hide_if_no_stock: true, |
| 48 | allow_negative_stock: false, |
| 49 | whitelist: [], |
| 50 | google_category: 0, |
| 51 | release_date: "string", |
| 52 | expiry_date: "string", |
| 53 | new_from: "string", |
| 54 | new_to: "string", |
| 55 | sku: "string", |
| 56 | ean: "string", |
| 57 | upc: "string", |
| 58 | isbn: "string", |
| 59 | gtin: "string", |
| 60 | mpn: "string", |
| 61 | asin: "string", |
| 62 | hscode: "string", |
| 63 | brand: "string", |
| 64 | model: "string", |
| 65 | condition: "new", |
| 66 | packaging_type: "box", |
| 67 | country_of_origin: "string", |
| 68 | related_products: [], |
| 69 | gallery: [], |
| 70 | variations: {}, |
| 71 | custom_fields: [ |
| 72 | { |
| 73 | language: "string", |
| 74 | name: "string", |
| 75 | type: "dropdown", |
| 76 | required: false, |
| 77 | values: [], |
| 78 | range_from: "string", |
| 79 | range_to: "string" |
| 80 | } |
| 81 | ], |
| 82 | custom_attributes: [ |
| 83 | { |
| 84 | id: "00000000-0000-0000-0000-000000000000", |
| 85 | values: { |
| 86 | text: {}, |
| 87 | link: {}, |
| 88 | image: "00000000-0000-0000-0000-000000000000" |
| 89 | } |
| 90 | } |
| 91 | ], |
| 92 | stock_breakdown: [ |
| 93 | { |
| 94 | warehouse: "00000000-0000-0000-0000-000000000000", |
| 95 | stock: 0 |
| 96 | } |
| 97 | ], |
| 98 | packs: [ |
| 99 | { |
| 100 | label: {}, |
| 101 | stock: 0, |
| 102 | multiples: false |
| 103 | } |
| 104 | ] |
| 105 | }.to_json |
| 106 | |
| 107 | response = https.request(request) |
| 108 | puts response.read_body |
Responses
{
"status": 200,
"product": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"object": "product",
"name": "Premium Widget",
"description": "High-quality premium widget with advanced features",
"seo_title": "Premium Widget | Buy Online",
"seo_description": "Shop the Premium Widget — built to last with advanced features.",
"classification": "Tangible Goods",
"is_moss_product": false,
"created": 1700000000,
"updated_unix": 1700100000,
"currency": "EUR",
"type": "physical_product",
"pricing_model": [
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"currency": "EUR",
"price": 2999,
"acquisition_price": 1200,
"recommended_seller_price": 3499,
"billing_cycle": "month",
"interval": 1
}
],
"price": 2999,
"stock": 150,
"has_variations": true,
"has_notes": false,
"sample": false,
"release_date": "2024-06-01T00:00:00Z",
"release_date_unix": 1717200000,
"expiry_date": "2025-12-31T23:59:59Z",
"expiry_date_unix": 1767225599,
"new_from": "2024-06-01T00:00:00Z",
"new_from_unix": 1717200000,
"new_to": "2024-09-01T00:00:00Z",
"new_to_unix": 1725148800,
"exclude_from_feed": false,
"google_category": 5322,
"in_stock": true,
"unlimited_stock": false,
"min_units": 1,
"max_units": 100,
"stock_limit_warning": 10,
"allow_negative_stock": false,
"on_sale": true,
"discount_allowed": true,
"reviews_allowed": true,
"hide_if_no_stock": false,
"shown": true,
"buyable": true,
"custom_fields": [],
"whitelist": [
"[email protected]"
],
"additional_information": {
"brand": "WidgetCorp",
"model": "WX-3000",
"asin": "B09V3KXJPB",
"upc": "012345678905",
"mpn": "WX3K-BLK",
"isbn": "978-3-16-148410-0",
"ean": "4006381333931",
"gtin": "00012345678905",
"sku": "WDG-PRM-001",
"hscode": "8471.30",
"condition": "new",
"country_of_origin": "DE",
"packaging_type": "box",
"detailed_description": "string",
"nshift_parcel_amount": 1,
"nshift_quick_id": "string",
"parcels": {}
},
"weight": 2.5,
"net_weight": 2.1,
"dimensions": {
"length": 30,
"width": 20,
"height": 10
},
"packs": [
{
"id": "770e8400-e29b-41d4-a716-446655440002",
"label": {
"en": "6-Pack",
"de": "6er-Pack"
},
"stock": 50,
"multiples": true
}
],
"stock_breakdown": [
{
"warehouse": "880e8400-e29b-41d4-a716-446655440003",
"stock": 75
}
],
"delivery_type": "file",
"license_type": "autogenerated",
"delivery_url": "https://downloads.example.com/premium-widget",
"number_of_downloads": 5,
"licenses": [
"XXXX-YYYY-ZZZZ-1111",
"XXXX-YYYY-ZZZZ-2222"
],
"digital_files": [],
"billing_cycle": "month",
"interval": 1,
"trial_period": 14,
"descriptor": "ACME PREMIUM",
"retries": 2,
"cancel_action": "cancel",
"cancel_behaviour": "end_of_period",
"has_stripe_price": true,
"charge_shipping_during_trial": false,
"is_customer_product": false,
"clients": [
{
"id": "990e8400-e29b-41d4-a716-446655440004",
"name": "Acme Corp",
"email": "[email protected]"
}
],
"gallery": [
{
"public_url": "https://pub.ox31.com/uploads/product-image-abc123.jpg",
"alt_text": "Premium Widget front view",
"asset_id": "aa0e8400-e29b-41d4-a716-446655440005"
}
],
"has_image": true,
"languages": {
"en": {
"title": "Premium Widget",
"description": "High-quality premium widget",
"slug": "premium-widget"
},
"de": {
"title": "Premium-Widget",
"description": "Hochwertiges Premium-Widget",
"slug": "premium-widget"
}
},
"variations": {
"options": [
{
"name": "Size",
"values": [
"Small",
"Medium",
"Large"
]
}
],
"variants": [
{
"id": "bb0e8400-e29b-41d4-a716-446655440006",
"stock": 25,
"options": {
"en": {
"size": "Large",
"color": "Blue"
}
},
"stock_breakdown": []
}
]
},
"invoices": 342,
"customers": 198,
"subscriptions": 45,
"lifetime_revenue": 1025000,
"related_products": [
"cc0e8400-e29b-41d4-a716-446655440007",
"dd0e8400-e29b-41d4-a716-446655440008"
]
}
}