Permission Denied when creating a return request

Trying to create a return via API , And getting the following error

{
  "errors": [
    {
      "message": "Cannot access the requested order. Permission denied",
      "operation": "return_create",
      "field": "return_create",
      "request_id": "6158e7c6d734be858af2f799",
      "code": 9
    }
  ],
  "data": {
    "return_create": null
  }
}

My request:

mutation {
  return_create(
    data: {
      data.0.order_id: "00000005"
       warehouse_id: "V2FyZWhvvsNlOjcxNDU="
      return_reason: ""
      label_type: FREE
      label_cost: "1.00"
      address: {
        name: "Tester"
        address1: "123 Andrew"
        address2: "BLDG 4"
        city: "Montreal"
        state: "state"
        country: "CANADA"
        zip: "12345"
        phone: ""
      }
      dimensions: {
        weight: ""
        height: "1.00"
        width: ""
        length: ""
      }
      shipping_carrier: ""
      shipping_method: ""
      
      line_items: [
      
      {
        sku:"abc-3PL"
         quantity: 2
        return_reason: "No Longer Wants"
        condition: "new"
      }
      
 ]     
      tracking_number: ""
    }
  ) {
    request_id
    complexity
    return {
      id
      data.0.order_id
      reason
      status
      label_type
      label_cost
      shipping_carrier
      shipping_method
      address {
        name
        address1
        address2
        city
        state
        country
        zip
        phone
      }
      line_items {
        id
        line_item_id
        product_id
        quantity
        reason
      }
      created_at
    }
  }
}

Hi @ayman!

Any chance you might be trying to generate the return from the Child account?

You can confirm that by using the Account query:

query {
  account {
    request_id
    complexity
    data {
      is_3pl
      legacy_id
      email
      username
    }
  }
}

If it is not the 3PL, try using a credential from the 3PL to generate a return and see if that works.
Thanks in advance!

1 Like