From 6b4eaeececf7d664086e69a954e3d3a313369f8d Mon Sep 17 00:00:00 2001 From: NathanFallet Date: Wed, 28 Oct 2026 17:05:54 +0100 Subject: [PATCH 1/2] Regenerate the SDK: optional scheduledAt on publish, price drop and republish Regenerated from the production OpenAPI document (sha256 06a7c92e...), which now carries an optional scheduledAt on POST /items/{id}/publish, /price-drop and /republish (backend#1664, domain#1828, API-015). Adds a test per SDK that sends scheduledAt on the three calls, and the README shows it. Co-Authored-By: Claude Sonnet 5.5 --- .spec-sha256 | 2 +- README.md | 3 +++ Sources/ControlResell/Generated/Client.swift | 6 ++--- .../Generated/Types+Components+Schemas.swift | 24 +++++++++++++++--- .../Generated/Types+Operations.swift | 10 ++++---- Sources/ControlResell/Generated/Types.swift | 12 ++++----- .../ControlResellTests.swift | 25 +++++++++++++++++++ 7 files changed, 64 insertions(+), 18 deletions(-) diff --git a/.spec-sha256 b/.spec-sha256 index 48e58f3..ebd3a33 100644 --- a/.spec-sha256 +++ b/.spec-sha256 @@ -1 +1 @@ -abca177b38fbfab3c7f757398c7546d27f97f2858b4acc96421dae669862c0c8 +06a7c92e23df7c44f8898a2b18abec43aa5c14b8f12ea10e1ce65a94a14a0fb4 diff --git a/README.md b/README.md index b01e995..c113af3 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,9 @@ for try await order in controlResell.allOrders(bucket: "to_send") { print(order. // Writes (API key with `items:write` / `conversations:write`). let item = try await controlResell.call { try await $0.createItem(.init(body: .json(.init(name: "Jacket")))).created.body.json } _ = try await controlResell.call { try await $0.publishItem(.init(path: .init(id: item.id), body: .json(.init(accountIds: [accountId])))).ok } +// publishItem, dropItemPrice and republishItem take an optional `scheduledAt` (a Date, at most 30 days ahead): the action starts then +// instead of now, and the 202 receipt carries the date. +_ = try await controlResell.call { try await $0.republishItem(.init(path: .init(id: item.id), body: .json(.init(scheduledAt: Date().addingTimeInterval(86_400))))).accepted } // Webhooks (`webhooks:read` / `webhooks:write`); allWebhookEvents catches up the last 7 days. for try await event in controlResell.allWebhookEvents(type: "item.sold") { print(event._type) } diff --git a/Sources/ControlResell/Generated/Client.swift b/Sources/ControlResell/Generated/Client.swift index 12262ac..e1451d8 100644 --- a/Sources/ControlResell/Generated/Client.swift +++ b/Sources/ControlResell/Generated/Client.swift @@ -2434,7 +2434,7 @@ public struct Client: APIProtocol { } /// Publish an item on the seller's accounts /// - /// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now. The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. + /// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now or at `scheduledAt` (at most 30 days ahead). The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. /// /// - Remark: HTTP `POST /api/public/v1/items/{id}/publish`. /// - Remark: Generated from `#/paths//api/public/v1/items/{id}/publish/post(publishItem)`. @@ -2744,7 +2744,7 @@ public struct Client: APIProtocol { } /// Lower the price of an item's listings /// - /// Schedules a price drop of the item's existing listings, now, like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. + /// Schedules a price drop of the item's existing listings, now or at `scheduledAt` (at most 30 days ahead), like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. /// /// - Remark: HTTP `POST /api/public/v1/items/{id}/price-drop`. /// - Remark: Generated from `#/paths//api/public/v1/items/{id}/price-drop/post(dropItemPrice)`. @@ -3054,7 +3054,7 @@ public struct Client: APIProtocol { } /// Republish an item on the seller's accounts /// - /// Schedules the republication of one item of the seller's stock, now, exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. + /// Schedules the republication of one item of the seller's stock, now or at `scheduledAt` (at most 30 days ahead), exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. /// /// This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace ("list it on eBay"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. /// diff --git a/Sources/ControlResell/Generated/Types+Components+Schemas.swift b/Sources/ControlResell/Generated/Types+Components+Schemas.swift index fe53ee7..a76356e 100644 --- a/Sources/ControlResell/Generated/Types+Components+Schemas.swift +++ b/Sources/ControlResell/Generated/Types+Components+Schemas.swift @@ -779,21 +779,27 @@ extension Components { public var accountIds: [Swift.String] /// - Remark: Generated from `#/components/schemas/PublishRequest/cancelBeforeProceeding`. public var cancelBeforeProceeding: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/PublishRequest/scheduledAt`. + public var scheduledAt: Foundation.Date? /// Creates a new `PublishRequest`. /// /// - Parameters: /// - accountIds: /// - cancelBeforeProceeding: + /// - scheduledAt: public init( accountIds: [Swift.String], - cancelBeforeProceeding: Swift.Bool? = nil + cancelBeforeProceeding: Swift.Bool? = nil, + scheduledAt: Foundation.Date? = nil ) { self.accountIds = accountIds self.cancelBeforeProceeding = cancelBeforeProceeding + self.scheduledAt = scheduledAt } public enum CodingKeys: String, CodingKey { case accountIds case cancelBeforeProceeding + case scheduledAt } } /// - Remark: Generated from `#/components/schemas/ScheduledAction`. @@ -843,6 +849,8 @@ extension Components { public var roundStep: Swift.String? /// - Remark: Generated from `#/components/schemas/PriceDropRequest/accountIds`. public var accountIds: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/PriceDropRequest/scheduledAt`. + public var scheduledAt: Foundation.Date? /// Creates a new `PriceDropRequest`. /// /// - Parameters: @@ -851,18 +859,21 @@ extension Components { /// - roundType: /// - roundStep: /// - accountIds: + /// - scheduledAt: public init( _type: Swift.String, value: Swift.String, roundType: Swift.String? = nil, roundStep: Swift.String? = nil, - accountIds: [Swift.String]? = nil + accountIds: [Swift.String]? = nil, + scheduledAt: Foundation.Date? = nil ) { self._type = _type self.value = value self.roundType = roundType self.roundStep = roundStep self.accountIds = accountIds + self.scheduledAt = scheduledAt } public enum CodingKeys: String, CodingKey { case _type = "type" @@ -870,6 +881,7 @@ extension Components { case roundType case roundStep case accountIds + case scheduledAt } } /// - Remark: Generated from `#/components/schemas/RepublishRequest`. @@ -882,6 +894,8 @@ extension Components { public var priceVariation: Swift.String? /// - Remark: Generated from `#/components/schemas/RepublishRequest/allowIfDeleted`. public var allowIfDeleted: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/RepublishRequest/scheduledAt`. + public var scheduledAt: Foundation.Date? /// Creates a new `RepublishRequest`. /// /// - Parameters: @@ -889,22 +903,26 @@ extension Components { /// - priceDrop: /// - priceVariation: /// - allowIfDeleted: + /// - scheduledAt: public init( accountIds: [Swift.String]? = nil, priceDrop: Components.Schemas.PriceDropRequest? = nil, priceVariation: Swift.String? = nil, - allowIfDeleted: Swift.Bool? = nil + allowIfDeleted: Swift.Bool? = nil, + scheduledAt: Foundation.Date? = nil ) { self.accountIds = accountIds self.priceDrop = priceDrop self.priceVariation = priceVariation self.allowIfDeleted = allowIfDeleted + self.scheduledAt = scheduledAt } public enum CodingKeys: String, CodingKey { case accountIds case priceDrop case priceVariation case allowIfDeleted + case scheduledAt } } /// - Remark: Generated from `#/components/schemas/ItemUpdateRequest`. diff --git a/Sources/ControlResell/Generated/Types+Operations.swift b/Sources/ControlResell/Generated/Types+Operations.swift index fb75bd6..ec03b88 100644 --- a/Sources/ControlResell/Generated/Types+Operations.swift +++ b/Sources/ControlResell/Generated/Types+Operations.swift @@ -5365,7 +5365,7 @@ public enum Operations { } /// Publish an item on the seller's accounts /// - /// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now. The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. + /// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now or at `scheduledAt` (at most 30 days ahead). The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. /// /// - Remark: HTTP `POST /api/public/v1/items/{id}/publish`. /// - Remark: Generated from `#/paths//api/public/v1/items/{id}/publish/post(publishItem)`. @@ -5450,7 +5450,7 @@ public enum Operations { self.body = body } } - /// The publication is scheduled on every account of the request. + /// The publication is scheduled on every account of the request, at `scheduledAt`. /// /// - Remark: Generated from `#/paths//api/public/v1/items/{id}/publish/post(publishItem)/responses/202`. /// @@ -6063,7 +6063,7 @@ public enum Operations { } /// Lower the price of an item's listings /// - /// Schedules a price drop of the item's existing listings, now, like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. + /// Schedules a price drop of the item's existing listings, now or at `scheduledAt` (at most 30 days ahead), like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. /// /// - Remark: HTTP `POST /api/public/v1/items/{id}/price-drop`. /// - Remark: Generated from `#/paths//api/public/v1/items/{id}/price-drop/post(dropItemPrice)`. @@ -6148,7 +6148,7 @@ public enum Operations { self.body = body } } - /// The price drop is scheduled on every account named. + /// The price drop is scheduled on every account named, at `scheduledAt`. /// /// - Remark: Generated from `#/paths//api/public/v1/items/{id}/price-drop/post(dropItemPrice)/responses/202`. /// @@ -6761,7 +6761,7 @@ public enum Operations { } /// Republish an item on the seller's accounts /// - /// Schedules the republication of one item of the seller's stock, now, exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. + /// Schedules the republication of one item of the seller's stock, now or at `scheduledAt` (at most 30 days ahead), exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. /// /// This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace ("list it on eBay"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. /// diff --git a/Sources/ControlResell/Generated/Types.swift b/Sources/ControlResell/Generated/Types.swift index 0d3a134..c0c5c9e 100644 --- a/Sources/ControlResell/Generated/Types.swift +++ b/Sources/ControlResell/Generated/Types.swift @@ -89,21 +89,21 @@ public protocol APIProtocol: Sendable { func listItemFavorites(_ input: Operations.ListItemFavorites.Input) async throws -> Operations.ListItemFavorites.Output /// Publish an item on the seller's accounts /// - /// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now. The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. + /// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now or at `scheduledAt` (at most 30 days ahead). The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. /// /// - Remark: HTTP `POST /api/public/v1/items/{id}/publish`. /// - Remark: Generated from `#/paths//api/public/v1/items/{id}/publish/post(publishItem)`. func publishItem(_ input: Operations.PublishItem.Input) async throws -> Operations.PublishItem.Output /// Lower the price of an item's listings /// - /// Schedules a price drop of the item's existing listings, now, like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. + /// Schedules a price drop of the item's existing listings, now or at `scheduledAt` (at most 30 days ahead), like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. /// /// - Remark: HTTP `POST /api/public/v1/items/{id}/price-drop`. /// - Remark: Generated from `#/paths//api/public/v1/items/{id}/price-drop/post(dropItemPrice)`. func dropItemPrice(_ input: Operations.DropItemPrice.Input) async throws -> Operations.DropItemPrice.Output /// Republish an item on the seller's accounts /// - /// Schedules the republication of one item of the seller's stock, now, exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. + /// Schedules the republication of one item of the seller's stock, now or at `scheduledAt` (at most 30 days ahead), exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. /// /// This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace ("list it on eBay"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. /// @@ -502,7 +502,7 @@ extension APIProtocol { } /// Publish an item on the seller's accounts /// - /// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now. The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. + /// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now or at `scheduledAt` (at most 30 days ahead). The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. /// /// - Remark: HTTP `POST /api/public/v1/items/{id}/publish`. /// - Remark: Generated from `#/paths//api/public/v1/items/{id}/publish/post(publishItem)`. @@ -519,7 +519,7 @@ extension APIProtocol { } /// Lower the price of an item's listings /// - /// Schedules a price drop of the item's existing listings, now, like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. + /// Schedules a price drop of the item's existing listings, now or at `scheduledAt` (at most 30 days ahead), like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. /// /// - Remark: HTTP `POST /api/public/v1/items/{id}/price-drop`. /// - Remark: Generated from `#/paths//api/public/v1/items/{id}/price-drop/post(dropItemPrice)`. @@ -536,7 +536,7 @@ extension APIProtocol { } /// Republish an item on the seller's accounts /// - /// Schedules the republication of one item of the seller's stock, now, exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. + /// Schedules the republication of one item of the seller's stock, now or at `scheduledAt` (at most 30 days ahead), exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. /// /// This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace ("list it on eBay"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. /// diff --git a/Tests/ControlResellTests/ControlResellTests.swift b/Tests/ControlResellTests/ControlResellTests.swift index 6fe2598..3fb1dfc 100644 --- a/Tests/ControlResellTests/ControlResellTests.swift +++ b/Tests/ControlResellTests/ControlResellTests.swift @@ -18,6 +18,31 @@ struct ControlResellTests { #expect(request.header("Idempotency-Key") == nil) } + @Test func publishPriceDropAndRepublishCarryScheduledAt() async throws { + let receipt = "{\"itemId\":7,\"action\":\"publish\",\"accountIds\":[\"3f2c1c0e-5b7a-4a3e-9d1e-0a1b2c3d4e5f\"],\"scheduledAt\":\"2026-11-01T09:30:00Z\"}" + let (client, transport, _) = try makeClient { _ in json(receipt, status: 202) } + let at = Date(timeIntervalSince1970: 1_793_525_400) // 2026-11-01T09:30:00Z + let account = "3f2c1c0e-5b7a-4a3e-9d1e-0a1b2c3d4e5f" + + let published = try await client.call { + try await $0.publishItem(.init(path: .init(id: 7), body: .json(.init(accountIds: [account], scheduledAt: at)))).accepted.body.json + } + _ = try await client.call { + try await $0.dropItemPrice(.init(path: .init(id: 7), body: .json(.init(_type: "percent", value: "10", scheduledAt: at)))).accepted + } + _ = try await client.call { + try await $0.republishItem(.init(path: .init(id: 7), body: .json(.init(scheduledAt: at)))).accepted + } + + #expect(published.scheduledAt == at) + #expect(transport.requests.count == 3) + for request in transport.requests { + let body = try #require(JSONSerialization.jsonObject(with: Data(request.body.utf8)) as? [String: Any]) + let sent = try #require(body["scheduledAt"] as? String) + #expect(ISO8601DateFormatter().date(from: sent) == at) + } + } + @Test func theKeyComesFromTheEnvironmentWhenNoneIsGivenAndIsRequired() throws { let previous = ProcessInfo.processInfo.environment["CONTROLRESELL_API_KEY"] defer { if let previous { setenv("CONTROLRESELL_API_KEY", previous, 1) } else { unsetenv("CONTROLRESELL_API_KEY") } } From 9d44dc493aeaf51b89c42a848f606a10cc44dd15 Mon Sep 17 00:00:00 2001 From: NathanFallet Date: Wed, 28 Oct 2026 17:07:55 +0100 Subject: [PATCH 2/2] Show scheduledAt on the publish example in the README A just-created item cannot be republished, so the README example now schedules the publication itself. PHP test also checks the route, method and date format. Co-Authored-By: Claude Sonnet 5.5 --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c113af3..38152af 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,9 @@ for try await order in controlResell.allOrders(bucket: "to_send") { print(order. // Writes (API key with `items:write` / `conversations:write`). let item = try await controlResell.call { try await $0.createItem(.init(body: .json(.init(name: "Jacket")))).created.body.json } -_ = try await controlResell.call { try await $0.publishItem(.init(path: .init(id: item.id), body: .json(.init(accountIds: [accountId])))).ok } // publishItem, dropItemPrice and republishItem take an optional `scheduledAt` (a Date, at most 30 days ahead): the action starts then -// instead of now, and the 202 receipt carries the date. -_ = try await controlResell.call { try await $0.republishItem(.init(path: .init(id: item.id), body: .json(.init(scheduledAt: Date().addingTimeInterval(86_400))))).accepted } +// instead of now (tomorrow here), and the 202 receipt (`.accepted`) carries the date. +_ = try await controlResell.call { try await $0.publishItem(.init(path: .init(id: item.id), body: .json(.init(accountIds: [accountId], scheduledAt: Date().addingTimeInterval(86_400))))).accepted } // Webhooks (`webhooks:read` / `webhooks:write`); allWebhookEvents catches up the last 7 days. for try await event in controlResell.allWebhookEvents(type: "item.sold") { print(event._type) }