{
    "openapi": "3.1.0",
    "info": {
        "title": "API Overview",
        "version": "2024-07",
        "summary": "API Overview",
        "description": "> OAS Schema can be downloaded [here](https://stoplight.io/api/v1/projects/automizely/docs-api-returnscenter-com-public/nodes/reference/api.json?branch=production/2024-07&deref=optimizedBundle)",
        "contact": {
            "name": "AfterShip Support",
            "url": "https://www.aftership.com/contact-us",
            "email": "support@aftership.com"
        },
        "termsOfService": "https://www.aftership.com/legal/terms-of-service"
    },
    "servers": [
        {
            "url": "https://api.aftership.com/returns/2024-07",
            "description": "API Endpoint"
        }
    ],
    "paths": {
        "/returns/rma/{rma_number}/dropoffs/{dropoff_id}/drops": {
            "parameters": [
                {
                    "schema": {
                        "type": "string"
                    },
                    "name": "rma_number",
                    "in": "path",
                    "required": true
                },
                {
                    "schema": {
                        "type": "string"
                    },
                    "name": "dropoff_id",
                    "description": "This dropoff ID can be found in the QR code generated at AfterShip Returns.",
                    "in": "path",
                    "required": true
                }
            ],
            "post": {
                "summary": "Record dropped-off return items",
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta_20100",
                                            "x-stoplight": {
                                                "id": "5osyuob71ts5h"
                                            }
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Dropoff_drop",
                                            "x-stoplight": {
                                                "id": "5hreiwh469yc9"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "operationId": "post-returns-rma-rma_number-dropoffs-dropoff_id-drops",
                "x-stoplight": {
                    "id": "wsspdoqi8pvre"
                },
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Dropoff_drops_request_post_drop"
                            }
                        }
                    }
                },
                "description": "This endpoint applies to dropoffs powered by AfterShip QR Code: When a shopper drops some return items at the location, the merchant's sytem should scan the QR code, extract the rma_number, dropoff_id, and then call this endpoint to mark the items as dropped.\n\nFor 3rd party droppoff service providers to call this endpoint on behalf of merchant: please note that you need to extract the `organization_id` and use an API Key of that specific organization. ",
                "tags": [
                    "Return Dropoffs"
                ]
            }
        },
        "/returns/{return_id}": {
            "get": {
                "summary": "Get return detail by ID",
                "tags": [
                    "Returns"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta_20000",
                                            "x-stoplight": {
                                                "id": "el0o4rso5a6kq"
                                            }
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Return",
                                            "x-stoplight": {
                                                "id": "ympm52xcp4z4g"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "operationId": "get-returns-return_id",
                "x-stoplight": {
                    "id": "b2nyvcdrrc1vy"
                }
            },
            "parameters": [
                {
                    "schema": {
                        "type": "string"
                    },
                    "name": "return_id",
                    "in": "path",
                    "required": true
                }
            ]
        },
        "/returns/rma/{rma_number}": {
            "parameters": [
                {
                    "schema": {
                        "type": "string"
                    },
                    "name": "rma_number",
                    "in": "path",
                    "required": true
                }
            ],
            "get": {
                "summary": "Get return detail by RMA number",
                "tags": [
                    "Returns"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta_20000",
                                            "x-stoplight": {
                                                "id": "nco31dsog301a"
                                            }
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Return",
                                            "x-stoplight": {
                                                "id": "z8fipngfua8qh"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "operationId": "get-returns-rma-rma_number",
                "x-stoplight": {
                    "id": "0b0ebp5o3529p"
                },
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                }
            }
        },
        "/returns": {
            "get": {
                "summary": "Get returns",
                "tags": [
                    "Returns"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta_20000",
                                            "x-stoplight": {
                                                "id": "lak23lmm39dy8"
                                            }
                                        },
                                        "data": {
                                            "x-stoplight": {
                                                "id": "zstw2s4v48unz"
                                            },
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Return",
                                                "x-stoplight": {
                                                    "id": "g96orlpgvfrbu"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "operationId": "get-returns",
                "x-stoplight": {
                    "id": "wpx1lk91k5ima"
                },
                "parameters": [
                    {
                        "schema": {
                            "type": "number",
                            "maximum": 50,
                            "default": 10
                        },
                        "in": "query",
                        "name": "limit"
                    },
                    {
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2024-01-01T00:00:00Z"
                        },
                        "in": "query",
                        "name": "created_at_max",
                        "description": "The data returned does not include this `created_at_max`, as it is an open interval. The returned data is sorted in descending order based on creation time, so you can always use the `created_at` of the last record for pagination."
                    }
                ]
            }
        }
    },
    "tags": [
        {
            "name": "Returns"
        }
    ],
    "components": {
        "securitySchemes": {
            "as-api-key": {
                "name": "as-api-key",
                "type": "apiKey",
                "in": "header"
            }
        },
        "schemas": {
            "Meta_20000": {
                "x-stoplight": {
                    "id": "lak23lmm39dy8"
                },
                "description": "Meta data object.",
                "type": "object",
                "x-examples": {},
                "examples": [],
                "title": "Meta",
                "x-tags": [
                    "Envelope"
                ],
                "required": [
                    "code",
                    "type",
                    "message"
                ],
                "properties": {
                    "code": {
                        "type": "number",
                        "default": 20000,
                        "example": 20000,
                        "x-stoplight": {
                            "id": "qxyxke3nejh32"
                        }
                    },
                    "type": {
                        "type": "string",
                        "minLength": 1,
                        "x-stoplight": {
                            "id": "9a7ftn28bils7"
                        },
                        "example": "OK"
                    },
                    "message": {
                        "type": "string",
                        "minLength": 1,
                        "x-stoplight": {
                            "id": "pf8hdo8p7yqdz"
                        },
                        "example": "The request was successfully processed by AfterShip."
                    }
                }
            },
            "Meta_20100": {
                "x-stoplight": {
                    "id": "5osyuob71ts5h"
                },
                "description": "Meta data object.",
                "type": "object",
                "x-examples": {},
                "examples": [],
                "title": "Meta",
                "x-tags": [
                    "Envelope"
                ],
                "required": [
                    "code",
                    "type",
                    "message"
                ],
                "properties": {
                    "code": {
                        "type": "number",
                        "default": 20100,
                        "example": 20100,
                        "x-stoplight": {
                            "id": "4mulf0jqqaqdm"
                        }
                    },
                    "type": {
                        "type": "string",
                        "minLength": 1,
                        "x-stoplight": {
                            "id": "emncqaq4949tf"
                        },
                        "example": "Created"
                    },
                    "message": {
                        "type": "string",
                        "minLength": 1,
                        "x-stoplight": {
                            "id": "zr92gwd3jfayh"
                        },
                        "example": "The request has been fulfilled and a new resource has been created."
                    }
                }
            },
            "Dropoff_drops_request_post_drop": {
                "title": "dropoff_drops_request_post_drop",
                "x-stoplight": {
                    "id": "6fgkguamawsn7"
                },
                "type": "object",
                "properties": {
                    "items": {
                        "type": "array",
                        "x-stoplight": {
                            "id": "91x74zkiliwox"
                        },
                        "items": {
                            "$ref": "#/components/schemas/Dropoff_drop_item",
                            "x-stoplight": {
                                "id": "32js15uchnk68"
                            }
                        }
                    },
                    "dropped_at": {
                        "type": "string",
                        "x-stoplight": {
                            "id": "y64hd47deeshb"
                        },
                        "format": "date-time"
                    }
                }
            },
            "Dropoff_drop": {
                "x-stoplight": {
                    "id": "5hreiwh469yc9"
                },
                "title": "dropoff_drop.v2",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "x-stoplight": {
                            "id": "qs584afzsamn0"
                        }
                    },
                    "items": {
                        "x-stoplight": {
                            "id": "3c3tnv4c70phd"
                        },
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Dropoff_drop_item",
                            "x-stoplight": {
                                "id": "0ujwxp64fype8"
                            }
                        }
                    },
                    "dropped_at": {
                        "type": "string",
                        "x-stoplight": {
                            "id": "vmaco91wtu9h4"
                        },
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": "string",
                        "x-stoplight": {
                            "id": "be7jb7f3ioeuh"
                        },
                        "format": "date-time"
                    },
                    "return": {
                        "type": "object",
                        "x-stoplight": {
                            "id": "u3mywmrly96sf"
                        },
                        "properties": {
                            "id": {
                                "type": "string",
                                "x-stoplight": {
                                    "id": "wd0jiu7eoe2h3"
                                }
                            },
                            "rma_number": {
                                "type": "string",
                                "x-stoplight": {
                                    "id": "63k6hfyfgson1"
                                }
                            }
                        }
                    },
                    "dropoff": {
                        "type": "object",
                        "x-stoplight": {
                            "id": "hdf8vwh2ibffe"
                        },
                        "properties": {
                            "id": {
                                "type": "string",
                                "x-stoplight": {
                                    "id": "whs8vwq0ktnz9"
                                }
                            }
                        }
                    }
                }
            },
            "Dropoff_drop_item": {
                "x-stoplight": {
                    "id": "32js15uchnk68"
                },
                "title": "dropoff_drop_item.v2",
                "type": "object",
                "properties": {
                    "external_order_item_id": {
                        "type": "string",
                        "x-stoplight": {
                            "id": "c4ccz3bk66kd1"
                        }
                    },
                    "quantity": {
                        "type": "integer",
                        "x-stoplight": {
                            "id": "s1osc9vs02t47"
                        },
                        "minimum": 1
                    }
                }
            },
            "Exchange_variant": {
                "type": "object",
                "properties": {
                    "source_product_id": {
                        "type": "string",
                        "example": "8021450916083"
                    },
                    "source_variant_id": {
                        "type": "string",
                        "example": "43768285298931"
                    },
                    "sku": {
                        "type": "string",
                        "example": "t-shirt-blue-xxl"
                    },
                    "title": {
                        "type": "string",
                        "example": "XXL"
                    }
                },
                "title": "ExchangeVariant"
            },
            "Gift_return": {
                "type": "object",
                "x-stoplight": {
                    "id": "9b1174bda0e87"
                },
                "properties": {
                    "recipient": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string",
                                "example": "John Doe"
                            },
                            "email": {
                                "type": "string",
                                "example": "johndoe@example.com"
                            },
                            "shipping_address": {
                                "type": "object",
                                "properties": {
                                    "street_1": {
                                        "type": "string",
                                        "example": "456 Oak Avenue"
                                    },
                                    "street_2": {
                                        "type": "string",
                                        "example": "Unit 101"
                                    },
                                    "postal_code": {
                                        "type": "string",
                                        "example": "90210"
                                    },
                                    "city": {
                                        "type": "string",
                                        "example": "Beverly Hills"
                                    },
                                    "state": {
                                        "type": "string",
                                        "example": "CA"
                                    },
                                    "country_region": {
                                        "type": "object",
                                        "example": {
                                            "name": "USA"
                                        },
                                        "properties": {
                                            "name": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "title": "GiftReturn"
            },
            "Money": {
                "type": "object",
                "properties": {
                    "amount": {
                        "type": "string",
                        "example": "99.99"
                    },
                    "currency": {
                        "type": "string",
                        "example": "USD"
                    }
                },
                "title": "Money"
            },
            "Restock": {
                "x-stoplight": {
                    "id": "xcxgrhgsxqxj3"
                },
                "type": "object",
                "properties": {
                    "items": {
                        "type": "array",
                        "x-stoplight": {
                            "id": "vv0wt0crptqgk"
                        },
                        "items": {
                            "x-stoplight": {
                                "id": "qfea5fm4dap5a"
                            },
                            "type": "object",
                            "properties": {
                                "source_order_item_id": {
                                    "type": "string",
                                    "x-stoplight": {
                                        "id": "ik2pc0qq5yioe"
                                    },
                                    "example": "13892318167283"
                                },
                                "quantity": {
                                    "type": "number",
                                    "x-stoplight": {
                                        "id": "u3m2t5dfnbtd8"
                                    },
                                    "example": 1
                                },
                                "location": {
                                    "type": "object",
                                    "x-stoplight": {
                                        "id": "w9pgfdzccchsv"
                                    },
                                    "properties": {
                                        "source_id": {
                                            "type": "string",
                                            "x-stoplight": {
                                                "id": "2a5282k4t4wkd"
                                            },
                                            "example": "75333206259"
                                        },
                                        "name": {
                                            "type": "string",
                                            "x-stoplight": {
                                                "id": "pgijq1mc4e6xm"
                                            },
                                            "example": "My Custom Location"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "examples": [
                    {
                        "items": [
                            {
                                "source_order_item_id": "13892318167283",
                                "quantity": 1,
                                "location": {
                                    "source_id": "75333206259",
                                    "name": "My Custom Location"
                                }
                            }
                        ]
                    }
                ]
            },
            "Return": {
                "x-stoplight": {
                    "id": "ympm52xcp4z4g"
                },
                "type": "object",
                "title": "Return",
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "b3eedf69b7c0410d8975d4350c007705"
                    },
                    "rma_number": {
                        "type": "string",
                        "example": "A1B2C3D4"
                    },
                    "filed_by": {
                        "enum": [
                            "shopper",
                            "merchant",
                            "customer_support"
                        ]
                    },
                    "approval_status": {
                        "enum": [
                            "submitted",
                            "approved",
                            "done",
                            "rejected",
                            "expired"
                        ]
                    },
                    "merchant_note": {
                        "type": "string",
                        "example": "This is an internal note"
                    },
                    "order": {
                        "type": "object",
                        "properties": {
                            "external_id": {
                                "type": "string",
                                "example": "4254002020558"
                            },
                            "order_number": {
                                "type": "string",
                                "example": "10001"
                            },
                            "order_name": {
                                "type": "string",
                                "example": "#10001"
                            },
                            "customer": {
                                "type": "object",
                                "example": [
                                    "customer@example.com"
                                ],
                                "properties": {
                                    "emails": {
                                        "type": "array",
                                        "minItems": 1,
                                        "items": {
                                            "type": "string",
                                            "example": "customer@example.com"
                                        }
                                    }
                                }
                            },
                            "country": {
                                "type": "string",
                                "example": "USA",
                                "description": "ISO 3166-1 alpha-3"
                            },
                            "store": {
                                "type": "object",
                                "properties": {
                                    "platform": {
                                        "type": "string",
                                        "example": "shopify"
                                    },
                                    "external_id": {
                                        "type": "string",
                                        "example": "cool-shoe-store"
                                    }
                                }
                            }
                        }
                    },
                    "gift_return": {
                        "$ref": "#/components/schemas/Gift_return"
                    },
                    "return_items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Return_item"
                        }
                    },
                    "refunded_total": {
                        "$ref": "#/components/schemas/Money"
                    },
                    "shipments": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Return_shipment"
                        }
                    },
                    "restocks": {
                        "type": "array",
                        "x-stoplight": {
                            "id": "3tzv6ae5kk0l1"
                        },
                        "items": {
                            "$ref": "#/components/schemas/Restock",
                            "x-stoplight": {
                                "id": "xcxgrhgsxqxj3"
                            }
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "x-stoplight": {
                            "id": "2pr3q1jkg1kd8"
                        },
                        "example": "2024-01-01T00:00:00.001Z"
                    }
                }
            },
            "Return_item": {
                "type": "object",
                "title": "ReturnItem",
                "properties": {
                    "external_order_item_id": {
                        "type": "string",
                        "example": "10579097059534"
                    },
                    "external_product_id": {
                        "type": "string",
                        "example": "7002111410382"
                    },
                    "external_variant_id": {
                        "type": "string",
                        "example": "41681852399822"
                    },
                    "sku": {
                        "type": "string",
                        "example": "t-shirt-blue-xl"
                    },
                    "product_title": {
                        "type": "string",
                        "example": "T-Shirt"
                    },
                    "intended_return_quantity": {
                        "type": "integer",
                        "example": 2
                    },
                    "variant_title": {
                        "type": "string",
                        "example": "Blue - XL"
                    },
                    "return_reason": {
                        "type": "string",
                        "example": "Wrong size"
                    },
                    "return_reason_comment": {
                        "type": "string",
                        "example": "To Small"
                    },
                    "return_subreason": {
                        "type": "string",
                        "example": "Too "
                    },
                    "discounted_price_including_tax": {
                        "$ref": "#/components/schemas/Money"
                    },
                    "ordered_quantity": {
                        "type": "integer",
                        "example": 3
                    },
                    "properties": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string",
                                    "x-stoplight": {
                                        "id": "lp6cx3or05n95"
                                    },
                                    "example": "monogram"
                                },
                                "value": {
                                    "type": "string",
                                    "x-stoplight": {
                                        "id": "umyuoug4zmd24"
                                    },
                                    "example": "joe"
                                }
                            }
                        }
                    },
                    "image_urls": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "https://cdn.example.com/x/y/z.jpg"
                        }
                    },
                    "product_categories": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "clothing"
                        }
                    },
                    "product_tags": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "clothing"
                        }
                    },
                    "exchange_variant": {
                        "$ref": "#/components/schemas/Exchange_variant"
                    }
                }
            },
            "Return_shipment": {
                "type": "object",
                "title": "ReturnShipment",
                "properties": {
                    "tracking_number": {
                        "type": "string",
                        "example": "ABC123456789"
                    },
                    "tracking_status": {
                        "type": "string",
                        "example": "InTransit"
                    },
                    "slug": {
                        "type": "string",
                        "example": "usps"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "external_order_item_id": {
                                    "type": "string",
                                    "example": "10579097059534"
                                },
                                "quantity": {
                                    "type": "integer",
                                    "example": 2
                                }
                            }
                        }
                    },
                    "label": {
                        "type": "object",
                        "properties": {
                            "url": {
                                "type": "string",
                                "example": "https://cdn.example.com/x/y/z.pdf"
                            },
                            "aftership_shipping_slug": {
                                "type": "string",
                                "example": "usps"
                            },
                            "slug": {
                                "type": "string",
                                "example": "usps"
                            },
                            "total_charge": {
                                "$ref": "#/components/schemas/Money"
                            }
                        }
                    },
                    "packing_slip_url": {
                        "type": "string",
                        "example": "https://cdn.example.com/x/y/z.pdf"
                    },
                    "shipping_documents_url": {
                        "type": "string",
                        "example": "https://cdn.example.com/x/y/z.pdf"
                    },
                    "shipping_documents_components": {
                        "type": "array",
                        "items": {
                            "x-stoplight": {
                                "id": "xtkh16uj8xa33"
                            },
                            "enum": [
                                "label",
                                "packing_slip",
                                "conditional_shipping_document"
                            ]
                        }
                    },
                    "conditional_shipping_document_urls": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "https://cdn.example.com/x/y/z.pdf"
                        }
                    }
                }
            }
        }
    },
    "security": [
        {
            "as-api-key": []
        }
    ]
}