Skip to content

Return Insights API v1

You can get orders and their returnables by differen filter, get the mail content and resend Mails for a return (RMA)

The Return Insights API uses GraphQL Language

  1. GraphQL is a query language for APIs and a runtime for executing those queries with your existing data.
  2. It allows clients to request exactly the data they need, minimizing over-fetching and under-fetching of data.
  3. GraphQL uses a strong type system to define the capabilities of an API, enabling clients to know exactly what data is available.
  4. Clients can retrieve multiple resources in a single request, reducing the number of API calls.
  5. It enables real-time data updates through subscriptions, supporting use cases like live feeds.
  6. GraphQL facilitates API evolution over time without requiring versioning, as new fields can be added without impacting existing queries.
  7. It provides introspection capabilities, allowing developers to understand the schema and available operations dynamically.
  8. GraphQL can be implemented in various programming languages and is commonly used in applications requiring efficient and flexible data retrieval.
  9. Further Documentation you can find here https://graphql.org/learn/

Authentication

Using Header X-API-KEY with the given token. This Token differs from client and environment.

Integration

there is a Sandbox Page for out INTG environment: Sandbox where you can try out your requirements

  • To use the sandbox be sure to insert the right Token in the Header Tab below the query
  • Variables can be set in the TAB at the bottom
{
  "data": {
    "orders": {
      "data": [
        {
          "order_id": "CXC001DE",
          "create_date": "2024-11-22T23:07:38.745Z",
          "update_date": "2024-11-22T23:07:38.745Z",
          "order_document": {
            "items": [
              {
                "sku": "4000000000001",
                "title": "You are You",
                "imageUrl": "https://filestw0555e8h2e9x1bq7pj.blob.core.windows.net/c100001emailassets/outure-t-shirt-1.png?sv=2023-11-03&st=2024-08-22T14%3A09%3A37Z&se=2024-10-31T22%3A59%3A59Z&sr=b&sp=rw&sig=v29necO8bJ9SB6cgaTZwyRuE%2BWlGHNmOt6dhgO2p%2B2w%3D",
                "position": "001",
                "attributes": [
                  {
                    "key": "customersizename",
                    "value": "S"
                  }
                ],
                "grossAmount": 12.99,
                "quantityOpen": 50,
                "quantityUnit": "piece",
                "returnReasons": [
                  "001",
                  "002",
                  "003",
                  "004",
                  "005",
                  "006",
                  "007",
                  "008",
                  "009",
                  "010"
                ],
                "returnableUntil": "3000-01-01"
              }
            ],
            "locale": "de-DE",
            "orderId": "CXC001DE",
            "customer": {
              "city": "Musterstadt",
              "email": "test.cxc@teams.arvato-scs.com",
              "name1": "Erika Mustermann",
              "name2": "",
              "gender": "female",
              "country": "DE",
              "zipcode": "11111",
              "addressline1": "Musterstr. 1",
              "addressline2": "",
              "addressline3": "",
              "mobilePhoneNumber": "+14151231234"
            },
            "consignee": {
              "city": "Musterdorf",
              "name1": "Max Mustermann",
              "name2": "",
              "gender": "male",
              "country": "DE",
              "zipcode": "22222",
              "addressline1": "Musterstr. 10",
              "addressline2": "",
              "addressline3": ""
            },
            "currencyCode": "EUR",
            "orderDatetime": "2000-01-01T10:00:00Z",
            "paymentMethod": "Z008"
          },
          "orderRmas": [
            {
              "rma_id": "RT00000030",
              "tracking_id": "540306111963",
              "order_id": "CXC001DE",
              "create_date": "2024-11-22T12:59:26.500Z",
              "items": {
                "items": [
                  {
                    "Sku": "4000000000001",
                    "Position": "001",
                    "QuantityOpen": 29,
                    "QuantityUnit": "piece",
                    "ReturnReason": "001",
                    "QuantityReturned": 1
                  }
                ]
              },
              "document_type": "QR",
              "label_content_url": null,
              "email_content_url": "https://filestw0555e8h2e9x1bq7pj.blob.core.windows.net/return/C100103/RT00000030/mail.json?sv=2022-11-02&se=2025-01-31T23%3A59%3A59Z&sr=b&sp=r&sig=7rS7Zg4B1zlZDL%2BXXOnRdPi0Ve4Qmu2352svGfZ7Fjc%3D",
              "return_type": "ZROI",
              "carrier": "instore",
              "cancel_date": "2024-11-22T14:04:16.181Z",
              "refund_method": "ORIGINAL_PAYMENT",
              "irc_qrcode_content_url": null,
              "selected_carrier": {
                "id": "DHL_QR",
                "imgUrl": "/carrier-logo/dhl.svg",
                "displayName": "DHL"
              },
              "sent_mails": [
                {
                  "action": "createRma",
                  "timeStamp": "2024-11-22T12:59:26.592Z",
                  "correlationId": "019353f4-b600-7885-8b39-bd738d53d489"
                },
                {
                  "action": "updateRma",
                  "timeStamp": "2024-11-22T12:59:55.025Z",
                  "correlationId": "019353f5-2510-7885-8b39-c0f3acbe5d1c"
                },
                {
                  "action": "cancelRma",
                  "timeStamp": "2024-11-22T14:04:16.478Z",
                  "correlationId": "01935430-10de-7228-9564-a6a9bc57d321"
                }
              ]
            }
          ]
        }
      ]
    }
  }
}

