Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
697 changes: 697 additions & 0 deletions redo/api-schema/openapi.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions redo/api-schema/src/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ paths:
/stores/{storeId}/customer-portal: { $ref: path/customer-portal.path.yaml }
/stores/{storeId}/customer-subscriptions:
{ $ref: path/customer-subscriptions.path.yaml }
/stores/{storeId}/custom/orders: { $ref: path/custom-order-sync.path.yaml }
/stores/{storeId}/invoices: { $ref: path/return-payout-object-list.path.yaml }
/stores/{storeId}/returns: { $ref: path/returns.path.yaml }
/stores/{storeId}/shipments/buy: { $ref: path/shipment-buy.path.yaml }
Expand Down
51 changes: 51 additions & 0 deletions redo/api-schema/src/path/custom-order-sync.path.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
post:
description: |
Sync a custom order to Redo. This endpoint is used for custom integrations
to push order data into the Redo system.

Important: If Redo protection is attached to this order, include a line item with:
- vendor: "re:do"
- sku: "x-redo"
- tags: "returns", "package protection", or "both"
- properties: _redo_type with value "return", "package protection", or "both"
operationId: Custom Order Sync
parameters:
- $ref: "../param/store-id.param.yaml"
requestBody:
content:
application/json:
schema:
$ref: "../schema/custom-order/custom-order-sync.schema.yaml"
required: true
responses:
"200":
description: Order synced successfully
content:
application/json:
schema:
properties:
orderId:
description: The ID of the synced order
type: string
status:
description: Sync status
type: string
required: [orderId, status]
type: object
"400":
content:
application/problem+json:
schema:
$ref: "../schema/error.schema.yaml"
description: Invalid order data
default:
content:
application/problem+json:
schema:
$ref: "../schema/error.schema.yaml"
description: Error
security:
- Bearer: []
summary: Sync Custom Order
tags:
- Custom Integration
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# $schema: https://json-schema.org/draft/2020-12/schema#
description: Address for custom order integration
properties:
address1:
description: Address line 1
title: Address Line 1
type: string
address2:
description: Address line 2
title: Address Line 2
type: [string, "null"]
city:
description: City
title: City
type: string
company:
description: Company name
title: Company
type: [string, "null"]
firstName:
description: First name
title: First Name
type: [string, "null"]
lastName:
description: Last name
title: Last Name
type: [string, "null"]
provinceCode:
description: Province or state code
title: Province Code
type: string
zip:
description: Postal/ZIP code
title: ZIP
type: string
countryCode:
description: Country code (ISO)
title: Country Code
type: string
phone:
description: Phone number
title: Phone
type: [string, "null"]
required: [address1, city, provinceCode, zip, countryCode]
title: Custom Order Address
type: object
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# $schema: https://json-schema.org/draft/2020-12/schema#
description: Billing address for custom order integration (all fields nullable)
properties:
address1:
description: Address line 1
title: Address Line 1
type: [string, "null"]
address2:
description: Address line 2
title: Address Line 2
type: [string, "null"]
city:
description: City
title: City
type: [string, "null"]
company:
description: Company name
title: Company
type: [string, "null"]
firstName:
description: First name
title: First Name
type: [string, "null"]
lastName:
description: Last name
title: Last Name
type: [string, "null"]
provinceCode:
description: Province or state code
title: Province Code
type: [string, "null"]
zip:
description: Postal/ZIP code
title: ZIP
type: [string, "null"]
countryCode:
description: Country code (ISO)
title: Country Code
type: [string, "null"]
phone:
description: Phone number
title: Phone
type: [string, "null"]
title: Custom Order Billing Address
type: [object, "null"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# $schema: https://json-schema.org/draft/2020-12/schema#
description: Customer information for custom order integration
properties:
email:
description: Customer email address
format: email
title: Email
type: string
phone:
description: Customer phone number
title: Phone
type: [string, "null"]
id:
description: Customer ID in external system
title: ID
type: string
firstName:
description: Customer first name
title: First Name
type: string
lastName:
description: Customer last name
title: Last Name
type: string
tags:
default: []
description: Tags associated with customer
items:
type: string
title: Tags
type: array
required: [email, firstName, lastName]
title: Custom Order Customer
type: object
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# $schema: https://json-schema.org/draft/2020-12/schema#
description: Line item reference in fulfillment
properties:
id:
description: Line item ID
title: ID
type: string
quantity:
description: Quantity fulfilled
title: Quantity
type: number
required: [id, quantity]
title: Fulfillment Line Item
type: object
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# $schema: https://json-schema.org/draft/2020-12/schema#
description: Fulfillment information for custom order integration
properties:
id:
description: Fulfillment ID
title: ID
type: string
trackingNumbers:
default: []
description: Tracking numbers for this fulfillment
items:
$ref: ./custom-order-tracking-number.schema.yaml
title: Tracking Numbers
type: array
trackingUrls:
default: []
description: Tracking URLs
items:
type: string
title: Tracking URLs
type: array
lineItems:
description: Line items included in this fulfillment
items:
$ref: ./custom-order-fulfillment-line-item.schema.yaml
title: Line Items
type: array
shippingDate:
description: Date when shipment was sent
title: Shipping Date
type: [string, "null"]
deliveryDate:
description: Date when shipment was delivered
title: Delivery Date
type: [string, "null"]
required: [id, lineItems]
title: Custom Order Fulfillment
type: object
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# $schema: https://json-schema.org/draft/2020-12/schema#
description: Image associated with a line item
properties:
url:
description: Image URL
title: URL
type: string
data:
description: Base64 encoded image data
title: Data
type: [string, "null"]
required: [url]
title: Line Item Image
type: object
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# $schema: https://json-schema.org/draft/2020-12/schema#
description: Property associated with a line item
properties:
name:
description: Property name
title: Name
type: string
value:
description: Property value
title: Value
type: string
required: [name, value]
title: Line Item Property
type: object
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# $schema: https://json-schema.org/draft/2020-12/schema#
description: Line item for custom order integration
properties:
id:
description: Line item ID
title: ID
type: string
quantity:
description: Quantity ordered
title: Quantity
type: number
priceSet:
$ref: ./money-set.schema.yaml
description: Line item price (pre-tax and pre-discount)
title: Price Set
returnableQuantity:
description: Quantity that can be returned
title: Returnable Quantity
type: [number, "null"]
title:
description: Line item title
title: Title
type: string
variantTitle:
description: Product variant title
title: Variant Title
type: [string, "null"]
vendor:
description: Product vendor (use "re:do" for Redo line items)
title: Vendor
type: [string, "null"]
fulfillmentService:
description: Fulfillment service
title: Fulfillment Service
type: [string, "null"]
productId:
description: Product ID
title: Product ID
type: string
variantId:
description: Variant ID
title: Variant ID
type: [string, "null"]
additionalProductId:
description: Additional product ID
title: Additional Product ID
type: [string, "null"]
sku:
description: SKU (use "x-redo" for Redo line items)
title: SKU
type: string
properties:
default: []
description: Custom properties for line item
items:
$ref: ./custom-order-line-item-property.schema.yaml
title: Properties
type: array
tags:
default: []
description: Tags (use "returns", "package protection", or "both" for Redo items)
items:
type: string
title: Tags
type: array
weight:
description: Item weight
properties:
value:
type: number
unit:
type: string
required: [value, unit]
title: Weight
type: [object, "null"]
image:
description: Primary image URL
title: Image
type: [string, "null"]
images:
default: []
description: Additional images
items:
$ref: ./custom-order-line-item-image.schema.yaml
title: Images
type: array
discounts:
default: []
description: Discounts applied (should account for quantity)
items:
$ref: ./discount.schema.yaml
title: Discounts
type: array
taxLines:
default: []
description: Tax lines (should account for quantity)
items:
$ref: ./tax-line.schema.yaml
title: Tax Lines
type: array
required:
[id, quantity, priceSet, title, productId, sku]
title: Custom Order Line Item
type: object
Loading
Loading