AfterShip Returns API

Create, approve, reject, resolve and receive returns by return ID or RMA number, manage return items, item tags and returns-page deep links.

Operations 16

GET /returns/{return_id} Get return detail by ID #
GET /returns/rma/{rma_number} Get return detail by RMA number #
GET /returns Get returns #
POST /returns Create Return #
POST /returns/rma/{rma_number}/approve Approve Return By RMA number #
POST /returns/{return_id}/approve Approve Return By Return ID #
POST /returns/rma/{rma_number}/resolve Resolve Return By RMA number #
POST /returns/{return_id}/resolve Resolve Return By Return ID #
POST /returns/rma/{rma_number}/reject Reject Return By RMA number #
POST /returns/{return_id}/reject Reject Return By Return ID #
POST /returns/rma/{rma_number}/receive-items Receive items by RMA number #
POST /returns/{return_id}/receive-items Receive items by Return ID #
POST /returns/rma/{rma_number}/attach-shipments Attach shipments by RMA number #
POST /returns/{return_id}/attach-shipments Attach shipments by Return ID #
POST /returns/{return_id}/remove-items Remove return items by Return ID #
POST /returns/rma/{rma_number}/remove-items Remove return items by RMA number #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/aftership-returns-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

aftership-returns-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Overview Returns API
  version: 2026-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/2026-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/2026-07
  description: API Endpoint