GraphQL Query Examples

Get Order Filtered by Datetime

query orders($take: Int, $where: OrderWhereInput) {
  orders(take: $take, where: $where) {
    data {
      order_id
      create_date
      update_date
      order_document
    }
  }
}

Variables:

{
  "take": 2,
  "where": {
    "create_date": {
      "gt": "2024-11-05T17:30:34.466Z",
      "lt": "2024-11-07T17:30:34.466Z"
    }
  }
}

Get RMA Filtered by Datetime

query OrderRmas($take: Int, $where: OrderRmaWhereInput) {
  orderRmas(take: $take, where: $where) {
    data {
      cancel_date
      carrier
      create_date
      document_type
      email_content_url
      irc_qrcode_content_url
      items
      label_content_url
      order_id
      refund_method
      return_type
      rma_id
      selected_carrier
      tracking_id
    }
  }
}

Variables:

{
  "take": 2,
  "where": {
    "create_date": {
      "gt": "2024-10-01T17:30:34.466Z",
      "lt": "2024-11-22T17:30:34.466Z"
    }
  }
}

Get Order and related RMA filtered by Country Code

query orders($take: Int, $where: OrderWhereInput) {
  orders(take: $take, where: $where) {
    data {
      order_id
      create_date
      update_date
      order_document
      orderRmas {
        rma_id
        tracking_id
        order_id
        create_date
        items
        document_type
        label_content_url
        email_content_url
        return_type
        carrier
        cancel_date
        refund_method
        irc_qrcode_content_url
        selected_carrier
      }
    }
  }
}

Variables:

{
  "take": 1,
  "where": {
    "consignee_country": {
      "equals": "AT"
    }
  },
}

Get one Order with related RMA filtered by Customer Mail with skip

query orders($take: Int, $where: OrderWhereInput, $skip: Int) {
  orders(take: $take, where: $where, skip: $skip) {
    data {
      order_id
      create_date
      update_date
      customer_email
      order_document
      orderRmas {
        rma_id
        tracking_id
        order_id
        create_date
        items
        document_type
        label_content_url
        email_content_url
        return_type
        carrier
        cancel_date
        refund_method
        irc_qrcode_content_url
        selected_carrier
      }
    }
  }
}

Variables:

{
  "take": 1,
  "where": {
    "customer_email": {
      "equals": "test.cxc@teams.arvato-scs.com"
    }
  },
  "skip": 10
}

Get NotificationsView (Mail Content)

query NotificationsView($correlationId: String!) {
  notificationsView(correlationId: $correlationId) {
    content
    contentType
  }
}

Variables:

{
  "correlationId": "019353f4-b600-7885-8b39-bd738d53d489"
}

Resend Mail (Find in Mutations)

mutation ResendEmail($correlationId: String!) {
  resendEmail(correlationId: $correlationId) {
    message
  }
}

Variables:

{
  "correlationId": "019353f4-b600-7885-8b39-bd738d53d489"
}