Skip to main content
GET
/
api
/
returns
curl --location --request GET 'https://api.stateset.app/api/returns' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
    "limit": 10,
    "offset": 0,
    "order_direction": "desc",
    "status": "Requested"
}'

query ($limit: Int!, $offset: Int!, $order_direction: OrderDirection!, $status: ReturnStatus!) {
  returns(limit: $limit, offset: $offset, order_by: {created_date: $order_direction}, where: {status: {_eq: $status }}) {
    id
    created_date
    amount
    action_needed
    condition
    customerEmail
    customer_id
    description
    enteredBy
    flat_rate_shipping
    order_date
    order_id
    reason_category
    reported_condition
    requested_date
    rma
    serial_number
    shipped_date
    status
    tax_refunded
    total_refunded
    tracking_number
    return_line_items {
      id
      amount
      condition
      flat_rate_shipping
      name
      price
      return_id
      serial_number
      sku
      tax_refunded
    }
  }
}

const returns = await stateset.returns.list({
  limit: 10,
  offset: 0,
  order_direction: 'desc',
  status: 'Requested'
});

returns = stateset.returns.list({
  "limit": 10,
  "offset": 0,
  "order_direction": "desc",
  "status": "Requested"
})

returns, err := stateset.Returns.List(
  10,        // limit
  0,         // offset
  "desc",    // order_direction
  "Requested", // status
)
if err != nil {
    // Handle error
}

returns = Stateset::Returns.list(
  limit: 10,
  offset: 0,
  order_direction: 'desc',
  status: 'Requested'
)

Returns returns = Stateset.Returns.list(
  10,            // limit
  0,             // offset
  "desc",        // order_direction
  "Requested"    // status
);

Returns returns = Stateset.Returns.List(
  limit: 10,
  offset: 0,
  order_direction: "desc",
  status: "Requested"
);

$returns = Stateset\Returns::list([
  'limit' => 10,
  'offset' => 0,
  'order_direction' => 'desc',
  'status' => 'Requested'
]);

GET /api/returns HTTP/1.1
Host: stateset-proxy-server.stateset.cloud.stateset.app
Content-Type: application/json
Authorization: Bearer <token>

{
    "limit": 10,
    "offset": 0,
    "order_direction": "desc",
    "status": "Requested"
}

{
    "returns": [
        {
            "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "created_date": "2023-06-28T19:34:59.189838+00:00",
            "amount": "150.00",
            "action_needed": "Inspection",
            "condition": "Damaged",
            "customerEmail": "customer@example.com",
            "customer_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "description": "The product arrived damaged.",
            "enteredBy": "1c0a3e4b-7e2d-4b1a-8d6c-3f2e4a5b6c7d",
            "flat_rate_shipping": "10.00",
            "order_date": "2023-06-20T15:30:00+00:00",
            "order_id": "2b8e4f64-1234-5678-9abc-def012345678",
            "reason_category": "Product Damage",
            "reported_condition": "Damaged",
            "requested_date": "2023-06-28T19:30:00+00:00",
            "rma": "RMA123456",
            "serial_number": "SN789456123",
            "shipped_date": "2023-06-29T10:00:00+00:00",
            "status": "Approved",
            "tax_refunded": "5.00",
            "total_refunded": "165.00",
            "tracking_number": "TRK1234567890",
            "return_line_items": [
                {
                    "id": "a3f5c10b-58cc-4372-a567-0e02b2c3d480",
                    "amount": "75.00",
                    "condition": "Damaged",
                    "flat_rate_shipping": "5.00",
                    "name": "Widget Pro",
                    "price": "75.00",
                    "return_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
                    "serial_number": "SN789456123",
                    "sku": "SKU12345",
                    "tax_refunded": "2.50"
                }
            ]
        }
    ]
}

Body

limit
string
required
This is the limit of the returns.
offset
string
required
This is the offset of the returns.
order_direction
string
required
This is the order direction of the returns.
status
string
required
This is the status of the returns.

Response

