createReturn

📘

Important

The Buy with Prime API is offered as a preview and might change as we receive feedback and iterate on the interfaces. We are sharing this early documentation to help you learn about the Buy with Prime API as we write and iterate on the content.

Overview

Creates a single return.

Response

Return type CreateReturnResponse

Arguments

ArgumentDescription
input (CreateReturnInput required)

Represents the request information for creating a return.

Examples


Create Return With Prime Items

Request

mutation createReturn($input: CreateReturnInput!) {
  createReturn(
    input: {
      returnLineItems: [
        {
          returnFor: {
            orderIdentifierInput: {
              orderId: "123-4567-8910"
            },
            orderLineItemAmounts: [
              {
                amount: {
                  value: 1
                },
                lineItemId: {
                  lineItemId: "e655b7d028-f471152e3f"
                }
              }
            ]
          }
        }
      ]
    }
  ) {
    returnDetails {
      id
      createdAt
      state
      returnLineItems {
        id
        returnReasonTermOptions {
          reasonCode
          description {
            locale
            value
          }
          isCommentRequired
        }
      }
    }
  }
}

Response

{
  "data": {
    "createReturn": {
      "returnDetails": {
        "id": "return-id",
        "createdAt": "2024-12-24T08:52:08.592403284Z",
        "state": "DRAFT",
        "returnLineItems": [
          {
            "id": "3874-76351",
            "returnReasonTermOptions": [
              {
                "reasonCode": "CR-DAMAGED_BY_FC",
                "description": {
                  "locale": "en-US",
                  "value": "Product damaged, but shipping box OK"
                },
                "isCommentRequired": false
              },
              {
                "reasonCode": "CR-FOUND_BETTER_PRICE",
                "description": {
                  "locale": "en-US",
                  "value": "Better price available"
                },
                "isCommentRequired": false
              },
              {
                "reasonCode": "AMZ-PG-MISORDERED",
                "description": {
                  "locale": "en-US",
                  "value": "Bought wrong size, style, or color"
                },
                "isCommentRequired": false
              },
              {
                "reasonCode": "CR-ORDERED_WRONG_ITEM",
                "description": {
                  "locale": "en-US",
                  "value": "Bought by mistake"
                },
                "isCommentRequired": false
              },
              {
                "reasonCode": "CR-DAMAGED_BY_CARRIER",
                "description": {
                  "locale": "en-US",
                  "value": "Product and shipping box both damaged"
                },
                "isCommentRequired": false
              },
              {
                "reasonCode": "CR-MISSING_PARTS",
                "description": {
                  "locale": "en-US",
                  "value": "Missing or broken parts"
                },
                "isCommentRequired": false
              },
              {
                "reasonCode": "AMZ-PG-BAD-DESC",
                "description": {
                  "locale": "en-US",
                  "value": "Inaccurate website description"
                },
                "isCommentRequired": false
              },
              {
                "reasonCode": "CR-MISSED_ESTIMATED_DELIVERY",
                "description": {
                  "locale": "en-US",
                  "value": "Item arrived too late"
                },
                "isCommentRequired": false
              },
              {
                "reasonCode": "CR-SWITCHEROO",
                "description": {
                  "locale": "en-US",
                  "value": "Wrong item was sent"
                },
                "isCommentRequired": false
              },
              {
                "reasonCode": "CR-UNWANTED_ITEM",
                "description": {
                  "locale": "en-US",
                  "value": "No longer needed"
                },
                "isCommentRequired": false
              },
              {
                "reasonCode": "CR-DEFECTIVE",
                "description": {
                  "locale": "en-US",
                  "value": "Item defective or doesn’t work"
                },
                "isCommentRequired": false
              }
            ]
          }
        ]
      }
    }
  }
}