security:
- as-api-key: []
tags:
- name: Returns
paths:
  /returns/{return_id}:
    parameters:
    - schema:
        type: string
      name: return_id
      in: path
      required: true
    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
  /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: object
                    properties:
                      returns:
                        type: array
                        x-stoplight:
                          id: buf8ymw0e9dhe
                        items:
                          $ref: '#/components/schemas/Return'
                          x-stoplight:
                            id: jmu7wxmzzkmcn
                      pagination:
                        $ref: '#/components/schemas/Pagination'
                        x-stoplight:
                          id: qkut8x4mvr8k5
      operationId: get-returns
      x-stoplight:
        id: wpx1lk91k5ima
      parameters:
      - schema:
          type: string
          format: date-time
          example: '2024-01-01T00:00:00Z'
        in: query
        name: created_at_max
        description: End date and time of returns created. The default value is the current time.  Please make sure the value of the parameter is properly escaped in URL encoding.
      - schema:
          type: string
          example: '2024-01-01T00:00:00Z'
          format: date-time
        in: query
        name: created_at_min
        description: Start date and time of returns created. AfterShip will only respond with data from the past 365 days at most. The default value is 365 days ago.  Please make sure the value of the parameter is properly escaped in URL encoding.
      - schema:
          type: string
          enum:
          - submitted
          - approved
          - done
          - rejected
          - expired
        in: query
        name: approval_status
        description: The approval status of the return.
      - schema:
          type: string
          format: email
        description: The customer email used when submitting a return.  Please make sure the value of the parameter is properly escaped in URL encoding.
        in: query
        name: customer_email
      - schema:
          type: string
          enum:
          - exchange
          - refund
          - upsell
          - store_credit
        in: query
        name: outcome
        description: The return is considered a match if the `outcomes` field in the resource contains at least one of the specified `outcome` values.
      - schema:
          type: string
          enum:
          - happy_returns
          - retail_reworks
          - retailer_label
          - carrier_pickup
          - customer_courier
          - in_store
          - green_return
          - carrier_dropoff
        in: query
        name: return_method
        description: The return method of the return.
      - schema:
          type: string
          example: '#1001'
        in: query
        name: order_name
        description: The order name of the origin order associated with the return.
      - schema:
          type: number
          default: '1'
          minLength: 1
          minimum: 1
          maximum: 200
        in: query
        name: page
      - schema:
          type: number
          default: '10'
          minLength: 1
          maxLength: 20
          minimum: 1
          maximum: 50
        in: query
        name: limit
    post:
      summary: Create Return
      tags:
      - Returns
      responses:
        '201':
          $ref: '#/components/responses/CreateReturn'
        '422':
          $ref: '#/components/responses/CreateReturnError422'
        '429':
          $ref: '#/components/responses/CreateReturnError429'
      operationId: post-returns
      x-stoplight:
        id: 7cpmq51370gbp
      requestBody:
        $ref: '#/components/requestBodies/CreateReturn'
      description: This API is used to create a Return. Currently, it only supports the "Refund" resolution and does not support "Replace with the same item" or "Exchange for anything."
  /returns/rma/{rma_number}/approve:
    parameters:
    - schema:
        type: string
      name: rma_number
      in: path
      required: true
    post:
      summary: Approve Return By RMA number
      tags:
      - Returns
      responses:
        '202':
          $ref: '#/components/responses/ApproveReturn'
        '404':
          $ref: '#/components/responses/ApproveReturnError404'
        '409':
          $ref: '#/components/responses/ApproveReturnError409'
        '422':
          $ref: '#/components/responses/ApproveReturnError422'
      operationId: post-returns-rma-rma_number-approve
      x-stoplight:
        id: ccrb7gu8w7wmz
      requestBody:
        $ref: '#/components/requestBodies/ApproveReturn'
      description: Through the approve return API, you can transition a return to approved status.
  /returns/{return_id}/approve:
    parameters:
    - schema:
        type: string
      name: return_id
      in: path
      required: true
    post:
      summary: Approve Return By Return ID
      tags:
      - Returns
      responses:
        '202':
          $ref: '#/components/responses/ApproveReturn'
      operationId: post-returns-return_id-approve
      x-stoplight:
        id: wzs37duotktiy
      requestBody:
        $ref: '#/components/requestBodies/ApproveReturn'
      description: Through the approve return API, you can transition a return to approved status.
  /returns/rma/{rma_number}/resolve:
    parameters:
    - schema:
        type: string
      name: rma_number
      in: path
      required: true
    post:
      summary: Resolve Return By RMA number
      tags:
      - Returns
      responses:
        '200':
          $ref: '#/components/responses/ResolveReturn'
        '404':
          $ref: '#/components/responses/ResolveReturnError404'
        '409':
          $ref: '#/components/responses/ResolveReturnError409'
      operationId: post-returns-rma-rma_number-resolve
      x-stoplight:
        id: ccrb7gu8w7wmd
      requestBody:
        $ref: '#/components/requestBodies/ResolveReturn'
      description: Through the resolve return API, you can transition a return to approved status.
  /returns/{return_id}/resolve:
    parameters:
    - schema:
        type: string
      name: return_id
      in: path
      required: true
    post:
      summary: Resolve Return By Return ID
      tags:
      - Returns
      responses:
        '200':
          $ref: '#/components/responses/ResolveReturn'
        '404':
          $ref: '#/components/responses/ResolveReturnError404'
        '409':
          $ref: '#/components/responses/ResolveReturnError409'
      operationId: post-returns-return_id-resolve
      x-stoplight:
        id: wzs37duotktiz
      requestBody:
        $ref: '#/components/requestBodies/ResolveReturn'
      description: Through the resolve return API, you can transition a return to resolved status.
  /returns/rma/{rma_number}/reject:
    parameters:
    - schema:
        type: string
      name: rma_number
      in: path
      required: true
    post:
      summary: Reject Return By RMA number
      tags:
      - Returns
      responses:
        '200':
          $ref: '#/components/responses/RejectReturn'
        '404':
          $ref: '#/components/responses/RejectReturnError404'
        '409':
          $ref: '#/components/responses/RejectReturnError409'
        '422':
          $ref: '#/components/responses/RejectReturnError422'
      operationId: post-returns-rma-rma_number-reject
      x-stoplight:
        id: ccrb7gu8w7wm1
      requestBody:
        $ref: '#/components/requestBodies/RejectReturn'
      description: Through the reject return API, you can transition a return to rejected status.
  /returns/{return_id}/reject:
    parameters:
    - schema:
        type: string
      name: return_id
      in: path
      required: true
    post:
      summary: Reject Return By Return ID
      tags:
      - Returns
      responses:
        '200':
          $ref: '#/components/responses/RejectReturn'
        '404':
          $ref: '#/components/responses/RejectReturnError404'
        '409':
          $ref: '#/components/responses/RejectReturnError409'
        '422':
          $ref: '#/components/responses/RejectReturnError422'
      operationId: post-returns-return_id-reject
      x-stoplight:
        id: wzs37du1tktiy
      requestBody:
        $ref: '#/components/requestBodies/RejectReturn'
      description: Through the reject return API, you can transition a return to rejected status.
  /returns/rma/{rma_number}/receive-items:
    parameters:
    - schema:
        type: string
      name: rma_number
      in: path
      required: true
    post:
      summary: Receive items by RMA number
      tags:
      - Returns
      responses:
        '200':
          $ref: '#/components/responses/ReceiveItems'
        '404':
          $ref: '#/components/responses/ReceiveItemsError404'
        '422':
          $ref: '#/components/responses/ReceiveItemsError422'
      operationId: post-returns-rma-rma_number-receive-items
      x-stoplight:
        id: zkc70irqc66m6
      description: 'For a normal receive operation, the `external_id` in the receive items represents the item id on the e-commerce platform. You can also use our `get return` API to retrieve all return items and match the corresponding external_id in your code using relevant information such as sku.


        For merchants using the bundle feature, there are two cases:


        - If the shopper submits a return for an whole bundle, the `external_id` in the items for the receive operation can be found in `return_items[*].bundled_items` within the return resource.

        - If the shopper submits a return for a child item within the bundle, the `external_id` in the items for the receive operation can be found in `return_items` within the return resource.


        In other words, in the context of bundles, the `external_id` for the receive operation should always be the child item ID within the bundle.'
      requestBody:
        $ref: '#/components/requestBodies/ReceiveItems'
  /returns/{return_id}/receive-items:
    parameters:
    - schema:
        type: string
      name: return_id
      in: path
      required: true
    post:
      summary: Receive items by Return ID
      tags:
      - Returns
      responses:
        '200':
          $ref: '#/components/responses/ReceiveItems'
        '404':
          $ref: '#/components/responses/ReceiveItemsError404'
        '422':
          $ref: '#/components/responses/ReceiveItemsError422'
      operationId: post-returns-return_id-receive-items
      x-stoplight:
        id: zkc70irq886m6
      description: 'For a normal receive operation, the `external_id` in the receive items represents the item id on the e-commerce platform. You can also use our `get return` API to retrieve all return items and match the corresponding external_id in your code using relevant information such as sku.


        For merchants using the bundle feature, there are two cases:


        - If the shopper submits a return for an whole bundle, the `external_id` in the items for the receive operation can be found in `return_items[*].bundled_items` within the return resource.

        - If the shopper submits a return for a child item within the bundle, the `external_id` in the items for the receive operation can be found in `return_items` within the return resource.


        In other words, in the context of bundles, the `external_id` for the receive operation should always be the child item ID within the bundle.'
      requestBody:
        $ref: '#/components/requestBodies/ReceiveItems'
  /returns/rma/{rma_number}/attach-shipments:
    parameters:
    - schema:
        type: string
      name: rma_number
      in: path
      required: true
    post:
      summary: Attach shipments by RMA number
      tags:
      - Returns
      responses:
        '200':
          $ref: '#/components/responses/AttachShipments'
        '404':
          $ref: '#/components/responses/AttachShipmentsError404'
        '422':
          $ref: '#/components/responses/AttachShipmentsError422'
      operationId: post-returns-rma-rma_number-attach-shipments
      x-stoplight:
        id: 9o8olke4jh081
      description: Through this API, merchants can upload a shipment on their own. Although the design allows for the possibility of uploading multiple shipments, currently, merchants can only upload one shipment.
      requestBody:
        $ref: '#/components/requestBodies/AttachShipments'
  /returns/{return_id}/attach-shipments:
    parameters:
    - schema:
        type: string
      name: return_id
      in: path
      required: true
    post:
      summary: Attach shipments by Return ID
      tags:
      - Returns
      responses:
        '200':
          $ref: '#/components/responses/AttachShipments'
        '404':
          $ref: '#/components/responses/AttachShipmentsError404'
        '422':
          $ref: '#/components/responses/AttachShipmentsError422'
      operationId: post-returns-return_id-attach-shipments
      x-stoplight:
        id: 9o8o12e4jh081
      description: Through this API, merchants can upload a shipment on their own. Although the design allows for the possibility of uploading multiple shipments, currently, merchants can only upload one shipment.
      requestBody:
        $ref: '#/components/requestBodies/AttachShipments'
  /returns/{return_id}/remove-items:
    parameters:
    - schema:
        type: string
      name: return_id
      in: path
      required: true
    - schema:
        type: string
      name: return_id
      in: path
      required: true
    post:
      summary: Remove return items by Return ID
      tags:
      - Returns
      responses:
        '200':
          $ref: '#/components/responses/RemoveItems'
        '404':
          $ref: '#/components/responses/RemoveItemsError404'
        '422':
          $ref: '#/components/responses/RemoveItemsError422'
      operationId: post-returns-return_id-remove-items
      x-stoplight:
        id: 6bmzc1i5h7dzb
      requestBody:
        $ref: '#/components/requestBodies/RemoveItems'
      description: 'When a shopper changes their mind and no longer wants to return all items, you can use this API to remove specific items from the return. This functionality is the same as the "Remove Return Items from an Existing RMA" feature in the Admin Portal. For more information, please refer to: [https://support.aftership.com/en/returns/article/remove-return-items-from-an-existing-rma-133vwu0](https://support.aftership.com/en/returns/article/remove-return-items-from-an-existing-rma-133vwu0)

        '
  /returns/rma/{rma_number}/remove-items:
    parameters:
    - schema:
        type: string
      name: rma_number
      in: path
      required: true
    - schema:
        type: string
      name: rma_number
      in: path
      required: true
    post:
      summary: Remove return items by RMA number
      tags:
      - Returns
      responses:
        '200':
          $ref: '#/components/responses/RemoveItems'
        '404':
          $ref: '#/components/responses/RemoveItemsError404'
        '422':
          $ref: '#/components/responses/RemoveItemsError422'
      operationId: post-returns-rma-rma_number-remove-items
      x-stoplight:
        id: holrqur45r266
      requestBody:
        $ref: '#/components/requestBodies/RemoveItems'
      description: 'When a shopper changes their mind and no longer wants to return all items, you can use this API to remove specific items from the return. This functionality is the same as the "Remove Return Items from an Existing RMA" feature in the Admin Portal. For more information, please refer to: [https://support.aftership.com/en/returns/article/remove-return-items-from-an-existing-rma-133vwu0](https://support.aftership.com/en/returns/article/remove-return-items-from-an-existing-rma-133vwu0)

        '