id
string
This is the id of the return.
created_date
string
This is the date the return was created.
amount
string
This is the amount of the return.
action_needed
string
This is the action needed for the return.
condition
string
This is the condition of the return.
customerEmail
string
This is the email of the customer.
customer_id
string
This is the id of the customer.
description
string
This is the description of the return.
enteredBy
string
This is the id of the user who entered the return.
flat_rate_shipping
string
This is the flat rate shipping of the return.
order_date
string
This is the date of the order.
order_id
string
This is the id of the order.
reason_category
string
This is the reason category of the return.
reported_condition
string
This is the reported condition of the return.
requested_date
string
This is the requested date of the return.
rma
string
This is the rma of the return.
serial_number
string
This is the serial number of the return.
shipped_date
string
This is the shipped date of the return.
status
string
This is the status of the return.
tax_refunded
string
This is the tax refunded of the return.
total_refunded
string
This is the total refunded of the return.
tracking_number
string
This is the tracking number of the return.
return_line_items
object
This is the line items of the return.
curl --location --request GET 'https://api.stateset.app/api/returns' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
    "limit": 10,
    "offset": 0,
    "order_direction": "desc",
    "status": "Requested"
}'

query ($limit: Int!, $offset: Int!, $order_direction: OrderDirection!, $status: ReturnStatus!) {
  returns(limit: $limit, offset: $offset, order_by: {created_date: $order_direction}, where: {status: {_eq: $status }}) {
    id
    created_date
    amount
    action_needed
    condition
    customerEmail
    customer_id
    description
    enteredBy
    flat_rate_shipping
    order_date
    order_id
    reason_category
    reported_condition
    requested_date
    rma
    serial_number
    shipped_date
    status
    tax_refunded
    total_refunded
    tracking_number
    return_line_items {
      id
      amount
      condition
      flat_rate_shipping
      name
      price
      return_id
      serial_number
      sku
      tax_refunded
    }
  }
}

const returns = await stateset.returns.list({
  limit: 10,
  offset: 0,
  order_direction: 'desc',
  status: 'Requested'
});

returns = stateset.returns.list({
  "limit": 10,
  "offset": 0,
  "order_direction": "desc",
  "status": "Requested"
})

returns, err := stateset.Returns.List(
  10,        // limit
  0,         // offset
  "desc",    // order_direction
  "Requested", // status
)
if err != nil {
    // Handle error
}

returns = Stateset::Returns.list(
  limit: 10,
  offset: 0,
  order_direction: 'desc',
  status: 'Requested'
)

Returns returns = Stateset.Returns.list(
  10,            // limit
  0,             // offset
  "desc",        // order_direction
  "Requested"    // status
);

Returns returns = Stateset.Returns.List(
  limit: 10,
  offset: 0,
  order_direction: "desc",
  status: "Requested"
);

$returns = Stateset\Returns::list([
  'limit' => 10,
  'offset' => 0,
  'order_direction' => 'desc',
  'status' => 'Requested'
]);

GET /api/returns HTTP/1.1
Host: stateset-proxy-server.stateset.cloud.stateset.app
Content-Type: application/json
Authorization: Bearer <token>

{
    "limit": 10,
    "offset": 0,
    "order_direction": "desc",
    "status": "Requested"
}

{
    "returns": [
        {
            "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "created_date": "2023-06-28T19:34:59.189838+00:00",
            "amount": "150.00",
            "action_needed": "Inspection",
            "condition": "Damaged",
            "customerEmail": "customer@example.com",
            "customer_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "description": "The product arrived damaged.",
            "enteredBy": "1c0a3e4b-7e2d-4b1a-8d6c-3f2e4a5b6c7d",
            "flat_rate_shipping": "10.00",
            "order_date": "2023-06-20T15:30:00+00:00",
            "order_id": "2b8e4f64-1234-5678-9abc-def012345678",
            "reason_category": "Product Damage",
            "reported_condition": "Damaged",
            "requested_date": "2023-06-28T19:30:00+00:00",
            "rma": "RMA123456",
            "serial_number": "SN789456123",
            "shipped_date": "2023-06-29T10:00:00+00:00",
            "status": "Approved",
            "tax_refunded": "5.00",
            "total_refunded": "165.00",
            "tracking_number": "TRK1234567890",
            "return_line_items": [
                {
                    "id": "a3f5c10b-58cc-4372-a567-0e02b2c3d480",
                    "amount": "75.00",
                    "condition": "Damaged",
                    "flat_rate_shipping": "5.00",
                    "name": "Widget Pro",
                    "price": "75.00",
                    "return_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
                    "serial_number": "SN789456123",
                    "sku": "SKU12345",
                    "tax_refunded": "2.50"
                }
            ]
        }
    ]
}