{"openapi":"3.1.0","info":{"title":"Throttle Commerce API","description":"Managed commerce API and event system. Handles order lifecycle, customer identity, payments (manual), fulfillments, subscriptions, discounts, and webhook delivery.","version":"0.1.0"},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"X-API-Key","in":"header","description":"API key for server-to-server authentication"},"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{},"parameters":{"EnvironmentIdHeader":{"name":"X-Throttle-Environment-Id","in":"header","required":false,"schema":{"type":"string","format":"uuid"},"description":"Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment."}}},"paths":{"/health":{"get":{"responses":{"200":{"description":"Default Response"}}}},"/ready":{"get":{"responses":{"200":{"description":"Default Response"}}}},"/internal/sentry-smoke":{"get":{"responses":{"200":{"description":"Default Response"}}}},"/unsubscribe":{"get":{"responses":{"200":{"description":"Default Response"}}}},"/unsubscribe/apply":{"post":{"responses":{"200":{"description":"Default Response"}}}},"/api/v1/organizations":{"post":{"tags":["Organizations"],"description":"Create an organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","slug"],"properties":{"name":{"type":"string"},"slug":{"type":"string","pattern":"^[a-z0-9-]+$"},"settings":{"type":"object"}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"tags":["Organizations"],"description":"List organizations","responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/organizations/{id}":{"get":{"tags":["Organizations"],"description":"Get organization by ID","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"tags":["Organizations"],"description":"Update an organization","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/stores":{"post":{"tags":["Stores"],"description":"Create a new store under the organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","slug"],"properties":{"name":{"type":"string"},"slug":{"type":"string","pattern":"^[a-z0-9-]+$","description":"URL-safe identifier, unique per organization"},"currency":{"type":"string","default":"USD","description":"ISO 4217 currency code"},"settings":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"currency":{"type":"string","description":"ISO 4217 currency code"},"settings":{"type":"object","additionalProperties":true},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"tags":["Stores"],"description":"List all stores for the organization","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"currency":{"type":"string","description":"ISO 4217 currency code"},"settings":{"type":"object","additionalProperties":true},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/stores/{id}":{"get":{"tags":["Stores"],"description":"Get a store by ID","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"currency":{"type":"string","description":"ISO 4217 currency code"},"settings":{"type":"object","additionalProperties":true},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"patch":{"tags":["Stores"],"description":"Update a store (name, currency, settings, active status)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"currency":{"type":"string","description":"ISO 4217 currency code"},"settings":{"type":"object","additionalProperties":true},"isActive":{"type":"boolean","description":"Deactivate a store without deleting it"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"currency":{"type":"string","description":"ISO 4217 currency code"},"settings":{"type":"object","additionalProperties":true},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/customers":{"post":{"tags":["Customers"],"description":"Create a new customer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"applicationId":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"externalId":{"type":"string","nullable":true},"firstName":{"type":"string"},"lastName":{"type":"string"},"phone":{"type":"string"},"acceptsMarketing":{"type":"boolean","default":false},"netN":{"type":"integer","minimum":1,"maximum":365,"nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"email":{"type":"string","format":"email"},"externalId":{"type":"string","nullable":true},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"acceptsMarketing":{"type":"boolean"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"tags":["Customers"],"description":"List customers with cursor pagination","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Cursor for pagination (last item ID)"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false,"description":"Number of items per page"},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"applicationId","required":false},{"schema":{"type":"string","format":"email"},"in":"query","name":"email","required":false},{"schema":{"type":"string","enum":["linked","unlinked"]},"in":"query","name":"identity","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false,"description":"Search email, name, phone, external ids, or metadata."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"email":{"type":"string","format":"email"},"externalId":{"type":"string","nullable":true},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"acceptsMarketing":{"type":"boolean"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/customers/{id}":{"get":{"tags":["Customers"],"description":"Get a customer by ID","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"email":{"type":"string","format":"email"},"externalId":{"type":"string","nullable":true},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"acceptsMarketing":{"type":"boolean"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"patch":{"tags":["Customers"],"description":"Update a customer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"externalId":{"type":"string","nullable":true},"firstName":{"type":"string"},"lastName":{"type":"string"},"phone":{"type":"string"},"acceptsMarketing":{"type":"boolean"},"netN":{"type":"integer","minimum":1,"maximum":365,"nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"email":{"type":"string","format":"email"},"externalId":{"type":"string","nullable":true},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"acceptsMarketing":{"type":"boolean"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"delete":{"tags":["Customers"],"description":"Delete a customer","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Customer deleted"},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/customers/by-external/{externalId}":{"get":{"tags":["Customers"],"description":"Look up a customer by the merchant's own externalId (set when the customer was created). Useful for merchant backends that key their user table off their own IDs and don't store the throttle customerId.","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"externalId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/customers/{id}/addresses":{"get":{"tags":["Customers"],"description":"List addresses for a customer","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2"},"phone":{"type":"string"},"id":{"type":"string","format":"uuid"},"isDefault":{"type":"boolean"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}},"post":{"tags":["Customers"],"description":"Add an address to a customer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["addressLine1","city","countryCode"],"properties":{"label":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2"},"phone":{"type":"string"},"isDefault":{"type":"boolean","default":false},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"label":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2"},"phone":{"type":"string"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/customers/{customerId}/addresses/{id}":{"patch":{"tags":["Customers"],"description":"Update a customer address","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2"},"phone":{"type":"string"},"isDefault":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"customerId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"label":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2"},"phone":{"type":"string"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"delete":{"tags":["Customers"],"description":"Delete a customer address","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"customerId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Address deleted"},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/customers/{id}/payment-methods":{"get":{"tags":["Customers"],"description":"List payment methods for a customer","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"processor":{"type":"string"},"methodType":{"type":"string","enum":["card","bank_account","wallet"]},"cardBrand":{"type":"string","nullable":true},"cardLastFour":{"type":"string","nullable":true},"cardExpMonth":{"type":"integer","nullable":true},"cardExpYear":{"type":"integer","nullable":true},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}},"post":{"tags":["Customers"],"description":"Add a payment method to a customer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["processor","processorToken","methodType"],"properties":{"processor":{"type":"string"},"processorToken":{"type":"string"},"methodType":{"type":"string","enum":["card","bank_account","wallet"]},"cardBrand":{"type":"string"},"cardLastFour":{"type":"string"},"cardExpMonth":{"type":"integer"},"cardExpYear":{"type":"integer"},"isDefault":{"type":"boolean","default":false},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"processor":{"type":"string"},"methodType":{"type":"string","enum":["card","bank_account","wallet"]},"cardBrand":{"type":"string","nullable":true},"cardLastFour":{"type":"string","nullable":true},"cardExpMonth":{"type":"integer","nullable":true},"cardExpYear":{"type":"integer","nullable":true},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/customers/{customerId}/payment-methods/{id}":{"get":{"tags":["Customers"],"description":"Get a customer payment method","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"customerId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"processor":{"type":"string"},"methodType":{"type":"string","enum":["card","bank_account","wallet"]},"cardBrand":{"type":"string","nullable":true},"cardLastFour":{"type":"string","nullable":true},"cardExpMonth":{"type":"integer","nullable":true},"cardExpYear":{"type":"integer","nullable":true},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"patch":{"tags":["Customers"],"description":"Update a customer payment method","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"isDefault":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"customerId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"processor":{"type":"string"},"methodType":{"type":"string","enum":["card","bank_account","wallet"]},"cardBrand":{"type":"string","nullable":true},"cardLastFour":{"type":"string","nullable":true},"cardExpMonth":{"type":"integer","nullable":true},"cardExpYear":{"type":"integer","nullable":true},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"delete":{"tags":["Customers"],"description":"Delete a customer payment method","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"customerId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Payment method deleted"},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/customers/{customerId}/payment-methods/{id}/pause":{"post":{"tags":["Customers"],"description":"Pause a customer payment method","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"customerId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/customers/{customerId}/payment-methods/{id}/resume":{"post":{"tags":["Customers"],"description":"Resume a customer payment method","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"customerId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/payment-methods/client-token":{"post":{"summary":"Mint a customer-scoped client token for browser payment-method management","tags":["Payment Methods"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId"],"additionalProperties":false,"properties":{"customerId":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/me/payment-methods":{"get":{"summary":"List the authenticated customer's saved payment methods","tags":["Payment Methods"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/me/payment-methods/{id}":{"patch":{"summary":"Set a saved payment method as default","tags":["Payment Methods"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["isDefault"],"additionalProperties":false,"properties":{"isDefault":{"type":"boolean","enum":[true]}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Remove a saved payment method","tags":["Payment Methods"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/me/payment-methods/embed-token":{"post":{"summary":"Mint a Gr4vy add-only vault embed token scoped to the authenticated customer","tags":["Payment Methods"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","nullable":true,"additionalProperties":false,"properties":{"currency":{"type":"string","minLength":3,"maxLength":3}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/me/payment-methods/confirm":{"post":{"summary":"Record a card vaulted via the add-card embed","tags":["Payment Methods"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["transactionId"],"additionalProperties":false,"properties":{"transactionId":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/carts":{"post":{"tags":["Carts"],"description":"Create a new cart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"applicationId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"customerEmail":{"type":"string","format":"email"},"currency":{"type":"string","default":"USD"},"netN":{"type":"integer","minimum":1,"maximum":365,"nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"customerId":{"type":"string","format":"uuid","nullable":true},"customerEmail":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","checkout","converted","abandoned"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"billingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"shippingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"discountCode":{"type":"string","nullable":true},"appliedDiscount":{"anyOf":[{"type":"object","properties":{"discountId":{"type":"string","format":"uuid","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"freeShipping":{"type":"boolean"},"validUntil":{"type":"string","format":"date-time","nullable":true},"snapshotHash":{"type":"string"}}},{"type":"null"}]},"selectedShipping":{"anyOf":[{"type":"object","properties":{"methodId":{"type":"string"},"displayName":{"type":"string"},"rateAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"carrier":{"type":"string"},"serviceCode":{"type":"string"},"estimatedDeliveryDays":{"type":"integer"}}},{"type":"null"}]},"taxLines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lineItemId":{"type":"string","format":"uuid"},"jurisdictionCode":{"type":"string"},"jurisdictionName":{"type":"string","nullable":true},"taxType":{"type":"string"},"rate":{"type":"number"},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string","nullable":true}}}},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/carts/{id}":{"get":{"tags":["Carts"],"description":"Get a cart by ID (includes line items)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"customerId":{"type":"string","format":"uuid","nullable":true},"customerEmail":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","checkout","converted","abandoned"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"billingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"shippingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"discountCode":{"type":"string","nullable":true},"appliedDiscount":{"anyOf":[{"type":"object","properties":{"discountId":{"type":"string","format":"uuid","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"freeShipping":{"type":"boolean"},"validUntil":{"type":"string","format":"date-time","nullable":true},"snapshotHash":{"type":"string"}}},{"type":"null"}]},"selectedShipping":{"anyOf":[{"type":"object","properties":{"methodId":{"type":"string"},"displayName":{"type":"string"},"rateAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"carrier":{"type":"string"},"serviceCode":{"type":"string"},"estimatedDeliveryDays":{"type":"integer"}}},{"type":"null"}]},"taxLines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lineItemId":{"type":"string","format":"uuid"},"jurisdictionCode":{"type":"string"},"jurisdictionName":{"type":"string","nullable":true},"taxType":{"type":"string"},"rate":{"type":"number"},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string","nullable":true}}}},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"patch":{"tags":["Carts"],"description":"Update a cart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"customerId":{"type":"string","format":"uuid"},"customerEmail":{"type":"string","format":"email","nullable":true},"billingAddress":{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},"shippingAddress":{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},"notes":{"type":"string"},"netN":{"type":"integer","minimum":1,"maximum":365,"nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"customerId":{"type":"string","format":"uuid","nullable":true},"customerEmail":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","checkout","converted","abandoned"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"billingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"shippingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"discountCode":{"type":"string","nullable":true},"appliedDiscount":{"anyOf":[{"type":"object","properties":{"discountId":{"type":"string","format":"uuid","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"freeShipping":{"type":"boolean"},"validUntil":{"type":"string","format":"date-time","nullable":true},"snapshotHash":{"type":"string"}}},{"type":"null"}]},"selectedShipping":{"anyOf":[{"type":"object","properties":{"methodId":{"type":"string"},"displayName":{"type":"string"},"rateAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"carrier":{"type":"string"},"serviceCode":{"type":"string"},"estimatedDeliveryDays":{"type":"integer"}}},{"type":"null"}]},"taxLines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lineItemId":{"type":"string","format":"uuid"},"jurisdictionCode":{"type":"string"},"jurisdictionName":{"type":"string","nullable":true},"taxType":{"type":"string"},"rate":{"type":"number"},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string","nullable":true}}}},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/carts/{id}/items":{"post":{"tags":["Carts"],"description":"Add a line item to a cart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","unitPrice"],"additionalProperties":false,"properties":{"type":{"type":"string","enum":["product","subscription","service","ticket","donation","custom"],"default":"product"},"referenceId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"unitPrice":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"quantity":{"type":"integer","minimum":1,"default":1},"taxAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"imageUrl":{"type":"string","description":"Product image. Accepts an absolute http(s) URL or a relative path (e.g. \"/images/x.png\"); relative paths are resolved against the application storefront base URL (PUT /v1/embed-config { storefrontBaseUrl }, falling back to the first allowedOrigin)."},"requiresShipping":{"type":"boolean","description":"Whether this item is physically shippable. For external/ad-hoc catalogs with no Throttle product behind the item. Omit to infer from `type` (everything except `service` ships); set explicitly to force-include or force-exclude the item from `calculated` shipping."},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"unitPrice":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"quantity":{"type":"integer"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/carts/{cartId}/items/{id}":{"patch":{"tags":["Carts"],"description":"Update a line item","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"quantity":{"type":"integer","minimum":1},"unitPrice":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"cartId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"unitPrice":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"quantity":{"type":"integer"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}},"delete":{"tags":["Carts"],"description":"Remove a line item from a cart","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"cartId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"}}}},"/api/v1/carts/{id}/checkout":{"post":{"tags":["Carts"],"description":"Convert the cart to a draft order. Legacy alias for /finalize — same handler, identical semantics. New integrations should call /finalize instead.","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"The created draft order","properties":{"id":{"type":"string","format":"uuid"},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"In cents"},"total":{"type":"integer","description":"In cents"},"cartId":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/carts/{id}/finalize":{"post":{"tags":["Carts"],"description":"Finalize a cart by converting it to a draft order (status=draft). To collect payment, mint a checkout session against the resulting order afterwards.","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"The created draft order","properties":{"id":{"type":"string","format":"uuid"},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"In cents"},"total":{"type":"integer","description":"In cents"},"cartId":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/carts/{id}/merge":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/carts/{id}/apply-discount":{"post":{"tags":["Carts"],"description":"Apply a discount code to a cart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["code"],"properties":{"code":{"type":"string"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"customerId":{"type":"string","format":"uuid","nullable":true},"customerEmail":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","checkout","converted","abandoned"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"billingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"shippingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"discountCode":{"type":"string","nullable":true},"appliedDiscount":{"anyOf":[{"type":"object","properties":{"discountId":{"type":"string","format":"uuid","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"freeShipping":{"type":"boolean"},"validUntil":{"type":"string","format":"date-time","nullable":true},"snapshotHash":{"type":"string"}}},{"type":"null"}]},"selectedShipping":{"anyOf":[{"type":"object","properties":{"methodId":{"type":"string"},"displayName":{"type":"string"},"rateAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"carrier":{"type":"string"},"serviceCode":{"type":"string"},"estimatedDeliveryDays":{"type":"integer"}}},{"type":"null"}]},"taxLines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lineItemId":{"type":"string","format":"uuid"},"jurisdictionCode":{"type":"string"},"jurisdictionName":{"type":"string","nullable":true},"taxType":{"type":"string"},"rate":{"type":"number"},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string","nullable":true}}}},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/carts/{id}/discount":{"delete":{"tags":["Carts"],"description":"Remove discount code from a cart","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"customerId":{"type":"string","format":"uuid","nullable":true},"customerEmail":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","checkout","converted","abandoned"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"billingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"shippingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"discountCode":{"type":"string","nullable":true},"appliedDiscount":{"anyOf":[{"type":"object","properties":{"discountId":{"type":"string","format":"uuid","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"freeShipping":{"type":"boolean"},"validUntil":{"type":"string","format":"date-time","nullable":true},"snapshotHash":{"type":"string"}}},{"type":"null"}]},"selectedShipping":{"anyOf":[{"type":"object","properties":{"methodId":{"type":"string"},"displayName":{"type":"string"},"rateAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"carrier":{"type":"string"},"serviceCode":{"type":"string"},"estimatedDeliveryDays":{"type":"integer"}}},{"type":"null"}]},"taxLines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lineItemId":{"type":"string","format":"uuid"},"jurisdictionCode":{"type":"string"},"jurisdictionName":{"type":"string","nullable":true},"taxType":{"type":"string"},"rate":{"type":"number"},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string","nullable":true}}}},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/carts/{id}/shipping":{"post":{"tags":["Carts"],"description":"Select a shipping method for a cart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["methodId","displayName","rateAmount"],"properties":{"methodId":{"type":"string"},"displayName":{"type":"string"},"rateAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"carrier":{"type":"string"},"serviceCode":{"type":"string"},"estimatedDeliveryDays":{"type":"integer","minimum":0}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"customerId":{"type":"string","format":"uuid","nullable":true},"customerEmail":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","checkout","converted","abandoned"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"billingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"shippingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"discountCode":{"type":"string","nullable":true},"appliedDiscount":{"anyOf":[{"type":"object","properties":{"discountId":{"type":"string","format":"uuid","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"freeShipping":{"type":"boolean"},"validUntil":{"type":"string","format":"date-time","nullable":true},"snapshotHash":{"type":"string"}}},{"type":"null"}]},"selectedShipping":{"anyOf":[{"type":"object","properties":{"methodId":{"type":"string"},"displayName":{"type":"string"},"rateAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"carrier":{"type":"string"},"serviceCode":{"type":"string"},"estimatedDeliveryDays":{"type":"integer"}}},{"type":"null"}]},"taxLines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lineItemId":{"type":"string","format":"uuid"},"jurisdictionCode":{"type":"string"},"jurisdictionName":{"type":"string","nullable":true},"taxType":{"type":"string"},"rate":{"type":"number"},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string","nullable":true}}}},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}},"delete":{"tags":["Carts"],"description":"Clear the selected shipping method from a cart","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"customerId":{"type":"string","format":"uuid","nullable":true},"customerEmail":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","checkout","converted","abandoned"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"billingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"shippingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"discountCode":{"type":"string","nullable":true},"appliedDiscount":{"anyOf":[{"type":"object","properties":{"discountId":{"type":"string","format":"uuid","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"freeShipping":{"type":"boolean"},"validUntil":{"type":"string","format":"date-time","nullable":true},"snapshotHash":{"type":"string"}}},{"type":"null"}]},"selectedShipping":{"anyOf":[{"type":"object","properties":{"methodId":{"type":"string"},"displayName":{"type":"string"},"rateAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"carrier":{"type":"string"},"serviceCode":{"type":"string"},"estimatedDeliveryDays":{"type":"integer"}}},{"type":"null"}]},"taxLines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lineItemId":{"type":"string","format":"uuid"},"jurisdictionCode":{"type":"string"},"jurisdictionName":{"type":"string","nullable":true},"taxType":{"type":"string"},"rate":{"type":"number"},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string","nullable":true}}}},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/carts/{id}/tax-lines":{"put":{"tags":["Carts"],"description":"Replace all tax lines on a cart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["lines"],"properties":{"lines":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["lineItemId","jurisdictionCode","taxType","rate","amount"],"properties":{"lineItemId":{"type":"string","format":"uuid"},"jurisdictionCode":{"type":"string"},"jurisdictionName":{"type":"string"},"taxType":{"type":"string","enum":["sales","vat","gst","pst","hst","service","excise","other"]},"rate":{"type":"number","minimum":0,"maximum":1},"amount":{"type":"integer","minimum":0},"currency":{"type":"string"}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"customerId":{"type":"string","format":"uuid","nullable":true},"customerEmail":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","checkout","converted","abandoned"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"billingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"shippingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"discountCode":{"type":"string","nullable":true},"appliedDiscount":{"anyOf":[{"type":"object","properties":{"discountId":{"type":"string","format":"uuid","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"freeShipping":{"type":"boolean"},"validUntil":{"type":"string","format":"date-time","nullable":true},"snapshotHash":{"type":"string"}}},{"type":"null"}]},"selectedShipping":{"anyOf":[{"type":"object","properties":{"methodId":{"type":"string"},"displayName":{"type":"string"},"rateAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"carrier":{"type":"string"},"serviceCode":{"type":"string"},"estimatedDeliveryDays":{"type":"integer"}}},{"type":"null"}]},"taxLines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lineItemId":{"type":"string","format":"uuid"},"jurisdictionCode":{"type":"string"},"jurisdictionName":{"type":"string","nullable":true},"taxType":{"type":"string"},"rate":{"type":"number"},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string","nullable":true}}}},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}},"delete":{"tags":["Carts"],"description":"Clear all tax lines from a cart","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"applicationId":{"type":"string","format":"uuid","nullable":true},"customerId":{"type":"string","format":"uuid","nullable":true},"customerEmail":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","checkout","converted","abandoned"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"netN":{"type":"integer","minimum":0,"maximum":365,"nullable":true},"billingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"shippingAddress":{"anyOf":[{"type":"object","additionalProperties":true,"required":["addressLine1","city","countryCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"city":{"type":"string"},"stateProvince":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2"},"phone":{"type":"string"},"email":{"type":"string","format":"email"}}},{"type":"null"}]},"discountCode":{"type":"string","nullable":true},"appliedDiscount":{"anyOf":[{"type":"object","properties":{"discountId":{"type":"string","format":"uuid","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"freeShipping":{"type":"boolean"},"validUntil":{"type":"string","format":"date-time","nullable":true},"snapshotHash":{"type":"string"}}},{"type":"null"}]},"selectedShipping":{"anyOf":[{"type":"object","properties":{"methodId":{"type":"string"},"displayName":{"type":"string"},"rateAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"carrier":{"type":"string"},"serviceCode":{"type":"string"},"estimatedDeliveryDays":{"type":"integer"}}},{"type":"null"}]},"taxLines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lineItemId":{"type":"string","format":"uuid"},"jurisdictionCode":{"type":"string"},"jurisdictionName":{"type":"string","nullable":true},"taxType":{"type":"string"},"rate":{"type":"number"},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string","nullable":true}}}},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/carts/{id}/events":{"get":{"tags":["Carts"],"description":"List audit events for a cart","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"integer","minimum":0},"in":"query","name":"sinceSequence","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"cartId":{"type":"string","format":"uuid"},"eventType":{"type":"string"},"sequence":{"type":"integer"},"payload":{"type":"object","additionalProperties":true},"actorType":{"type":"string"},"actorId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/abandoned-carts":{"get":{"summary":"List abandoned carts (most-recently abandoned first).","tags":["Carts"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/abandoned-carts/summary":{"get":{"summary":"Abandoned-cart summary metrics over a trailing window.","tags":["Carts"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"integer","minimum":1,"maximum":365},"in":"query","name":"sinceDays","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/cart-sessions":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/cart-sessions/{id}":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/cart-sessions/{id}/items":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/cart-sessions/{id}/items/{itemId}":{"patch":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"itemId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"itemId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/cart-sessions/{id}/shipping":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/cart-sessions/{id}/discount":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/cart-sessions/{id}/checkout-session":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/shipping-tax/config":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/shipping-tax/quote-tokens":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/shipping-tax/quote-tokens/{tokenId}":{"delete":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"tokenId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/shipping-tax/config/draft":{"put":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/shipping-tax/config/publish":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/shipping-tax/quotes":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/shipping-tax/carts/{cartId}/calculate":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"cartId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/shipping-tax/external-snapshots":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/shipping-tax/shipping-providers/available":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/shipping-tax/tax-providers/available":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/shipping-tax/shipping-providers":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/shipping-tax/tax-providers":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/shipping-tax/shipping-providers/{id}/verify":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/shipping-tax/tax-providers/{id}/verify":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/shipping-tax/shipping-providers/{id}/primary":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/shipping-tax/tax-providers/{id}/primary":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/shipping-tax/shipping-providers/{id}":{"delete":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/shipping-tax/tax-providers/{id}":{"delete":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/orders":{"post":{"tags":["Orders"],"description":"Create a new order (draft)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid"},"currency":{"type":"string","default":"USD"},"source":{"type":"string","enum":["web","mobile","pos","api"],"default":"api"},"billingAddress":{"type":"object","additionalProperties":true},"shippingAddress":{"type":"object","additionalProperties":true},"notes":{"type":"string"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"lineItems":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["product","subscription","service","ticket","donation","custom"],"default":"product"},"referenceId":{"type":"string","description":"Merchant's external ID (SKU, plan ID, etc.)"},"name":{"type":"string"},"description":{"type":"string"},"unitPrice":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"quantity":{"type":"integer","minimum":1,"default":1},"taxAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)","default":0},"discountAmount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)","default":0},"imageUrl":{"type":"string","description":"Product image. Accepts an absolute http(s) URL or a relative path (e.g. \"/images/x.png\"); relative paths are resolved against the application storefront base URL (PUT /v1/embed-config { storefrontBaseUrl }, falling back to the first allowedOrigin)."},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}},"required":["name","unitPrice"]}}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"discountId":{"type":"string","format":"uuid","nullable":true},"discountCode":{"type":"string","nullable":true},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft","pending","processing","partially_fulfilled","completed","cancelled","closed"]},"type":{"type":"string","enum":["one_time","recurring","mixed"]},"paymentStatus":{"type":"string","enum":["pending","authorized","captured","partially_refunded","refunded","failed","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","not_applicable"]},"source":{"type":"string","enum":["web","mobile","pos","api","subscription_engine"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"tags":["Orders"],"description":"List orders with cursor pagination","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Cursor for pagination (last item ID)"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false,"description":"Number of items per page"},{"schema":{"type":"string","enum":["draft","pending","processing","partially_fulfilled","completed","cancelled","closed"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["pending","authorized","captured","partially_refunded","refunded","failed","voided"]},"in":"query","name":"paymentStatus","required":false},{"schema":{"type":"string","enum":["one_time","recurring","mixed"]},"in":"query","name":"type","required":false},{"schema":{"type":"string","enum":["web","mobile","pos","api","subscription_engine"]},"in":"query","name":"source","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false,"description":"Search order id, number, source, status, or metadata."},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"customerId","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"discountId":{"type":"string","format":"uuid","nullable":true},"discountCode":{"type":"string","nullable":true},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft","pending","processing","partially_fulfilled","completed","cancelled","closed"]},"type":{"type":"string","enum":["one_time","recurring","mixed"]},"paymentStatus":{"type":"string","enum":["pending","authorized","captured","partially_refunded","refunded","failed","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","not_applicable"]},"source":{"type":"string","enum":["web","mobile","pos","api","subscription_engine"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/orders/{id}":{"get":{"tags":["Orders"],"description":"Get an order by ID (includes line items)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"discountId":{"type":"string","format":"uuid","nullable":true},"discountCode":{"type":"string","nullable":true},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft","pending","processing","partially_fulfilled","completed","cancelled","closed"]},"type":{"type":"string","enum":["one_time","recurring","mixed"]},"paymentStatus":{"type":"string","enum":["pending","authorized","captured","partially_refunded","refunded","failed","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","not_applicable"]},"source":{"type":"string","enum":["web","mobile","pos","api","subscription_engine"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"patch":{"tags":["Orders"],"description":"Update order fields (addresses, notes, metadata)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"billingAddress":{"type":"object","additionalProperties":true},"shippingAddress":{"type":"object","additionalProperties":true},"notes":{"type":"string"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"discountId":{"type":"string","format":"uuid","nullable":true},"discountCode":{"type":"string","nullable":true},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft","pending","processing","partially_fulfilled","completed","cancelled","closed"]},"type":{"type":"string","enum":["one_time","recurring","mixed"]},"paymentStatus":{"type":"string","enum":["pending","authorized","captured","partially_refunded","refunded","failed","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","not_applicable"]},"source":{"type":"string","enum":["web","mobile","pos","api","subscription_engine"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/orders/{id}/checkout":{"post":{"tags":["Orders"],"description":"Initiate checkout (draft -> pending)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"discountId":{"type":"string","format":"uuid","nullable":true},"discountCode":{"type":"string","nullable":true},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft","pending","processing","partially_fulfilled","completed","cancelled","closed"]},"type":{"type":"string","enum":["one_time","recurring","mixed"]},"paymentStatus":{"type":"string","enum":["pending","authorized","captured","partially_refunded","refunded","failed","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","not_applicable"]},"source":{"type":"string","enum":["web","mobile","pos","api","subscription_engine"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/orders/{id}/authorize":{"post":{"tags":["Orders"],"description":"Mark payment as authorized (pending -> processing)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["paymentId"],"properties":{"paymentId":{"type":"string","format":"uuid"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"discountId":{"type":"string","format":"uuid","nullable":true},"discountCode":{"type":"string","nullable":true},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft","pending","processing","partially_fulfilled","completed","cancelled","closed"]},"type":{"type":"string","enum":["one_time","recurring","mixed"]},"paymentStatus":{"type":"string","enum":["pending","authorized","captured","partially_refunded","refunded","failed","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","not_applicable"]},"source":{"type":"string","enum":["web","mobile","pos","api","subscription_engine"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/orders/{id}/capture":{"post":{"tags":["Orders"],"description":"Mark payment as captured (pending -> processing)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["paymentId"],"properties":{"paymentId":{"type":"string","format":"uuid"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"discountId":{"type":"string","format":"uuid","nullable":true},"discountCode":{"type":"string","nullable":true},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft","pending","processing","partially_fulfilled","completed","cancelled","closed"]},"type":{"type":"string","enum":["one_time","recurring","mixed"]},"paymentStatus":{"type":"string","enum":["pending","authorized","captured","partially_refunded","refunded","failed","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","not_applicable"]},"source":{"type":"string","enum":["web","mobile","pos","api","subscription_engine"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/orders/{id}/cancel":{"post":{"tags":["Orders"],"description":"Cancel an order","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"discountId":{"type":"string","format":"uuid","nullable":true},"discountCode":{"type":"string","nullable":true},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft","pending","processing","partially_fulfilled","completed","cancelled","closed"]},"type":{"type":"string","enum":["one_time","recurring","mixed"]},"paymentStatus":{"type":"string","enum":["pending","authorized","captured","partially_refunded","refunded","failed","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","not_applicable"]},"source":{"type":"string","enum":["web","mobile","pos","api","subscription_engine"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/orders/{id}/complete":{"post":{"tags":["Orders"],"description":"Complete an order (processing -> completed)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"discountId":{"type":"string","format":"uuid","nullable":true},"discountCode":{"type":"string","nullable":true},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft","pending","processing","partially_fulfilled","completed","cancelled","closed"]},"type":{"type":"string","enum":["one_time","recurring","mixed"]},"paymentStatus":{"type":"string","enum":["pending","authorized","captured","partially_refunded","refunded","failed","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","not_applicable"]},"source":{"type":"string","enum":["web","mobile","pos","api","subscription_engine"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/orders/{id}/close":{"post":{"tags":["Orders"],"description":"Close a completed order","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"discountId":{"type":"string","format":"uuid","nullable":true},"discountCode":{"type":"string","nullable":true},"orderNumber":{"type":"string"},"status":{"type":"string","enum":["draft","pending","processing","partially_fulfilled","completed","cancelled","closed"]},"type":{"type":"string","enum":["one_time","recurring","mixed"]},"paymentStatus":{"type":"string","enum":["pending","authorized","captured","partially_refunded","refunded","failed","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","not_applicable"]},"source":{"type":"string","enum":["web","mobile","pos","api","subscription_engine"]},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"taxTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"shippingTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/orders/{id}/payments":{"post":{"tags":["Payments"],"description":"Create a payment for an order","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount"],"properties":{"processor":{"type":"string","default":"manual"},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string","default":"USD"},"method":{"type":"string","enum":["card","bank_transfer","wallet","cash","external","manual","net30"],"default":"manual"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"processor":{"type":"string"},"processorTransactionId":{"type":["null","string"]},"processorResponse":{"type":["null","object"],"additionalProperties":true},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","authorized","captured","failed","voided","refunded","partially_refunded"]},"method":{"type":"string","enum":["card","bank_transfer","wallet","cash","external","manual","net30"]},"netN":{"type":"integer","minimum":0,"maximum":365},"netNSource":{"type":"string","enum":["customer_override","cart_override","global_default"]},"authorizedAt":{"type":["null","string"],"format":"date-time"},"capturedAt":{"type":["null","string"],"format":"date-time"},"voidedAt":{"type":["null","string"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}},"get":{"tags":["Payments"],"description":"List payments for an order","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"processor":{"type":"string"},"processorTransactionId":{"type":["null","string"]},"processorResponse":{"type":["null","object"],"additionalProperties":true},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","authorized","captured","failed","voided","refunded","partially_refunded"]},"method":{"type":"string","enum":["card","bank_transfer","wallet","cash","external","manual","net30"]},"netN":{"type":"integer","minimum":0,"maximum":365},"netNSource":{"type":"string","enum":["customer_override","cart_override","global_default"]},"authorizedAt":{"type":["null","string"],"format":"date-time"},"capturedAt":{"type":["null","string"],"format":"date-time"},"voidedAt":{"type":["null","string"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/orders/{id}/payments/{paymentId}":{"get":{"tags":["Payments"],"description":"Get a specific payment for an order","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"paymentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"processor":{"type":"string"},"processorTransactionId":{"type":["null","string"]},"processorResponse":{"type":["null","object"],"additionalProperties":true},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","authorized","captured","failed","voided","refunded","partially_refunded"]},"method":{"type":"string","enum":["card","bank_transfer","wallet","cash","external","manual","net30"]},"netN":{"type":"integer","minimum":0,"maximum":365},"netNSource":{"type":"string","enum":["customer_override","cart_override","global_default"]},"authorizedAt":{"type":["null","string"],"format":"date-time"},"capturedAt":{"type":["null","string"],"format":"date-time"},"voidedAt":{"type":["null","string"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/payments/{id}/transactions":{"get":{"tags":["Payments"],"description":"List transactions for a payment","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"paymentId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["authorize","capture","refund","void"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"status":{"type":"string","enum":["success","failed","pending"]},"processorResponse":{"type":"object","additionalProperties":true,"nullable":true},"idempotencyKey":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/payments":{"get":{"summary":"List payments for the calling merchant.","tags":["Payments"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"query","name":"method","required":false},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","enum":["0_30","31_60","61_90","90_plus"]},"in":"query","name":"aging","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"order_id","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"due_from","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"due_to","required":false},{"schema":{"type":"string","pattern":"^\\d+$"},"in":"query","name":"amount_min","required":false},{"schema":{"type":"string","pattern":"^\\d+$"},"in":"query","name":"amount_max","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/payments/{id}":{"get":{"summary":"Get a payment by id.","tags":["Payments"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/orders/{id}/refund":{"post":{"tags":["Orders"],"description":"Refund the captured payment on an order","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"integer","description":"Partial refund amount (defaults to full amount)"},"reason":{"type":"string","maxLength":500}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"processor":{"type":"string"},"processorTransactionId":{"type":["null","string"]},"processorResponse":{"type":["null","object"],"additionalProperties":true},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","authorized","captured","failed","voided","refunded","partially_refunded"]},"method":{"type":"string","enum":["card","bank_transfer","wallet","cash","external","manual","net30"]},"netN":{"type":"integer","minimum":0,"maximum":365},"netNSource":{"type":"string","enum":["customer_override","cart_override","global_default"]},"authorizedAt":{"type":["null","string"],"format":"date-time"},"capturedAt":{"type":["null","string"],"format":"date-time"},"voidedAt":{"type":["null","string"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/payments/{id}/authorize":{"post":{"tags":["Payments"],"description":"Authorize a payment (pending -> authorized)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"processor":{"type":"string"},"processorTransactionId":{"type":["null","string"]},"processorResponse":{"type":["null","object"],"additionalProperties":true},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","authorized","captured","failed","voided","refunded","partially_refunded"]},"method":{"type":"string","enum":["card","bank_transfer","wallet","cash","external","manual","net30"]},"netN":{"type":"integer","minimum":0,"maximum":365},"netNSource":{"type":"string","enum":["customer_override","cart_override","global_default"]},"authorizedAt":{"type":["null","string"],"format":"date-time"},"capturedAt":{"type":["null","string"],"format":"date-time"},"voidedAt":{"type":["null","string"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/payments/{id}/capture":{"post":{"tags":["Payments"],"description":"Capture a payment (authorized -> captured)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"integer","description":"Partial capture amount (defaults to full amount)"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"processor":{"type":"string"},"processorTransactionId":{"type":["null","string"]},"processorResponse":{"type":["null","object"],"additionalProperties":true},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","authorized","captured","failed","voided","refunded","partially_refunded"]},"method":{"type":"string","enum":["card","bank_transfer","wallet","cash","external","manual","net30"]},"netN":{"type":"integer","minimum":0,"maximum":365},"netNSource":{"type":"string","enum":["customer_override","cart_override","global_default"]},"authorizedAt":{"type":["null","string"],"format":"date-time"},"capturedAt":{"type":["null","string"],"format":"date-time"},"voidedAt":{"type":["null","string"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/payments/{id}/void":{"post":{"tags":["Payments"],"description":"Void an authorized payment","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"processor":{"type":"string"},"processorTransactionId":{"type":["null","string"]},"processorResponse":{"type":["null","object"],"additionalProperties":true},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","authorized","captured","failed","voided","refunded","partially_refunded"]},"method":{"type":"string","enum":["card","bank_transfer","wallet","cash","external","manual","net30"]},"netN":{"type":"integer","minimum":0,"maximum":365},"netNSource":{"type":"string","enum":["customer_override","cart_override","global_default"]},"authorizedAt":{"type":["null","string"],"format":"date-time"},"capturedAt":{"type":["null","string"],"format":"date-time"},"voidedAt":{"type":["null","string"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/payments/{id}/refund":{"post":{"tags":["Payments"],"description":"Refund a captured payment (full or partial)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"integer","description":"Partial refund amount (defaults to full amount)"},"reason":{"type":"string","maxLength":500}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"processor":{"type":"string"},"processorTransactionId":{"type":["null","string"]},"processorResponse":{"type":["null","object"],"additionalProperties":true},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","authorized","captured","failed","voided","refunded","partially_refunded"]},"method":{"type":"string","enum":["card","bank_transfer","wallet","cash","external","manual","net30"]},"netN":{"type":"integer","minimum":0,"maximum":365},"netNSource":{"type":"string","enum":["customer_override","cart_override","global_default"]},"authorizedAt":{"type":["null","string"],"format":"date-time"},"capturedAt":{"type":["null","string"],"format":"date-time"},"voidedAt":{"type":["null","string"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/payments/{id}/invoice/resend":{"post":{"summary":"Resend the Net-N invoice email to the customer.","tags":["Payments"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/payments/{id}/invoice-pdf":{"get":{"summary":"Get a signed download URL for a Net30 invoice PDF.","tags":["Payments"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/invoices":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/customers/{customerId}/invoices":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"customerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/invoices/{id}":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/invoices/{id}/download":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/orders/{orderId}/fulfillments":{"post":{"tags":["Fulfillments"],"description":"Create a fulfillment for an order","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","lineItemIds"],"properties":{"type":{"type":"string","enum":["shipment","digital","access_grant","service","in_person","custom"]},"lineItemIds":{"type":"array","items":{"type":"object","required":["lineItemId","quantity"],"properties":{"lineItemId":{"type":"string","format":"uuid"},"quantity":{"type":"integer","minimum":1}}}},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orderId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["shipment","digital","access_grant","service","in_person","custom"]},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled"]},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"detail":{"type":"object","additionalProperties":true,"nullable":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}},"get":{"tags":["Fulfillments"],"description":"List fulfillments for an order","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orderId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["shipment","digital","access_grant","service","in_person","custom"]},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled"]},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"detail":{"type":"object","additionalProperties":true,"nullable":true}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/orders/{orderId}/fulfillments/{id}":{"get":{"tags":["Fulfillments"],"description":"Get a fulfillment by ID (includes type-specific details)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orderId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["shipment","digital","access_grant","service","in_person","custom"]},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled"]},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"detail":{"type":"object","additionalProperties":true,"nullable":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/orders/{orderId}/fulfillments/{id}/processing":{"post":{"tags":["Fulfillments"],"description":"Mark fulfillment as processing","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orderId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["shipment","digital","access_grant","service","in_person","custom"]},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled"]},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"detail":{"type":"object","additionalProperties":true,"nullable":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/orders/{orderId}/fulfillments/{id}/complete":{"post":{"tags":["Fulfillments"],"description":"Mark fulfillment as completed","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orderId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["shipment","digital","access_grant","service","in_person","custom"]},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled"]},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"detail":{"type":"object","additionalProperties":true,"nullable":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/orders/{orderId}/fulfillments/{id}/cancel":{"post":{"tags":["Fulfillments"],"description":"Cancel a fulfillment","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orderId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orderId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["shipment","digital","access_grant","service","in_person","custom"]},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled"]},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"detail":{"type":"object","additionalProperties":true,"nullable":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/orders/{orderId}/fulfillments/{id}/shipment":{"patch":{"tags":["Fulfillments"],"description":"Update shipment details for a fulfillment","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"carrier":{"type":"string","description":"e.g. fedex, ups, usps, dhl"},"serviceLevel":{"type":"string","description":"e.g. ground, express, overnight"},"trackingNumber":{"type":"string"},"trackingUrl":{"type":"string","format":"uri"},"labelUrl":{"type":"string","format":"uri"},"shippingCost":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"estimatedDelivery":{"type":"string","format":"date-time"},"shippedAt":{"type":"string","format":"date-time"},"externalId":{"type":"string"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orderId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"fulfillmentId":{"type":"string","format":"uuid"},"carrier":{"type":"string","nullable":true},"serviceLevel":{"type":"string","nullable":true},"trackingNumber":{"type":"string","nullable":true},"trackingUrl":{"type":"string","format":"uri","nullable":true},"labelUrl":{"type":"string","format":"uri","nullable":true},"shippingCost":{"type":"integer","nullable":true,"description":"In cents"},"estimatedDelivery":{"type":"string","format":"date-time","nullable":true},"shippedAt":{"type":"string","format":"date-time","nullable":true},"externalId":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/orders/{orderId}/fulfillments/{id}/digital":{"patch":{"tags":["Fulfillments"],"description":"Update digital delivery details","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deliveryMethod":{"type":"string","enum":["download","email","license_key","api_access"]},"downloadUrl":{"type":"string","format":"uri"},"downloadStorageKey":{"type":"string"},"downloadExpiry":{"type":"string","format":"date-time"},"downloadLimit":{"type":"integer"},"licenseKey":{"type":"string"},"deliveredAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orderId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"fulfillmentId":{"type":"string","format":"uuid"},"deliveryMethod":{"type":"string","enum":["download","email","license_key","api_access"]},"downloadUrl":{"type":"string","format":"uri","nullable":true},"downloadStorageKey":{"type":"string","nullable":true},"downloadExpiry":{"type":"string","format":"date-time","nullable":true},"downloadLimit":{"type":"integer","nullable":true},"downloadCount":{"type":"integer"},"licenseKey":{"type":"string","nullable":true},"deliveredAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/orders/{orderId}/fulfillments/{id}/access":{"patch":{"tags":["Fulfillments"],"description":"Update access grant details","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"resourceType":{"type":"string","description":"e.g. course, software, membership, content, api"},"resourceId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"grantedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orderId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"fulfillmentId":{"type":"string","format":"uuid"},"resourceType":{"type":"string"},"resourceId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"grantedAt":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"revokedAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/orders/{orderId}/fulfillments/{id}/service":{"patch":{"tags":["Fulfillments"],"description":"Update service delivery details","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"serviceType":{"type":"string"},"providerName":{"type":"string"},"scheduledAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"location":{"type":"string"},"durationMinutes":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orderId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"fulfillmentId":{"type":"string","format":"uuid"},"serviceType":{"type":"string","nullable":true},"providerName":{"type":"string","nullable":true},"scheduledAt":{"type":"string","format":"date-time","nullable":true},"completedAt":{"type":"string","format":"date-time","nullable":true},"location":{"type":"string","nullable":true},"durationMinutes":{"type":"integer","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/subscriptions":{"post":{"tags":["Subscriptions"],"description":"Create a new subscription","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["customerId","planReference","interval","amount","currentPeriodStart","currentPeriodEnd"],"properties":{"applicationId":{"type":"string","format":"uuid","description":"Optional application ID override (resolved from auth context when absent)"},"customerId":{"type":"string","format":"uuid","description":"ID of the customer to subscribe"},"planReference":{"type":"string","minLength":1,"description":"Your plan identifier (e.g. \"pro_monthly\")"},"planName":{"type":"string","description":"Human-readable plan name shown on invoices"},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"],"description":"Billing interval"},"amount":{"type":"integer","minimum":0,"description":"Subscription amount in the smallest currency unit (e.g. cents)"},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code (defaults to USD)"},"currentPeriodStart":{"format":"date-time","description":"ISO 8601 start of the current billing period"},"currentPeriodEnd":{"format":"date-time","description":"ISO 8601 end of the current billing period"},"trialEnd":{"format":"date-time","description":"ISO 8601 date-time when the trial ends (omit if no trial)"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata stored with the subscription"}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","paused","cancelled","past_due","trialing"]},"planReference":{"type":"string"},"planName":{"type":"string","nullable":true},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"},"failureCount":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"pendingPlanReference":{"type":["null","string"]},"pendingPlanName":{"type":["null","string"]},"pendingInterval":{"type":["null","string"]},"pendingAmount":{"type":["null","integer"]}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"tags":["Subscriptions"],"description":"List subscriptions with cursor pagination","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Cursor for pagination (last item ID)"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false,"description":"Number of items per page"},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"customerId","required":false},{"schema":{"type":"string"},"in":"query","name":"externalCustomerId","required":false,"description":"Filter by the merchant's own customer ID (the value passed as externalId on customer creation). Server resolves to the throttle customerId before filtering. Mutually exclusive with customerId."},{"schema":{"type":"string","enum":["active","paused","cancelled","past_due","trialing"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"in":"query","name":"interval","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false,"description":"Search subscription id, customer id, plan reference, plan name, status, interval, and metadata."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","paused","cancelled","past_due","trialing"]},"planReference":{"type":"string"},"planName":{"type":"string","nullable":true},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"},"failureCount":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"pendingPlanReference":{"type":["null","string"]},"pendingPlanName":{"type":["null","string"]},"pendingInterval":{"type":["null","string"]},"pendingAmount":{"type":["null","integer"]}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/subscriptions/{id}":{"get":{"tags":["Subscriptions"],"description":"Get a subscription by ID","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","paused","cancelled","past_due","trialing"]},"planReference":{"type":"string"},"planName":{"type":"string","nullable":true},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"},"failureCount":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"pendingPlanReference":{"type":["null","string"]},"pendingPlanName":{"type":["null","string"]},"pendingInterval":{"type":["null","string"]},"pendingAmount":{"type":["null","integer"]}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"patch":{"tags":["Subscriptions"],"description":"Update a subscription (plan change, amount, interval)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"planReference":{"type":"string"},"planName":{"type":"string"},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"amount":{"type":"integer","description":"Amount in cents"},"metadata":{"type":"object","additionalProperties":true}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","paused","cancelled","past_due","trialing"]},"planReference":{"type":"string"},"planName":{"type":"string","nullable":true},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"},"failureCount":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"pendingPlanReference":{"type":["null","string"]},"pendingPlanName":{"type":["null","string"]},"pendingInterval":{"type":["null","string"]},"pendingAmount":{"type":["null","integer"]}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/subscriptions/{id}/invoices":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/subscriptions/{id}/pause":{"post":{"tags":["Subscriptions"],"description":"Pause an active subscription","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","paused","cancelled","past_due","trialing"]},"planReference":{"type":"string"},"planName":{"type":"string","nullable":true},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"},"failureCount":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"pendingPlanReference":{"type":["null","string"]},"pendingPlanName":{"type":["null","string"]},"pendingInterval":{"type":["null","string"]},"pendingAmount":{"type":["null","integer"]}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/subscriptions/{id}/resume":{"post":{"tags":["Subscriptions"],"description":"Resume a paused subscription","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","paused","cancelled","past_due","trialing"]},"planReference":{"type":"string"},"planName":{"type":"string","nullable":true},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"},"failureCount":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"pendingPlanReference":{"type":["null","string"]},"pendingPlanName":{"type":["null","string"]},"pendingInterval":{"type":["null","string"]},"pendingAmount":{"type":["null","integer"]}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/subscriptions/{id}/change-plan":{"post":{"tags":["Subscriptions"],"description":"Schedule or apply a plan change on a subscription","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["planReference","interval","amount","effective"],"properties":{"planReference":{"type":"string","minLength":1,"description":"Your plan identifier for the new plan"},"planName":{"type":"string","description":"Human-readable name for the new plan"},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"],"description":"Billing interval for the new plan"},"amount":{"type":"integer","minimum":0,"description":"Amount in the smallest currency unit (e.g. cents)"},"effective":{"type":"string","enum":["now","period_end"],"description":"When the plan change takes effect"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","paused","cancelled","past_due","trialing"]},"planReference":{"type":"string"},"planName":{"type":"string","nullable":true},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"},"failureCount":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"pendingPlanReference":{"type":["null","string"]},"pendingPlanName":{"type":["null","string"]},"pendingInterval":{"type":["null","string"]},"pendingAmount":{"type":["null","integer"]}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/subscriptions/{id}/pending-change":{"delete":{"tags":["Subscriptions"],"description":"Cancel a pending scheduled plan change on a subscription","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","paused","cancelled","past_due","trialing"]},"planReference":{"type":"string"},"planName":{"type":"string","nullable":true},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"},"failureCount":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"pendingPlanReference":{"type":["null","string"]},"pendingPlanName":{"type":["null","string"]},"pendingInterval":{"type":["null","string"]},"pendingAmount":{"type":["null","integer"]}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/subscriptions/{id}/cancel":{"post":{"tags":["Subscriptions"],"description":"Cancel a subscription (immediately or at period end)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"atPeriodEnd":{"type":"boolean","default":false,"description":"If true, cancels at the end of the current billing period"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","paused","cancelled","past_due","trialing"]},"planReference":{"type":"string"},"planName":{"type":"string","nullable":true},"interval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"amount":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"currency":{"type":"string"},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"},"failureCount":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"pendingPlanReference":{"type":["null","string"]},"pendingPlanName":{"type":["null","string"]},"pendingInterval":{"type":["null","string"]},"pendingAmount":{"type":["null","integer"]}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/subscriptions/{id}/usage":{"post":{"tags":["Subscriptions"],"description":"Record (upsert) a usage item for the subscription's current billing period.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"kind":{"type":"string","minLength":1,"maxLength":64},"unitCount":{"type":"integer","minimum":0},"unitPriceCents":{"type":"integer","minimum":0}},"required":["kind","unitCount","unitPriceCents"]}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"tags":["Subscriptions"],"description":"List usage items for the subscription's current billing period.","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/subscriptions/eligibility-check":{"post":{"tags":["Subscriptions"],"description":"Pre-flight check whether a payment method is eligible for a free trial on this merchant. Card fingerprint match against any prior subscription with a trialEnd blocks the trial.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"paymentMethodId":{"type":"string","format":"uuid","description":"customerPaymentMethods row id. Must belong to the authenticated merchant. The server resolves the card fingerprint internally."}},"required":["paymentMethodId"]}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/discounts":{"post":{"tags":["Discounts"],"description":"Create a new discount","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","type","value"],"properties":{"code":{"type":"string","description":"Leave empty for automatic discounts"},"name":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"value":{"type":"integer","description":"Percentage as a whole number (25 = 25%) or fixed amount in minor units"},"conditions":{"type":"object","additionalProperties":true,"description":"e.g. { minOrder: 5000 }"},"usageLimit":{"type":"integer"},"maxRedemptionsPerCustomer":{"type":["integer","null"],"minimum":1,"default":1,"description":"Per-customer redemption limit. Use null for unlimited."},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","nullable":true,"description":"Null for automatic discounts"},"name":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"value":{"type":"integer","description":"Percentage as a whole number (25 = 25%) or fixed amount in minor units"},"conditions":{"type":"object","additionalProperties":true},"usageLimit":{"type":"integer","nullable":true},"usageCount":{"type":"integer"},"maxRedemptionsPerCustomer":{"type":"integer","nullable":true},"isActive":{"type":"boolean"},"startsAt":{"type":"string","format":"date-time","nullable":true},"endsAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"tags":["Discounts"],"description":"List discounts with cursor pagination","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Cursor for pagination (last item ID)"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"in":"query","name":"limit","required":false,"description":"Number of items per page"},{"schema":{"type":"boolean"},"in":"query","name":"isActive","required":false},{"schema":{"type":"string"},"in":"query","name":"code","required":false},{"schema":{"type":"string","enum":["percentage","fixed_amount"]},"in":"query","name":"type","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false,"description":"Search discount code, name, type, or metadata."},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false,"description":"Sort by creation time."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","nullable":true,"description":"Null for automatic discounts"},"name":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"value":{"type":"integer","description":"Percentage as a whole number (25 = 25%) or fixed amount in minor units"},"conditions":{"type":"object","additionalProperties":true},"usageLimit":{"type":"integer","nullable":true},"usageCount":{"type":"integer"},"maxRedemptionsPerCustomer":{"type":"integer","nullable":true},"isActive":{"type":"boolean"},"startsAt":{"type":"string","format":"date-time","nullable":true},"endsAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/discounts/{id}":{"get":{"tags":["Discounts"],"description":"Get a discount by ID","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","nullable":true,"description":"Null for automatic discounts"},"name":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"value":{"type":"integer","description":"Percentage as a whole number (25 = 25%) or fixed amount in minor units"},"conditions":{"type":"object","additionalProperties":true},"usageLimit":{"type":"integer","nullable":true},"usageCount":{"type":"integer"},"maxRedemptionsPerCustomer":{"type":"integer","nullable":true},"isActive":{"type":"boolean"},"startsAt":{"type":"string","format":"date-time","nullable":true},"endsAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"patch":{"tags":["Discounts"],"description":"Update a discount","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":["string","null"],"description":"Leave null for automatic discounts"},"name":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"value":{"type":"integer"},"conditions":{"type":"object","additionalProperties":true},"usageLimit":{"type":["integer","null"]},"maxRedemptionsPerCustomer":{"type":["integer","null"],"minimum":1,"description":"Per-customer redemption limit. Use null for unlimited."},"isActive":{"type":"boolean"},"startsAt":{"type":["string","null"],"format":"date-time"},"endsAt":{"type":["string","null"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","nullable":true,"description":"Null for automatic discounts"},"name":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"value":{"type":"integer","description":"Percentage as a whole number (25 = 25%) or fixed amount in minor units"},"conditions":{"type":"object","additionalProperties":true},"usageLimit":{"type":"integer","nullable":true},"usageCount":{"type":"integer"},"maxRedemptionsPerCustomer":{"type":"integer","nullable":true},"isActive":{"type":"boolean"},"startsAt":{"type":"string","format":"date-time","nullable":true},"endsAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}},"delete":{"tags":["Discounts"],"description":"Delete a discount","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"}}}},"/api/v1/discounts/validate":{"post":{"tags":["Discounts"],"description":"Validate a discount code against an order total","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","orderTotal"],"properties":{"code":{"type":"string"},"orderTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"customerId":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"valid":{"type":"boolean"},"discount":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","nullable":true,"description":"Null for automatic discounts"},"name":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"value":{"type":"integer","description":"Percentage as a whole number (25 = 25%) or fixed amount in minor units"},"conditions":{"type":"object","additionalProperties":true},"usageLimit":{"type":"integer","nullable":true},"usageCount":{"type":"integer"},"maxRedemptionsPerCustomer":{"type":"integer","nullable":true},"isActive":{"type":"boolean"},"startsAt":{"type":"string","format":"date-time","nullable":true},"endsAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"error":{"type":"string"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/discounts/preview":{"post":{"tags":["Discounts"],"description":"Preview a discount code against a subtotal without mutating a cart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","currency","subtotal"],"properties":{"code":{"type":"string"},"currency":{"type":"string","minLength":3,"maxLength":3},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"customerId":{"type":"string","format":"uuid"},"lineItems":{"type":"array","items":{"type":"object","required":["quantity","unitPrice"],"properties":{"id":{"type":"string"},"quantity":{"type":"integer","minimum":1},"unitPrice":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"}}}}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"valid":{"type":"boolean"},"code":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"value":{"type":"integer"},"currency":{"type":"string"},"subtotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discountTotal":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"total":{"type":"integer","description":"Amount in cents (e.g. 1999 = $19.99)"},"discount":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","nullable":true,"description":"Null for automatic discounts"},"name":{"type":"string"},"type":{"type":"string","enum":["percentage","fixed_amount"]},"value":{"type":"integer","description":"Percentage as a whole number (25 = 25%) or fixed amount in minor units"},"conditions":{"type":"object","additionalProperties":true},"usageLimit":{"type":"integer","nullable":true},"usageCount":{"type":"integer"},"maxRedemptionsPerCustomer":{"type":"integer","nullable":true},"isActive":{"type":"boolean"},"startsAt":{"type":"string","format":"date-time","nullable":true},"endsAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"message":{"type":"string","nullable":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/webhooks":{"post":{"tags":["Webhooks"],"description":"Register a new webhook. DEPRECATED — use POST /api/v1/webhook-endpoints (signed, Stripe-style) instead. This legacy endpoint no longer delivers events.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"description":"Event types (e.g. [\"order.created\", \"payment.captured\"])"},"secret":{"type":"string","description":"HMAC secret (auto-generated if omitted)"},"description":{"type":"string"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"deprecated":true,"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"description":"Event types to listen for (e.g. order.created, payment.captured, or * for all)"},"isActive":{"type":"boolean"},"description":{"type":"string","nullable":true},"failureCount":{"type":"integer"},"lastTriggeredAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"tags":["Webhooks"],"description":"List all webhooks for the organization. DEPRECATED — use POST /api/v1/webhook-endpoints (signed, Stripe-style) instead. This legacy endpoint no longer delivers events.","deprecated":true,"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"description":"Event types to listen for (e.g. order.created, payment.captured, or * for all)"},"isActive":{"type":"boolean"},"description":{"type":"string","nullable":true},"failureCount":{"type":"integer"},"lastTriggeredAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/webhooks/{id}":{"get":{"tags":["Webhooks"],"description":"Get a webhook by ID. DEPRECATED — use POST /api/v1/webhook-endpoints (signed, Stripe-style) instead. This legacy endpoint no longer delivers events.","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"deprecated":true,"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"description":"Event types to listen for (e.g. order.created, payment.captured, or * for all)"},"isActive":{"type":"boolean"},"description":{"type":"string","nullable":true},"failureCount":{"type":"integer"},"lastTriggeredAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"patch":{"tags":["Webhooks"],"description":"Update a webhook. DEPRECATED — use POST /api/v1/webhook-endpoints (signed, Stripe-style) instead. This legacy endpoint no longer delivers events.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"description":{"type":"string"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"deprecated":true,"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"description":"Event types to listen for (e.g. order.created, payment.captured, or * for all)"},"isActive":{"type":"boolean"},"description":{"type":"string","nullable":true},"failureCount":{"type":"integer"},"lastTriggeredAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}},"delete":{"tags":["Webhooks"],"description":"Delete a webhook. DEPRECATED — use POST /api/v1/webhook-endpoints (signed, Stripe-style) instead. This legacy endpoint no longer delivers events.","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"deprecated":true,"responses":{"204":{"description":"Default Response"}}}},"/api/v1/webhooks/{id}/deliveries":{"get":{"tags":["Webhooks"],"description":"List delivery attempts for a webhook. DEPRECATED — use POST /api/v1/webhook-endpoints (signed, Stripe-style) instead. This legacy endpoint no longer delivers events.","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Cursor for pagination (last item ID)"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false,"description":"Number of items per page"},{"schema":{"type":"string","enum":["pending","success","failed","dead_letter"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"deprecated":true,"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"webhookId":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","success","failed","dead_letter"]},"attemptCount":{"type":"integer"},"responseStatus":{"type":"integer","nullable":true},"errorMessage":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/webhooks/{webhookId}/deliveries/{id}/retry":{"post":{"tags":["Webhooks"],"description":"Retry a failed webhook delivery. DEPRECATED — use POST /api/v1/webhook-endpoints (signed, Stripe-style) instead. This legacy endpoint no longer delivers events.","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"webhookId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"deprecated":true,"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"webhookId":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","success","failed","dead_letter"]},"attemptCount":{"type":"integer"},"responseStatus":{"type":"integer","nullable":true},"errorMessage":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/extensions":{"post":{"tags":["Extensions"],"description":"Register a new extension","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","slug","scopes"],"properties":{"name":{"type":"string","maxLength":100},"slug":{"type":"string","pattern":"^[a-z0-9-]+$","maxLength":100},"description":{"type":"string","maxLength":5000},"version":{"type":"string"},"author":{"type":"string"},"iconUrl":{"type":"string","format":"uri"},"homepageUrl":{"type":"string","format":"uri"},"scopes":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Permission scopes the extension requires"},"eventSubscriptions":{"type":"array","items":{"type":"string"},"description":"Webhook event types the extension subscribes to"},"iframeUrl":{"type":"string","format":"uri","description":"HTTPS URL to embed as an iframe panel in the dashboard"},"webhookUrl":{"type":"string","format":"uri","description":"HTTPS endpoint that receives subscribed events"},"configSchema":{"type":"object","additionalProperties":true,"description":"JSON Schema defining accepted configuration"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string","nullable":true},"version":{"type":"string"},"author":{"type":"string","nullable":true},"iconUrl":{"type":"string","format":"uri","nullable":true},"homepageUrl":{"type":"string","format":"uri","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"eventSubscriptions":{"type":"array","items":{"type":"string"}},"iframeUrl":{"type":"string","format":"uri","nullable":true},"webhookUrl":{"type":"string","format":"uri","nullable":true},"configSchema":{"type":"object","additionalProperties":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"tags":["Extensions"],"description":"List available extensions","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Cursor for pagination (last item ID)"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false,"description":"Number of items per page"},{"schema":{"type":"string","maxLength":100},"in":"query","name":"q","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"installable","required":false},{"schema":{"type":"string","enum":["draft","private","public"]},"in":"query","name":"lifecycle","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string","nullable":true},"version":{"type":"string"},"author":{"type":"string","nullable":true},"iconUrl":{"type":"string","format":"uri","nullable":true},"homepageUrl":{"type":"string","format":"uri","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"eventSubscriptions":{"type":"array","items":{"type":"string"}},"iframeUrl":{"type":"string","format":"uri","nullable":true},"webhookUrl":{"type":"string","format":"uri","nullable":true},"configSchema":{"type":"object","additionalProperties":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/extensions/{id}":{"get":{"tags":["Extensions"],"description":"Get extension by ID","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string","nullable":true},"version":{"type":"string"},"author":{"type":"string","nullable":true},"iconUrl":{"type":"string","format":"uri","nullable":true},"homepageUrl":{"type":"string","format":"uri","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"eventSubscriptions":{"type":"array","items":{"type":"string"}},"iframeUrl":{"type":"string","format":"uri","nullable":true},"webhookUrl":{"type":"string","format":"uri","nullable":true},"configSchema":{"type":"object","additionalProperties":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"patch":{"tags":["Extensions"],"description":"Update extension metadata","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"iconUrl":{"type":"string","format":"uri"},"homepageUrl":{"type":"string","format":"uri"},"scopes":{"type":"array","items":{"type":"string"}},"eventSubscriptions":{"type":"array","items":{"type":"string"}},"iframeUrl":{"type":"string","format":"uri"},"webhookUrl":{"type":"string","format":"uri"},"configSchema":{"type":"object","additionalProperties":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string","nullable":true},"version":{"type":"string"},"author":{"type":"string","nullable":true},"iconUrl":{"type":"string","format":"uri","nullable":true},"homepageUrl":{"type":"string","format":"uri","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"eventSubscriptions":{"type":"array","items":{"type":"string"}},"iframeUrl":{"type":"string","format":"uri","nullable":true},"webhookUrl":{"type":"string","format":"uri","nullable":true},"configSchema":{"type":"object","additionalProperties":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"delete":{"tags":["Extensions"],"description":"Delete an extension","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/extensions/{id}/versions":{"post":{"tags":["Extensions"],"description":"Create a new draft version of an extension by snapshotting the current working-copy manifest","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["version"],"properties":{"version":{"type":"string","maxLength":50,"description":"Semantic version string, e.g. \"1.2.0\""},"changelog":{"type":"string","maxLength":2000,"description":"Human-readable changelog for this version"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"extensionId":{"type":"string","format":"uuid"},"version":{"type":"string"},"status":{"type":"string","enum":["draft","published"]},"changelog":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"eventSubscriptions":{"type":"array","items":{"type":"string"}},"iframeUrl":{"type":"string","format":"uri","nullable":true},"webhookUrl":{"type":"string","format":"uri","nullable":true},"configSchema":{"type":"object","additionalProperties":true},"publishedAt":{"type":"string","format":"date-time","nullable":true},"publishedBy":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"get":{"tags":["Extensions"],"description":"List versions for an extension, ordered newest first","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"extensionId":{"type":"string","format":"uuid"},"version":{"type":"string"},"status":{"type":"string","enum":["draft","published"]},"changelog":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"eventSubscriptions":{"type":"array","items":{"type":"string"}},"iframeUrl":{"type":"string","format":"uri","nullable":true},"webhookUrl":{"type":"string","format":"uri","nullable":true},"configSchema":{"type":"object","additionalProperties":true},"publishedAt":{"type":"string","format":"date-time","nullable":true},"publishedBy":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}}}},"required":["versions"]},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/extensions/{id}/versions/{vid}/publish":{"post":{"tags":["Extensions"],"description":"Publish a draft version of an extension","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"extensionId":{"type":"string","format":"uuid"},"version":{"type":"string"},"status":{"type":"string","enum":["draft","published"]},"changelog":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"eventSubscriptions":{"type":"array","items":{"type":"string"}},"iframeUrl":{"type":"string","format":"uri","nullable":true},"webhookUrl":{"type":"string","format":"uri","nullable":true},"configSchema":{"type":"object","additionalProperties":true},"publishedAt":{"type":"string","format":"date-time","nullable":true},"publishedBy":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/extensions/{id}/lifecycle":{"post":{"tags":["Extensions"],"description":"Update the lifecycle state of an extension (draft → private → public)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["lifecycle"],"properties":{"lifecycle":{"type":"string","enum":["draft","private","public"]}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string","nullable":true},"version":{"type":"string"},"author":{"type":"string","nullable":true},"iconUrl":{"type":"string","format":"uri","nullable":true},"homepageUrl":{"type":"string","format":"uri","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"eventSubscriptions":{"type":"array","items":{"type":"string"}},"iframeUrl":{"type":"string","format":"uri","nullable":true},"webhookUrl":{"type":"string","format":"uri","nullable":true},"configSchema":{"type":"object","additionalProperties":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/extensions/{id}/install":{"post":{"tags":["Extensions"],"description":"Install an extension for the organization. Returns a one-time API key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"versionId":{"type":"string","format":"uuid","description":"Specific version to pin. Omit to use the latest published version."},"config":{"type":"object","additionalProperties":true,"description":"Configuration values for this installation"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"extensionId":{"type":"string","format":"uuid"},"extensionName":{"type":"string","nullable":true},"extensionSlug":{"type":"string","nullable":true},"extensionIconUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","suspended","uninstalled"]},"config":{"type":"object","additionalProperties":true},"environmentId":{"type":"string","format":"uuid"},"environmentSlug":{"type":"string","nullable":true},"environmentKind":{"type":"string","enum":["production","non_production"],"nullable":true},"providerEnvironment":{"type":"string","enum":["production","sandbox"],"nullable":true},"apiKeyId":{"type":"string","format":"uuid","nullable":true},"installedAt":{"type":"string","format":"date-time"},"uninstalledAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"},"apiKey":{"type":"string","description":"Raw API key (shown once)"},"webhookSigningSecret":{"type":"string","description":"Raw webhook signing secret (shown once when a managed webhook endpoint is created)","nullable":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/extensions/{id}/uninstall":{"post":{"tags":["Extensions"],"description":"Uninstall an extension (deactivates API key and webhooks)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/extensions/{id}/suspend":{"post":{"tags":["Extensions"],"description":"Suspend an installed extension (deactivates API key and webhooks, can be reinstalled)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"extensionId":{"type":"string","format":"uuid"},"extensionName":{"type":"string","nullable":true},"extensionSlug":{"type":"string","nullable":true},"extensionIconUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","suspended","uninstalled"]},"config":{"type":"object","additionalProperties":true},"environmentId":{"type":"string","format":"uuid"},"environmentSlug":{"type":"string","nullable":true},"environmentKind":{"type":"string","enum":["production","non_production"],"nullable":true},"providerEnvironment":{"type":"string","enum":["production","sandbox"],"nullable":true},"apiKeyId":{"type":"string","format":"uuid","nullable":true},"installedAt":{"type":"string","format":"date-time"},"uninstalledAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/installations/{id}/config":{"patch":{"tags":["Extensions"],"description":"Update configuration for an installed extension","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["config"],"properties":{"config":{"type":"object","additionalProperties":true}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"extensionId":{"type":"string","format":"uuid"},"extensionName":{"type":"string","nullable":true},"extensionSlug":{"type":"string","nullable":true},"extensionIconUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","suspended","uninstalled"]},"config":{"type":"object","additionalProperties":true},"environmentId":{"type":"string","format":"uuid"},"environmentSlug":{"type":"string","nullable":true},"environmentKind":{"type":"string","enum":["production","non_production"],"nullable":true},"providerEnvironment":{"type":"string","enum":["production","sandbox"],"nullable":true},"apiKeyId":{"type":"string","format":"uuid","nullable":true},"installedAt":{"type":"string","format":"date-time"},"uninstalledAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/installations":{"get":{"tags":["Extensions"],"description":"List installed extensions for the organization","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Cursor for pagination (last item ID)"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false,"description":"Number of items per page"},{"schema":{"type":"string","enum":["active","suspended","uninstalled"]},"in":"query","name":"status","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"extensionId":{"type":"string","format":"uuid"},"extensionName":{"type":"string","nullable":true},"extensionSlug":{"type":"string","nullable":true},"extensionIconUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","suspended","uninstalled"]},"config":{"type":"object","additionalProperties":true},"environmentId":{"type":"string","format":"uuid"},"environmentSlug":{"type":"string","nullable":true},"environmentKind":{"type":"string","enum":["production","non_production"],"nullable":true},"providerEnvironment":{"type":"string","enum":["production","sandbox"],"nullable":true},"apiKeyId":{"type":"string","format":"uuid","nullable":true},"installedAt":{"type":"string","format":"date-time"},"uninstalledAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/installations/{id}/upgrade":{"post":{"tags":["Extensions"],"description":"Upgrade an installation to a target version. Returns 409 if the new version adds scopes that require consent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targetVersionId"],"properties":{"targetVersionId":{"type":"string","format":"uuid","description":"ID of the target extension version to upgrade to"},"acknowledgedNewScopes":{"type":"boolean","description":"Set to true to consent to new scopes added by the target version"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"extensionId":{"type":"string","format":"uuid"},"extensionName":{"type":"string","nullable":true},"extensionSlug":{"type":"string","nullable":true},"extensionIconUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","suspended","uninstalled"]},"config":{"type":"object","additionalProperties":true},"environmentId":{"type":"string","format":"uuid"},"environmentSlug":{"type":"string","nullable":true},"environmentKind":{"type":"string","enum":["production","non_production"],"nullable":true},"providerEnvironment":{"type":"string","enum":["production","sandbox"],"nullable":true},"apiKeyId":{"type":"string","format":"uuid","nullable":true},"installedAt":{"type":"string","format":"date-time"},"uninstalledAt":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata"},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/installations/{id}/launch-token":{"post":{"tags":["Extensions"],"description":"Mint a short-lived RS256 session JWT for an iframe extension. The token carries full installation context and expires in 10 minutes. Re-calling this endpoint refreshes the token (no separate refresh route).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"token":{"type":"string","description":"RS256-signed session JWT"},"expiresAt":{"type":"string","format":"date-time","description":"UTC expiry timestamp"}},"required":["token","expiresAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/installations/{id}/deliveries":{"get":{"tags":["Extensions"],"description":"List webhook deliveries for an extension installation (most recent first)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"endpointId":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"},"eventType":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed","dead_letter"]},"attemptCount":{"type":"integer"},"lastStatus":{"type":"integer","nullable":true},"lastError":{"type":"string","nullable":true},"deliveredAt":{"type":"string","format":"date-time","nullable":true},"environmentId":{"type":"string","format":"uuid"},"replayOf":{"type":"string","format":"uuid","nullable":true},"payload":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"}}}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"hasMore":{"type":"boolean"}},"required":["items","total","limit","offset","hasMore"]},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/installations/{id}/deliveries/{deliveryId}/replay":{"post":{"tags":["Extensions"],"description":"Replay a webhook delivery for an extension installation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"deliveryId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deliveryId":{"type":"string","format":"uuid"},"status":{"type":"string"},"responseStatus":{"type":"integer","nullable":true},"lastError":{"type":"string","nullable":true}},"required":["deliveryId","status"]},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/installations/{id}/test":{"post":{"tags":["Extensions"],"description":"Send a verification ping to an extension installation webhook endpoint","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"integer","nullable":true},"error":{"type":"string","nullable":true}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/extensions/{id}/listing":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/extensions/{id}/readiness":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/extensions/{id}/reviews":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/extensions/{id}/reviews/{sid}":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/extensions/{id}/reviews/{sid}/comments":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/extensions/{id}/reviews/{sid}/withdraw":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/publisher/terms":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/publisher/accept-terms":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/extensions/domains":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/extensions/domains/{id}/verify":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/affiliates/me/code":{"get":{"summary":"Get or create affiliate code","tags":["Affiliates"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/affiliates/me/code/regenerate":{"post":{"summary":"Regenerate affiliate code","tags":["Affiliates"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/affiliates/me/stats":{"get":{"summary":"Get affiliate stats","tags":["Affiliates"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/affiliates/me/signups":{"get":{"summary":"List referred signups","tags":["Affiliates"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/partner/applications":{"post":{"summary":"Apply for partner status","tags":["Partners"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/partner/me/profile":{"get":{"summary":"Get partner profile","tags":["Partners"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/partner/me/referrals":{"get":{"summary":"List partner referrals","tags":["Partners"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/partner/me/seats":{"get":{"summary":"List partner seats in client workspaces","tags":["Partners"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/partner/me/commissions":{"get":{"summary":"Get commission stats","tags":["Partners"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/partner/trials":{"post":{"summary":"Create trial for client","tags":["Partners"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/partner/trials/{referralId}/promote":{"post":{"summary":"Promote client to owner","tags":["Partners"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"referralId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/partner/trials/{referralId}/claim-billing":{"post":{"summary":"Partner claims billing responsibility","tags":["Partners"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"referralId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/partner-seats":{"get":{"summary":"List partner seats on this workspace","tags":["Partner Seats"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/partner-seats/{id}":{"patch":{"summary":"Update seat permissions","tags":["Partner Seats"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Remove a partner seat","tags":["Partner Seats"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/events/{id}":{"get":{"tags":["Events"],"description":"Get a single event by ID","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","description":"e.g. order.created, payment.captured"},"entityType":{"type":"string","description":"e.g. order, payment, customer"},"entityId":{"type":"string","format":"uuid"},"data":{"type":"object","additionalProperties":true},"previousData":{"type":"object","additionalProperties":true,"nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/events":{"get":{"tags":["Events"],"description":"List events (immutable audit log)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Cursor for pagination (last item ID)"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false,"description":"Number of items per page"},{"schema":{"type":"string"},"in":"query","name":"type","required":false,"description":"Filter by event type"},{"schema":{"type":"string"},"in":"query","name":"entityType","required":false,"description":"Filter by entity type"},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"entityId","required":false,"description":"Filter by entity ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","description":"e.g. order.created, payment.captured"},"entityType":{"type":"string","description":"e.g. order, payment, customer"},"entityId":{"type":"string","format":"uuid"},"data":{"type":"object","additionalProperties":true},"previousData":{"type":"object","additionalProperties":true,"nullable":true},"createdAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}}}},"/api/v1/scopes":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/event-types":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/.well-known/extension-jwks.json":{"get":{"responses":{"200":{"description":"Default Response"}}}},"/api/v1/checkout/sessions":{"post":{"tags":["Checkout Sessions"],"description":"Create a new hosted checkout session","responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/checkout/sessions/{id}":{"get":{"tags":["Checkout Sessions"],"description":"Get a checkout session by ID","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["Checkout Sessions"],"description":"Cancel a checkout session","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"}}}},"/api/v1/checkout-sessions/{id}":{"get":{"tags":["Checkout Sessions"],"description":"Get a customer-facing checkout session by ID (public)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/checkout-sessions/{id}/embed-config":{"get":{"tags":["Checkout Sessions"],"description":"Get customer-facing embed config by checkout session ID (public)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/checkout-sessions/{id}/cart":{"get":{"tags":["Checkout Sessions"],"description":"Get a customer-facing checkout session cart by session ID (public)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/checkout-sessions/{id}/calculate":{"post":{"tags":["Checkout Sessions"],"description":"Calculate customer-facing checkout session totals by session ID (public)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/checkout-sessions/{id}/discount":{"post":{"tags":["Checkout Sessions"],"description":"Apply a customer-facing checkout discount by session ID (public)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["Checkout Sessions"],"description":"Remove a customer-facing checkout discount by session ID (public)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/checkout/sessions/{id}/complete":{"post":{"tags":["Checkout Sessions"],"description":"Complete a checkout session","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/checkout-sessions/{id}/complete":{"post":{"tags":["Checkout Sessions"],"description":"Public customer-facing complete","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/providers/{provider}/webhooks/{connectionId}":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"connectionId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/payment-providers/{provider}/webhooks":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"provider","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/payment-providers/{provider}/webhooks/{connectionId}":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"provider","required":true},{"schema":{"type":"string"},"in":"path","name":"connectionId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/checkout-sessions/embed-token":{"post":{"tags":["Payments"],"description":"Mint a Gr4vy Embed token for card capture. The token is scoped to a server-side checkout session.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount","currency"],"properties":{"amount":{"type":"integer","description":"Amount in minor units (e.g. cents)"},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code"},"country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 country code"},"externalCartId":{"type":"string","description":"Optional external cart reference"},"buyerExternalIdentifier":{"type":"string","minLength":1,"description":"Optional Gr4vy buyer external identifier. When set, Gr4vy associates the resulting stored payment method with this buyer so future charges can reference it by id. Required for the platform-billing card-vault flow; omitted for one-shot checkout sessions."},"recurring":{"type":"boolean","description":"When true, this embed captures a card for recurring/merchant-initiated billing: the Gr4vy widget is rendered with paymentSource=recurring + store=true (card-only, vaulted) and the buyer is pinned for re-mint. Requires buyerExternalIdentifier. Defaults to false (one-shot payment showing all enabled methods)."},"addCard":{"type":"boolean","description":"When true (with recurring), the embed is a pure add-a-card flow: checkout-web renders the Gr4vy widget with display='addOnly' (just a new-card form, no stored methods, no checkout framing) and stores the card for the pinned buyer. Use for 'manage payment methods → add card'. Defaults to false."}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"embedToken":{"type":"string"},"checkoutSessionId":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"gr4vyId":{"type":"string"},"merchantAccountId":{"type":"string"},"environment":{"type":"string"},"hostedUrl":{"type":"string"},"embedUrl":{"type":"string"}}},"meta":{"type":"object"}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/checkout-sessions/{id}/embed-token":{"get":{"tags":["Payments"],"description":"Re-mint a Gr4vy Embed JWT for an existing throttle checkout session. Anonymous; the session id is the only secret needed.","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"embedToken":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"gr4vyId":{"type":"string"},"merchantAccountId":{"type":"string"},"gr4vyCheckoutSessionId":{"type":"string"},"buyerExternalIdentifier":{"type":"string"}}},"meta":{"type":"object"}}}}}}}}},"/api/v1/api-keys":{"get":{"summary":"List API keys for the calling merchant","tags":["API Keys"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"post":{"summary":"Create a new API key (Clerk JWT only)","tags":["API Keys"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","scopes"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"scopes":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","minLength":1}}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/api-keys/{id}":{"delete":{"summary":"Revoke (soft-delete) an API key","tags":["API Keys"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/merchants/me":{"get":{"summary":"Get current merchant","tags":["Merchants"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"patch":{"summary":"Update merchant display name. Pass `logoUrl: null` to clear the logo. To set a logo, use POST /v1/merchants/me/logo.","tags":["Merchant"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"logoUrl":{"type":"null"}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/checkout-sessions/{id}/payment-methods":{"get":{"summary":"List payment methods available for a checkout session (public)","tags":["Checkout Sessions"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/connectors":{"get":{"summary":"List configured connectors for the calling merchant","tags":["Connectors"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"post":{"summary":"Create a new connector for the calling merchant","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["paymentServiceDefinitionId","displayName","fields"],"additionalProperties":false,"properties":{"paymentServiceDefinitionId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1,"maxLength":200},"fields":{"type":"array","items":{"type":"object","required":["key","value"],"additionalProperties":false,"properties":{"key":{"type":"string"},"value":{}}}},"acceptedCountries":{"type":"array","items":{"type":"string","minLength":2,"maxLength":2}},"acceptedCurrencies":{"type":"array","items":{"type":"string","minLength":3,"maxLength":3}},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/connectors/available":{"get":{"summary":"List available connector types","tags":["Connectors"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/connectors/{id}":{"get":{"summary":"Get a configured connector by id","tags":["Connectors"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update a connector for the calling merchant","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"paymentServiceDefinitionId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1,"maxLength":200},"fields":{"type":"array","items":{"type":"object","required":["key","value"],"additionalProperties":false,"properties":{"key":{"type":"string"},"value":{}}}},"acceptedCountries":{"type":"array","items":{"type":"string","minLength":2,"maxLength":2}},"acceptedCurrencies":{"type":"array","items":{"type":"string","minLength":3,"maxLength":3}},"active":{"type":"boolean"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a connector for the calling merchant","tags":["Connectors"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/payment-routing":{"get":{"summary":"Get the card-transaction routing config","tags":["Connectors"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"put":{"summary":"Replace the card-transaction routing config","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rules","defaultCascade"],"additionalProperties":false,"properties":{"defaultCascade":{"type":"array","items":{"type":"string","minLength":1}},"rules":{"type":"array","items":{"type":"object","required":["conditions","cascade"],"additionalProperties":false,"properties":{"conditions":{"type":"array","items":{"type":"object","required":["type"],"additionalProperties":false,"properties":{"type":{"enum":["country","cardScheme","cardSource","cardType","amount","currency","metadata","cardCountry","paymentSource"]},"op":{"type":"string"},"values":{"type":"array","items":{"type":"string","minLength":1}},"currency":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"key":{"type":"string"}}}},"cascade":{"type":"array","items":{"type":"string","minLength":1}}}}}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/routing-connectors":{"get":{"summary":"List connectors eligible for a routing cascade","tags":["Connectors"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/routing-payment-methods":{"get":{"summary":"List Gr4vy payment methods available to routing/decline rules","tags":["Connectors"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/other-routing":{"get":{"summary":"Get the non-card (redirect-transaction) routing config","tags":["Connectors"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"put":{"summary":"Replace the non-card routing config","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rules"],"additionalProperties":false,"properties":{"rules":{"type":"array","items":{"type":"object","required":["method","connections"],"additionalProperties":false,"properties":{"method":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","required":["type"],"additionalProperties":false,"properties":{"type":{"enum":["country","cardScheme","cardSource","cardType","amount","metadata","currency","paymentMethod","cardCountry"]},"op":{"type":"string"},"values":{"type":"array","items":{"type":"string","minLength":1}},"currency":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"key":{"type":"string"}}}},"connections":{"type":"array","items":{"type":"string","minLength":1}}}}}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/card-decline":{"get":{"summary":"Get the card-transaction decline rules","tags":["Connectors"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"put":{"summary":"Replace the card-transaction decline rules","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rules"],"additionalProperties":false,"properties":{"rules":{"type":"array","items":{"type":"object","required":["conditions"],"additionalProperties":false,"properties":{"conditions":{"type":"array","items":{"type":"object","required":["type"],"additionalProperties":false,"properties":{"type":{"enum":["country","cardScheme","cardSource","cardType","amount","metadata","currency","paymentMethod","cardCountry"]},"op":{"type":"string"},"values":{"type":"array","items":{"type":"string","minLength":1}},"currency":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"key":{"type":"string"}}}},"errorCode":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/other-decline":{"get":{"summary":"Get the non-card (other) decline rules","tags":["Connectors"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"put":{"summary":"Replace the non-card (other) decline rules","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rules"],"additionalProperties":false,"properties":{"rules":{"type":"array","items":{"type":"object","required":["conditions"],"additionalProperties":false,"properties":{"conditions":{"type":"array","items":{"type":"object","required":["type"],"additionalProperties":false,"properties":{"type":{"enum":["country","cardScheme","cardSource","cardType","amount","metadata","currency","paymentMethod","cardCountry"]},"op":{"type":"string"},"values":{"type":"array","items":{"type":"string","minLength":1}},"currency":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"key":{"type":"string"}}}},"errorCode":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/connectors/stripe/install-link":{"post":{"summary":"Begin Stripe one-click connect","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/connectors/stripe/connect-key":{"post":{"summary":"Complete Stripe connect by pasting the restricted key","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["secretKey"],"additionalProperties":false,"properties":{"secretKey":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/connectors/stripe/finalize":{"post":{"summary":"Finalize Stripe one-click connect","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["accountId","stripeUserId","state","installSignature","livemode"],"additionalProperties":false,"properties":{"accountId":{"type":"string","minLength":1},"stripeUserId":{"type":"string","minLength":1},"state":{"type":"string","minLength":1},"installSignature":{"type":"string","minLength":1},"livemode":{"type":"boolean"},"extraFields":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/stripe-app/webhooks":{"post":{"summary":"Inbound Stripe App webhook (uninstall handling)","tags":["Connectors"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/payment-methods":{"get":{"summary":"List active payment methods derived from configured connectors","tags":["Payment Methods"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"query","name":"customerId","required":false},{"schema":{"type":"integer"},"in":"query","name":"cartTotal","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/payment-methods/tokenise":{"post":{"summary":"Tokenise a raw card into a Gr4vy payment method","tags":["Payment Methods"],"description":"Accepts a raw card number + CVV + expiry and stores it as a Gr4vy PaymentMethod on the calling workspace's active Gr4vy connection. Returns an opaque paymentMethodToken suitable for passing to POST /v1/billing/subscribe.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pan","cvv","expMonth","expYear"],"additionalProperties":false,"properties":{"pan":{"type":"string","minLength":13,"maxLength":19,"description":"Raw card number (digits only)"},"cvv":{"type":"string","minLength":3,"maxLength":4,"description":"Card security code"},"expMonth":{"description":"Expiry month (1-12 or \"01\"-\"12\")"},"expYear":{"description":"Expiry year (YY or YYYY)"},"cardholderName":{"type":"string","description":"Optional cardholder name"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"token":{"type":"string"},"paymentMethodToken":{"type":"string"},"paymentMethodId":{"type":"string"},"last4":{"type":"string"},"brand":{"type":"string"}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/bigcommerce/connections":{"get":{"summary":"List BigCommerce connections for the calling merchant","tags":["BigCommerce"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/bigcommerce/connect":{"post":{"summary":"Connect a BC store via static credentials","tags":["BigCommerce"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["storeHash","accessToken"],"additionalProperties":false,"properties":{"storeHash":{"type":"string","minLength":4,"maxLength":64},"accessToken":{"type":"string","minLength":10}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/bigcommerce/connections/{id}/retry":{"post":{"summary":"Retry webhook registration for a setup_failed connection","tags":["BigCommerce"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/bigcommerce/connections/{id}":{"delete":{"summary":"Disconnect a BC store (soft-delete; 90-day cron hard-deletes after retention)","tags":["BigCommerce"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/webhook-endpoints":{"get":{"summary":"List configured outbound webhook endpoints","tags":["Webhooks: Outbound"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"post":{"summary":"Create an outbound webhook endpoint","tags":["Webhooks: Outbound"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","enabledEvents"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","pattern":"^https://"},"enabledEvents":{"type":"array","items":{"type":"string","enum":["cart.created","cart.updated","cart.item_added","cart.item_updated","cart.item_removed","cart.shipping_selected","cart.shipping_cleared","cart.discount_applied","cart.discount_removed","cart.tax_recomputed","cart.checkout_started","cart.converted","cart.abandoned","cart.expired","cart.merged","order.created","order.updated","order.completed","order.cancelled","order.closed","order.sync_failed","order.sync_conflict","payment.pending","payment.authorized","payment.authorization_failed","payment.captured","payment.capture_failed","payment.failed","payment.voided","payment.void_failed","payment.refunded","payment.partially_refunded","payment.refund_failed","payment.vaulted","payment.disputed","payment.dispute_cleared","fulfillment.created","fulfillment.completed","fulfillment.cancelled","fulfillment.shipment.shipped","fulfillment.shipment.delivered","subscription.created","subscription.activated","subscription.updated","subscription.plan_changed","subscription.plan_change_scheduled","subscription.paused","subscription.resumed","subscription.cancelled","subscription.renewed","subscription.past_due","subscription.payment_failed","subscription.create_failed","subscription.trial_blocked","discount.applied","discount.removed","customer.created","customer.updated","customer.deleted","customer.payment_method_added","customer.payment_method_removed","invoice.past_due","shipping_tax.provider_connection.unhealthy","workspace.payment_method.added","workspace.payment_method.removed","workspace.payment_method.default_changed","workspace.payment_method.backup_set","workspace.payment_method.backup_used","workspace.platform_charge.succeeded","workspace.platform_charge.failed","workspace.trial_expired","extension.review.submitted","extension.review.approved","extension.review.changes_requested","extension.review.rejected","extension.review.comment_added","extension.review.auto_approved","extension.published_public","extension.unpublished"]},"minItems":1,"uniqueItems":true}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/webhook-endpoints/{id}":{"patch":{"summary":"Update a webhook endpoint (URL, events, or active flag)","tags":["Webhooks: Outbound"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"url":{"type":"string","format":"uri","pattern":"^https://"},"enabledEvents":{"type":"array","items":{"type":"string","enum":["cart.created","cart.updated","cart.item_added","cart.item_updated","cart.item_removed","cart.shipping_selected","cart.shipping_cleared","cart.discount_applied","cart.discount_removed","cart.tax_recomputed","cart.checkout_started","cart.converted","cart.abandoned","cart.expired","cart.merged","order.created","order.updated","order.completed","order.cancelled","order.closed","order.sync_failed","order.sync_conflict","payment.pending","payment.authorized","payment.authorization_failed","payment.captured","payment.capture_failed","payment.failed","payment.voided","payment.void_failed","payment.refunded","payment.partially_refunded","payment.refund_failed","payment.vaulted","payment.disputed","payment.dispute_cleared","fulfillment.created","fulfillment.completed","fulfillment.cancelled","fulfillment.shipment.shipped","fulfillment.shipment.delivered","subscription.created","subscription.activated","subscription.updated","subscription.plan_changed","subscription.plan_change_scheduled","subscription.paused","subscription.resumed","subscription.cancelled","subscription.renewed","subscription.past_due","subscription.payment_failed","subscription.create_failed","subscription.trial_blocked","discount.applied","discount.removed","customer.created","customer.updated","customer.deleted","customer.payment_method_added","customer.payment_method_removed","invoice.past_due","shipping_tax.provider_connection.unhealthy","workspace.payment_method.added","workspace.payment_method.removed","workspace.payment_method.default_changed","workspace.payment_method.backup_set","workspace.payment_method.backup_used","workspace.platform_charge.succeeded","workspace.platform_charge.failed","workspace.trial_expired","extension.review.submitted","extension.review.approved","extension.review.changes_requested","extension.review.rejected","extension.review.comment_added","extension.review.auto_approved","extension.published_public","extension.unpublished"]},"minItems":1,"uniqueItems":true},"isActive":{"type":"boolean"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Soft-delete a webhook endpoint (sets deletedAt; excludes from list and dispatch)","tags":["Webhooks: Outbound"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/webhook-endpoints/{id}/rotate-secret":{"post":{"summary":"Rotate the signing secret for a webhook endpoint (reveal-once).","tags":["Webhooks: Outbound"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/webhook-deliveries":{"get":{"summary":"Recent webhook delivery attempts (debug / audit log). Paginated via limit + offset.","tags":["Webhooks: Outbound"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"query","name":"endpointId","required":false},{"schema":{"type":"string"},"in":"query","name":"orderId","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/webhook-endpoints/{id}/test":{"post":{"summary":"Send a synthetic, signed test delivery to this endpoint.","tags":["Webhooks: Outbound"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"eventType":{"type":"string","enum":["cart.created","cart.updated","cart.item_added","cart.item_updated","cart.item_removed","cart.shipping_selected","cart.shipping_cleared","cart.discount_applied","cart.discount_removed","cart.tax_recomputed","cart.checkout_started","cart.converted","cart.abandoned","cart.expired","cart.merged","order.created","order.updated","order.completed","order.cancelled","order.closed","order.sync_failed","order.sync_conflict","payment.pending","payment.authorized","payment.authorization_failed","payment.captured","payment.capture_failed","payment.failed","payment.voided","payment.void_failed","payment.refunded","payment.partially_refunded","payment.refund_failed","payment.vaulted","payment.disputed","payment.dispute_cleared","fulfillment.created","fulfillment.completed","fulfillment.cancelled","fulfillment.shipment.shipped","fulfillment.shipment.delivered","subscription.created","subscription.activated","subscription.updated","subscription.plan_changed","subscription.plan_change_scheduled","subscription.paused","subscription.resumed","subscription.cancelled","subscription.renewed","subscription.past_due","subscription.payment_failed","subscription.create_failed","subscription.trial_blocked","discount.applied","discount.removed","customer.created","customer.updated","customer.deleted","customer.payment_method_added","customer.payment_method_removed","invoice.past_due","shipping_tax.provider_connection.unhealthy","workspace.payment_method.added","workspace.payment_method.removed","workspace.payment_method.default_changed","workspace.payment_method.backup_set","workspace.payment_method.backup_used","workspace.platform_charge.succeeded","workspace.platform_charge.failed","workspace.trial_expired","extension.review.submitted","extension.review.approved","extension.review.changes_requested","extension.review.rejected","extension.review.comment_added","extension.review.auto_approved","extension.published_public","extension.unpublished"]}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/webhook-deliveries/{id}/replay":{"post":{"summary":"Replay a delivery (re-fires same payload with new signature).","tags":["Webhooks: Outbound"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/merchants/me/external-cart-ack":{"post":{"summary":"Mark this merchant as a non-BC (\"external cart\") merchant so onboarding can complete.","tags":["Merchant"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/merchants/me/finish-onboarding":{"post":{"summary":"Mark the merchant as having finished the onboarding wizard.","tags":["Merchant"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/merchants/me/settings/net30":{"patch":{"summary":"Update Net30 invoice billing settings.","tags":["Merchant"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"invoicePrefix":{"type":"string","minLength":3,"maxLength":10,"pattern":"^[A-Z0-9]+$"},"defaultNetDays":{"type":"integer","minimum":0,"maximum":365},"termsText":{"type":["string","null"],"maxLength":5000}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/merchants/me/logo":{"post":{"summary":"Upload a merchant logo (multipart/form-data, field: logo).","tags":["Merchant"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/workspaces/{workspaceId}/applications/{applicationId}/logo":{"post":{"summary":"Upload an application logo.","tags":["Applications"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete an application logo.","tags":["Applications"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/email/asset-upload":{"post":{"summary":"Upload an image asset for inline use in an email template (multipart, field: file).","tags":["Email Templates"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/extensions/icon-upload":{"post":{"summary":"Upload an extension icon (multipart/form-data, field: file).","tags":["Extensions"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/extensions/screenshot-upload":{"post":{"summary":"Upload a marketplace listing screenshot (multipart/form-data, field: file).","tags":["Extensions"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/assets/{*}":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/audit-log":{"get":{"summary":"Recent admin actions taken on this merchant","tags":["Audit"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"environmentId","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/fulfillments/{id}/digital/upload":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/fulfillments/{id}/digital/download":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/payments/{id}/invoice/download":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/net30/connection":{"get":{"summary":"Get the calling merchant's Net30 connection","tags":["Connectors"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"post":{"summary":"Create the calling merchant's Net30 connection","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["invoicePrefix","defaultNetDays","enabled"],"additionalProperties":false,"properties":{"invoicePrefix":{"type":"string","minLength":3,"maxLength":10,"pattern":"^[A-Z0-9]{3,10}$"},"defaultNetDays":{"type":"integer","minimum":0,"maximum":365},"termsText":{"type":["string","null"],"maxLength":5000},"maxOrderTotal":{"type":["number","null"],"minimum":0},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/net30/connection/{id}":{"patch":{"summary":"Update the calling merchant's Net30 connection","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"invoicePrefix":{"type":"string","minLength":3,"maxLength":10,"pattern":"^[A-Z0-9]{3,10}$"},"defaultNetDays":{"type":"integer","minimum":0,"maximum":365},"termsText":{"type":["string","null"],"maxLength":5000},"maxOrderTotal":{"type":["number","null"],"minimum":0},"enabled":{"type":"boolean"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Soft-delete (disable) the calling merchant's Net30 connection","tags":["Connectors"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/net30/eligible-customers":{"get":{"summary":"List the calling merchant's Net30 eligible customers","tags":["Connectors"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"post":{"summary":"Add a customer to the Net30 eligible allowlist","tags":["Connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId"],"additionalProperties":false,"properties":{"customerId":{"type":"string","format":"uuid"},"notes":{"type":"string","maxLength":1000}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/net30/eligible-customers/{customerId}":{"delete":{"summary":"Remove a customer from the Net30 eligible allowlist","tags":["Connectors"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"customerId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/payments/{id}/notes":{"patch":{"summary":"Update free-text notes on a payment (5000 char max).","tags":["Payments"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["notes"],"additionalProperties":false,"properties":{"notes":{"type":["string","null"],"maxLength":5000}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/payments/{id}/dispute":{"post":{"summary":"Open a dispute on a Net30 payment.","tags":["Payments"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reason"],"additionalProperties":false,"properties":{"reason":{"type":"string","minLength":1,"maxLength":500}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/payments/{id}/dispute/clear":{"post":{"summary":"Clear an open dispute on a payment (leaves reason + opened_at for audit).","tags":["Payments"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/payments/{id}/backdate-due-date":{"post":{"summary":"Backdate metadata.dueDate so a Net-N invoice falls into a specific aging bucket. Demo/test tool only.","tags":["Payments"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["daysPastDue"],"additionalProperties":false,"properties":{"daysPastDue":{"type":"integer","minimum":1,"maximum":365}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/invoices/aging":{"get":{"summary":"AR aging report: outstanding Net30 payments bucketed by days past due.","tags":["Payments"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/embed-config":{"get":{"summary":"Get the merchant embed config (allowlisted parent origins + branding)","tags":["Embed"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"allowedOrigins":{"type":"array","items":{"type":"string"}},"primaryColor":{"type":["null","string"]},"logoUrl":{"type":["null","string"]},"merchantName":{"type":["null","string"]},"storefrontBaseUrl":{"type":["null","string"]},"cartRecoveryUrlTemplate":{"type":["null","string"]},"cartAbandonmentThresholdMinutes":{"type":["null","integer"]}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"put":{"summary":"Update the merchant embed config","tags":["Embed"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"allowedOrigins":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"uniqueItems":true},"primaryColor":{"type":"string"},"logoUrl":{"type":"string","format":"uri"},"merchantName":{"type":"string","minLength":1,"maxLength":100},"storefrontBaseUrl":{"type":["string","null"],"description":"Absolute base URL of your storefront (e.g. \"https://yourstore.com\"). Relative line-item imageUrls are resolved against it. Pass null to clear; when unset, the first allowedOrigin is used."},"cartRecoveryUrlTemplate":{"type":["string","null"],"description":"Absolute https URL template used to build the recovery link in abandoned-cart emails. Must contain a \"{cartId}\" placeholder, e.g. \"https://yourstore.com/cart?c={cartId}\". Pass null to clear; when unset, abandoned carts are recovered via the cart.abandoned webhook only (no recovery email)."},"cartAbandonmentThresholdMinutes":{"type":["integer","null"],"description":"Minutes of inactivity before an open/checkout cart is treated as abandoned by the sweep. Range 15–129600 (90 days). Pass null to clear; when unset, the platform default of 1440 (24h) applies."}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/v1/clerk/webhooks/user-created":{"post":{"summary":"Clerk user.created webhook (Svix-verified)","tags":["Webhooks: Inbound"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/v1/resend/webhooks":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/email/templates":{"get":{"summary":"List all email template definitions with merchant overrides","tags":["Email Templates"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/email/templates/{key}":{"get":{"summary":"Get a single email template definition with merchant override","tags":["Email Templates"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"key","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Upsert a merchant override for an email template","tags":["Email Templates"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"key","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete merchant override for an email template (reset to default)","tags":["Email Templates"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"key","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/email/templates/{key}/preview":{"post":{"summary":"Render a template with sample data for preview","tags":["Email Templates"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"key","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/email/test-send":{"post":{"summary":"Send a test email to the authenticated admin (bypasses opt-out + cooldown)","tags":["Email Templates"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/applications/{applicationId}/email/templates":{"get":{"summary":"List application email template definitions with application overrides","tags":["Application Email Templates"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/applications/{applicationId}/email/templates/{key}":{"get":{"summary":"Get an application email template definition with application override","tags":["Application Email Templates"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true},{"schema":{"type":"string"},"in":"path","name":"key","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Upsert an application override for an email template","tags":["Application Email Templates"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true},{"schema":{"type":"string"},"in":"path","name":"key","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete application override for an email template","tags":["Application Email Templates"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true},{"schema":{"type":"string"},"in":"path","name":"key","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/applications/{applicationId}/email/templates/{key}/preview":{"post":{"summary":"Render an application template with sample data for preview","tags":["Application Email Templates"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true},{"schema":{"type":"string"},"in":"path","name":"key","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/applications/{applicationId}/email/test-send":{"post":{"summary":"Send an application-scoped test email to the authenticated admin","tags":["Application Email Templates"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/applications/{applicationId}/email/messages":{"get":{"summary":"List recent email messages for the application","tags":["Application Email Templates"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/email/messages":{"get":{"summary":"List recent email messages for the merchant","tags":["Email Templates"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/merchants/me/email-settings":{"patch":{"summary":"Update workspace email settings","tags":["Email Settings"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"summary":"Get workspace email settings","tags":["Email Settings"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/merchants/me/members/{id}/preferences":{"patch":{"summary":"Update per-member email preferences","tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/applications/{applicationId}/email-settings":{"get":{"summary":"Get application email settings","tags":["Application Email Settings"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update application email settings","tags":["Application Email Settings"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/email/sender-domain":{"post":{"summary":"Register a custom sending domain via Resend","tags":["Email Settings"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"summary":"Get the current custom sending domain state","tags":["Email Settings"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"delete":{"summary":"Disconnect and remove the custom sending domain","tags":["Email Settings"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/email/sender-domain/verify":{"post":{"summary":"Trigger a domain verification check via Resend","tags":["Email Settings"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/applications/{applicationId}/email/sender-domain":{"post":{"summary":"Register an application custom sending domain via Resend","tags":["Application Email Settings"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"Get the current application custom sending domain state","tags":["Application Email Settings"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Disconnect and remove the application custom sending domain","tags":["Application Email Settings"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/applications/{applicationId}/email/sender-domain/verify":{"post":{"summary":"Trigger an application domain verification check via Resend","tags":["Application Email Settings"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/merchants/me/invites":{"post":{"summary":"[legacy] Invite a team member (delegates to team-service)","tags":["Team"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"summary":"[legacy] List merchant team members","tags":["Team"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/merchants/me/invites/{id}/resend":{"post":{"summary":"[legacy] Resend an invite","tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/merchants/me/invites/{id}/revoke":{"post":{"summary":"[legacy] Revoke an invite or remove a member","tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{workspaceId}/invites":{"post":{"summary":"Create a team invite","tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{workspaceId}/invites/{id}/resend":{"post":{"tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{workspaceId}/invites/{id}/revoke":{"post":{"tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/invites/accept":{"post":{"tags":["Team"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/invites/pending":{"get":{"tags":["Team"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/workspaces/{workspaceId}/members":{"get":{"tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{workspaceId}/members/me":{"get":{"tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{workspaceId}/members/{memberId}":{"patch":{"tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"memberId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"memberId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{workspaceId}/members/{memberId}/applications/{applicationId}":{"delete":{"tags":["Team"],"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"memberId","required":true},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/auth/permissions":{"get":{"tags":["Auth"],"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/notifications/unread-count":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/notifications":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/notifications/{id}/read":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/notifications/{id}/unread":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/notifications/{id}/archive":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/notifications/read-all":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/me/preferences":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"patch":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/workspaces/{wsId}/support/tickets":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"wsId","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"wsId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{wsId}/support/tickets/{id}":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"wsId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{wsId}/support/tickets/{id}/comments":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"wsId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{wsId}/support/tickets/{id}/read":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"wsId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{wsId}/support/unread-count":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"wsId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{wsId}/support/attachments/presign":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"wsId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{wsId}/support/attachments/{attachmentId}/confirm":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"wsId","required":true},{"schema":{"type":"string"},"in":"path","name":"attachmentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/support/dispatch-webhook":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/workspaces":{"post":{"tags":["Workspaces"],"description":"Create a new workspace; the calling user becomes owner","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","slug"],"properties":{"name":{"type":"string","minLength":1},"slug":{"type":"string","pattern":"^[a-z0-9-]+$","description":"URL-safe identifier, globally unique"},"email":{"type":"string","description":"Owner email (used for member row); falls back to empty string if omitted"}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"get":{"tags":["Workspaces"],"description":"List workspaces the authenticated user is a member of","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workspaceRole":{"type":"string","enum":["owner","workspace_admin","member"]}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/workspaces/{workspaceId}":{"get":{"tags":["Workspaces"],"description":"Get a single workspace by ID (must be a member)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"patch":{"tags":["Workspaces"],"description":"Update workspace name or slug (must be a member)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1},"slug":{"type":"string","pattern":"^[a-z0-9-]+$"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"delete":{"tags":["Workspaces"],"description":"Delete a workspace (must be a member; pass ?force=true to cascade-delete applications)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"force","required":false},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/workspaces/{workspaceId}/environments":{"get":{"tags":["Workspace Environments"],"description":"List workspace environments","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"includeArchived","required":false},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["production","non_production"]},"providerEnvironment":{"type":"string","enum":["production","sandbox"]},"status":{"type":"string","enum":["active","archived"]},"isSystem":{"type":"boolean"},"archivedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"post":{"tags":["Workspace Environments"],"description":"Create a custom non-production sandbox environment","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["slug","name"],"properties":{"slug":{"type":"string","minLength":1,"maxLength":64},"name":{"type":"string","minLength":1,"maxLength":120}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["production","non_production"]},"providerEnvironment":{"type":"string","enum":["production","sandbox"]},"status":{"type":"string","enum":["active","archived"]},"isSystem":{"type":"boolean"},"archivedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/workspaces/{workspaceId}/environments/{environmentId}":{"delete":{"tags":["Workspace Environments"],"description":"Archive a custom workspace environment","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"environmentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["production","non_production"]},"providerEnvironment":{"type":"string","enum":["production","sandbox"]},"status":{"type":"string","enum":["active","archived"]},"isSystem":{"type":"boolean"},"archivedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/workspaces/{id}/go-live":{"post":{"summary":"Flip a sandbox workspace to production. Multi-precondition gated.","tags":["Workspace"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["acceptedProductionTermsAt"],"properties":{"acceptedProductionTermsAt":{"type":"string","format":"date-time"}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/workspaces/{workspaceId}/applications":{"post":{"tags":["Applications"],"description":"Create a new application in a workspace (must be a member)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","slug"],"properties":{"name":{"type":"string","minLength":1},"slug":{"type":"string","pattern":"^[a-z0-9-]+$","description":"URL-safe identifier, unique within the workspace"},"currency":{"type":"string","default":"USD"},"displayName":{"type":["string","null"],"minLength":1,"maxLength":100},"brandColor":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$"},"allowedOrigins":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"uniqueItems":true}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"currency":{"type":"string"},"isActive":{"type":"boolean"},"displayName":{"type":["null","string"]},"logoUrl":{"type":["null","string"]},"brandColor":{"type":["null","string"]},"allowedOrigins":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"get":{"tags":["Applications"],"description":"List applications in a workspace (must be a member)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"currency":{"type":"string"},"isActive":{"type":"boolean"},"displayName":{"type":["null","string"]},"logoUrl":{"type":["null","string"]},"brandColor":{"type":["null","string"]},"allowedOrigins":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/workspaces/{workspaceId}/applications/{applicationId}":{"get":{"tags":["Applications"],"description":"Get a single application by ID (must be a workspace member)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"currency":{"type":"string"},"isActive":{"type":"boolean"},"displayName":{"type":["null","string"]},"logoUrl":{"type":["null","string"]},"brandColor":{"type":["null","string"]},"allowedOrigins":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"patch":{"tags":["Applications"],"description":"Update application name, slug, currency, or isActive (must be a workspace member)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1},"slug":{"type":"string","pattern":"^[a-z0-9-]+$"},"currency":{"type":"string"},"isActive":{"type":"boolean"},"displayName":{"type":["string","null"],"minLength":1,"maxLength":100},"brandColor":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$"},"allowedOrigins":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"uniqueItems":true}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"currency":{"type":"string"},"isActive":{"type":"boolean"},"displayName":{"type":["null","string"]},"logoUrl":{"type":["null","string"]},"brandColor":{"type":["null","string"]},"allowedOrigins":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}}}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}},"delete":{"tags":["Applications"],"description":"Delete an application (must be a workspace member)","parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"workspaceId","required":true},{"schema":{"type":"string"},"in":"path","name":"applicationId","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"meta":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"}}}}}}}}}}},"/api/v1/billing/state":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/billing/subscribe":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["paymentMethodToken"],"additionalProperties":false,"properties":{"paymentMethodToken":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/billing/cancel":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/billing/resume":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/billing/payment-methods":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["paymentMethodToken"],"additionalProperties":false,"properties":{"paymentMethodToken":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/billing/payment-methods/{id}":{"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["primary","backup"]}}}}}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/billing/gr4vy-embed-token":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/billing/provider-status":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/billing/invoices":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/billing/invoices/{id}":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/billing/invoices/{id}/receipt.pdf":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/billing/plan-history":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/billing/overview":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/billing/platform-revenue":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/admin/platform-billing/run-renewal":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/admin/platform-billing/run-dunning":{"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/admin/workspaces":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/admin/workspaces/{id}":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/extend-trial":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/promote-partner":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/demote-partner":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/force-tier-override":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/refund-charge":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/cancel-immediately":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/bring-legacy-into-billing":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/suspend":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/reactivate":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/audit-log":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/me/staff-status":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/admin/staff":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]},"post":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/admin/staff/{email}":{"delete":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"email","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/payment-methods":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/invoices":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/usage":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/subscription-timeline":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/members":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/workspaces/{id}/members/{memberId}":{"patch":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"memberId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"memberId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/extensions/reviews":{"get":{"responses":{"200":{"description":"Default Response"}},"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"}]}},"/api/v1/admin/extensions/reviews/{sid}":{"get":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/extensions/reviews/{sid}/claim":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/extensions/reviews/{sid}/comments":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/extensions/reviews/{sid}/install-candidate":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/extensions/reviews/{sid}/uninstall-candidate":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/extensions/reviews/{sid}/approve":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/extensions/reviews/{sid}/request-changes":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/extensions/reviews/{sid}/reject":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/admin/extensions/{id}/unpublish":{"post":{"parameters":[{"$ref":"#/components/parameters/EnvironmentIdHeader"},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}}},"servers":[{"url":"http://localhost:3000","description":"Local development"}],"security":[{"apiKey":[]},{"bearerAuth":[]}],"tags":[{"name":"Organizations","description":"Organization management"},{"name":"Stores","description":"Store management (multi-store per organization)"},{"name":"Customers","description":"Customer CRUD, addresses, payment methods"},{"name":"Carts","description":"Shopping carts, line items, checkout"},{"name":"Orders","description":"Order lifecycle and state machine"},{"name":"Payments","description":"Payment creation and manual marking (authorize, capture, void, refund)"},{"name":"Fulfillments","description":"Fulfillment management (shipment, digital, access, service, in-person)"},{"name":"Subscriptions","description":"Subscription lifecycle management"},{"name":"Discounts","description":"Discount codes and validation"},{"name":"Webhooks","description":"Webhook registration, delivery tracking, retries"},{"name":"Events","description":"Immutable audit log of all state changes"},{"name":"Extensions","description":"Extension marketplace, installation, and configuration"},{"name":"API Keys","description":"Self-serve API key CRUD (Clerk-authed)"},{"name":"Merchants","description":"Merchant identity and config"},{"name":"Webhooks: Inbound","description":"External webhooks consumed by throttle"},{"name":"Connectors","description":"Per-merchant payment connector CRUD (Gr4vy proxy)"},{"name":"Payment Methods","description":"Aggregated view of payment methods enabled by configured connectors"},{"name":"BigCommerce","description":"BigCommerce store connection (CLI-driven)"},{"name":"Webhooks: Outbound","description":"Per-merchant outbound webhook endpoints + delivery audit log"}]}