components:
  schemas:
    Return_shipment:
      x-stoplight:
        id: r3rb6iy8jfovb
      type: object
      title: ReturnShipment
      properties:
        id:
          type: string
          description: The unique identifier for the shipment.
          x-stoplight:
            id: 5arkrapxn89hr
        tracking_number:
          type: string
          example: ABC123456789
          description: The tracking number for the shipment.
          x-stoplight:
            id: k4pdwkggoupzh
        tracking_status:
          type:
          - string
          - 'null'
          example: InTransit
          description: The current status of the shipment. All possible tracking statuses can be found on https://www.aftership.com/docs/tracking/enum/delivery-statuses
          x-stoplight:
            id: 0vb66rt2nnqj2
        slug:
          type: string
          example: usps
          description: A unique identifier for the shipment. All supported slugs can be found on [https://track.aftership.com/couriers/download](https://track.aftership.com/couriers/download#_ga=2.55753835.1395222502.1626745658-1175677371.1626745658)
          x-stoplight:
            id: ldhe5ns08yxzu
        items:
          type: array
          description: The list of items included in the shipment.
          x-stoplight:
            id: l9ybuje9mobz7
          items:
            type: object
            x-stoplight:
              id: t47uz4de5jq1j
            properties:
              external_order_item_id:
                type: string
                example: '10579097059534'
                description: The ID of the item on the e-commerce platform.
                x-stoplight:
                  id: 7q11pploq6xi2
              quantity:
                type: integer
                example: 2
                description: The number of items included in the shipment.
                x-stoplight:
                  id: pekdf7ixjd3d1
        label:
          type:
          - object
          - 'null'
          description: The shipping label associated with the shipment.
          x-stoplight:
            id: pi9n73mcfjcmw
          properties:
            url:
              type:
              - string
              - 'null'
              example: https://cdn.example.com/x/y/z.pdf
              description: The URL for accessing the shipment label.
              x-stoplight:
                id: c0h625s1htqk3
            aftership_shipping_slug:
              type: string
              example: usps
              description: The slug used for Aftership Shipping integration.
              x-stoplight:
                id: re5xq39imnh56
            slug:
              type: string
              example: usps
              description: The slug used for Aftership Tracking integration.
              x-stoplight:
                id: 1fc5ort9wbvs3
            total_charge:
              description: The total charge associated with the shipment label.
              oneOf:
              - type: object
                $ref: '#/components/schemas/Money'
                x-stoplight:
                  id: jadnogdp3uhau
              - type:
                - 'null'
                x-stoplight:
                  id: h7nls43c3295z
              x-stoplight:
                id: 4qi90nqfzrt24
            qr_code_url:
              type:
              - string
              - 'null'
              x-stoplight:
                id: nxlqfzhh3peoi
              description: The URL for accessing the shipment QR Code.
        packing_slip_url:
          type:
          - string
          - 'null'
          example: https://cdn.example.com/x/y/z.pdf
          description: The URL for the packing slip related to the shipment.
          x-stoplight:
            id: dniwhofyjpowk
        shipping_documents_url:
          type:
          - string
          - 'null'
          example: https://cdn.example.com/x/y/z.pdf
          description: The URL for the shipping documents.
          x-stoplight:
            id: wj4w0x3dlgsn8
        shipping_documents_components:
          type: array
          description: The components of the shipping documents.
          x-stoplight:
            id: y0k2tz5xqt3w7
          items:
            x-stoplight:
              id: uyvpszy1ukoyj
            enum:
            - label
            - packing_slip
            - conditional_shipping_document
        conditional_shipping_document_urls:
          type: array
          description: The URLs for any conditional shipping documents.
          x-stoplight:
            id: a1ppsy1s1dp3d
          items:
            type: string
            example: https://cdn.example.com/x/y/z.pdf
            description: The URLs for any conditional shipping documents.
            x-stoplight:
              id: 5js43ilpgi6bv
        source:
          type: string
          enum:
          - shopper_upload
          - merchant_upload
          - merchant_api
          - merchant_generate
          description: The source of the shipment label.
          x-stoplight:
            id: ybftkb2uvrqtw
        created_at:
          type: string
          x-stoplight:
            id: n8k5y1jb99emm
          description: The date-time (ISO string in UTC) when the shipment was created
        tracking_status_updated_at:
          type:
          - string
          - 'null'
          x-stoplight:
            id: ckc1cmg8mxnc9
          description: The date-time (ISO string in UTC)  when the last time the shipment's tracking status was updated.
        ship_from:
          oneOf:
          - $ref: '#/components/schemas/Address'
          - type: 'null'
        ship_to:
          oneOf:
          - $ref: '#/components/schemas/Address'
          - type: 'null'
        invoice_url:
          type:
          - string
          - 'null'
          example: https://cdn.example.com/x/y/invoice.pdf
          description: The URL for the invoice associated with the shipment.
          x-stoplight:
            id: n4kqw2mxe8pzj
    Instant_exchange:
      type: object
      x-stoplight:
        id: seoh4kukxl01u
      title: InstantExchange
      properties:
        status:
          x-stoplight:
            id: r59povuw4wgof
          enum:
          - pending
          - charged
          - canceled
          - failed
          description: The status of the instant exchange payment. "pending" means the shopper has authorized the charge, "charged" means the merchant has successfully collected the payment, and "canceled" means the payment is no longer required and has been canceled.
        payment:
          type:
          - object
          - 'null'
          properties:
            id:
              type: string
              description: The unique identifier for the payment.
            external_id:
              type: string
              description: The identifier for this payment on the third-party payment platform.
            total:
              description: The total amount and currency of this payment.
              oneOf:
              - type: object
                $ref: '#/components/schemas/Money'
                x-stoplight:
                  id: 44db4xhavpl8o
              - type:
                - 'null'
                x-stoplight:
                  id: yeo77qd6efa8q
            gateway:
              type: string
              enum:
              - stripe
              description: The payment gateway used for this transaction. Currently, we only support Stripe.
    Order:
      x-stoplight:
        id: c6emqfzr1b3sp
      type: object
      properties:
        id:
          type: string
          x-stoplight:
            id: crbdqq21eqthj
        external_id:
          type: string
          example: '4254002020558'
          description: The order ID of the original order on the e-commerce platform.
        order_number:
          type: string
          example: '10001'
          description: The order number of the original order on the e-commerce platform.
        order_name:
          type: string
          example: '#10001'
          description: The order name of the original order on the e-commerce platform.
        customer:
          type: object
          description: The basic information of the customer. Currently, only the customer’s email address is returned.
          properties:
            emails:
              type: array
              minItems: 1
              description: A list of email addresses associated with the customer.
              items:
                type: string
                example: customer@example.com
            locale:
              type:
              - string
              - 'null'
              x-stoplight:
                id: 6ib05xw495kjo
              description: 'The language code of the customer, eg: en-US.


                '
        country_region:
          type: string
          example: USA
          description: The sales region of the original order, represented by the ISO 3166-1 alpha-3 country code.
          x-stoplight:
            id: uwg74gkpt0yr7
        store:
          type: object
          description: The brief information of the store associated with the original order.
          properties:
            platform:
              type: string
              example: shopify
              description: The e-commerce platform where the store is located. ([See platform defination](/docs/enum/platforms.md))
              enum:
              - shopify
              - sfcc
              - automizely-private
              - bigcommerce
              - magento-2
              - woocommerce
              - shoplazza
              - wix
              - shopware-6
              - squarespace
            external_id:
              type: string
              example: cool-shoe-store
              description: The identifier of the store on the e-commerce platform.
        placed_at:
          type:
          - string
          - 'null'
          example: '2024-09-27T10:45:30Z'
          description: The date and time when the order was placed, in ISO 8601 format (UTC).
          format: date-time
    Pagination:
      x-stoplight:
        id: qkut8x4mvr8k5
      type: object
      properties:
        total:
          type: integer
        page:
          type: integer
        limit:
          type: integer
        has_next_page:
          type: boolean
      x-examples:
        Example 1:
          total: 256
          page: 6
          limit: 50
          has_next_page: false
    Receiving:
      x-stoplight:
        id: b6lxmjgycvc07
      title: Receiving
      type: object
      properties:
        id:
          type: string
          description: ID of the receiving operation
          example: fcd437b4532b44739f52e304f850f360
        items:
          type: array
          description: The items involved in this receive operation
          items:
            type: object
            properties:
              external_id:
                type: string
                description: The ID of the item. If the returned item is an entire bundle, the external_id here actually refers to the child item within the bundle, as we only allow the received operation on items within the bundle, not on the bundle itself.
                example: '13910507487475'
              external_product_id:
                type: string
                description: The ID of the product on the e-commerce platform
                example: '8524159222003'
              external_variant_id:
                type: string
                description: The ID of the variant on the e-commerce platform
                example: '45258012197107'
              sku:
                type: string
                description: The SKU of the item on the e-commerce platform
                example: snowboard-powder
              quantity:
                type: number
                description: The number of items received in this receive operation
                example: 3
              gradings:
                type: array
                description: Grading information. The merchant can assign a quality inspection grade to the item for this receive operation. Each item can be assigned multiple grades, but the total number cannot exceed the quantity of this receive operation.
                items:
                  type: object
                  properties:
                    grade:
                      type: string
                      enum:
                      - a
                      - b
                      - c
                      - d
                      description: The quality inspection grade
                      example: b
                    quantity:
                      type: number
                      description: The quantity of items
                      example: 2
                    notes:
                      type:
                      - string
                      - 'null'
                      description: The notes of the inspection, can be filled with any information you require
                      example: The items have minor scratches and some packaging damage.
                    image_urls:
                      type:
                      - array
                      - 'null'
                      description: The URL to images of quality inspection, such as images of items, evidence of quality inspection, etc.
                      items:
                        type: string
                        format: uri
                        example: https://example.com/image1.jpg
                    inspector:
                      type:
                      - string
                      - 'null'
                      description: The inspector of the inspection, can be filled with any identifier you require
                      example: John Doe
                    inspected_at:
                      type:
                      - string
                      - 'null'
                      format: date-time
                      description: The date of the inspection
         

# --- truncated at 32 KB (105 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/aftership/refs/heads/main/openapi/aftership-returns-api-openapi.yml