Skip to main content

Get repayment request details

note

The id and the other values in this example are placeholders — replace them with your own.

Use repaymentRequest query to retrieve a single repayment request by ID. This example reads the repayment request itself in full: its scalar fields, the return reason (causal), the lines being returned (each with its returnedLine), the returned lines as evaluated by the warehouse and the return shipping with its carrier and parcels. The entities that have their own guide are referenced by id only: the order and its lines, the warehouse, the labels, the proforma, the credit document (fiscalDocument) and the refund transactions. Select only the parts you need: the query complexity grows with every field (see Rate limiting).

The lifecycle of the return (status) and the return reasons are described in Things to know about repayment requests; the fields are documented on the RepaymentRequest and RepaymentReturnedLine object references. In returnedLines, quantityReceived and quantityCompliant are null until the warehouse records the reception; an item the warehouse received without it being part of the return appears as a returned line that none of the lines points to through returnedLine. To read the referenced entities in full: Get order details for the order and its lines, Warehouse queries for the warehouse, Get the repayment documents for the credit document, the proforma and the labels, and Query external transactions and disputes for the refund transactions; fiscalDocument is null until the credit document is issued.

Request
query repaymentRequestDetails {
  repaymentRequest(id: "567") {
    id
    number
    createdAt
    updatedAt
    status
    order {
      # id only, detailed in Get order details
      id
    }
    causal {
      id
      description
      refundKind
    }
    lines {
      id
      quantity
      sku
      skuDescription
      number
      originalUnitaryPrice
      discountedUnitaryPrice
      vatPercentage
      unitaryVatAmount
      orderLine {
        # id only, detailed in Get order details
        id
      }
      returnedLine {
        id
      }
    }
    returnedLines {
      id
      quantityExpected
      quantityReceived
      quantityCompliant
      sku
      skuDescription
    }
    shipping {
      id
      number
      firstName
      lastName
      email
      city
      zipCode
      province
      country
      isoCountry
      companyName
      telephone
      status
      bookingStatus
      carrier {
        id
        code
        name
      }
      carrierName
      trackingNumber
      trackingUrl
      warehouse {
        # id only, detailed in Warehouse queries
        id
      }
      parcels {
        id
        kind
        weight
        length
        width
        height
        tailLiftRequired
      }
      labels {
        # id only, detailed in Get the repayment documents
        id
      }
      proforma {
        # id only, detailed in Get the repayment documents
        id
      }
    }
    fiscalDocument {
      # id only, detailed in Get the repayment documents
      id
    }
    refundTransactions {
      # id only, detailed in Query external transactions and disputes
      id
    }
  }
}
Response
{
  "data": {
    "repaymentRequest": {
      "id": "567",
      "number": "RR-2026-0001",
      "createdAt": "2026-02-14T09:00:00.000Z",
      "updatedAt": "2026-02-20T11:30:00.000Z",
      "status": "to_refund",
      "order": {
        "id": "12345"
      },
      "causal": {
        "id": "5",
        "description": "Defective/Damaged product",
        "refundKind": "total"
      },
      "lines": [
        {
          "id": "701",
          "quantity": 2,
          "sku": "SKU-1",
          "skuDescription": "Demo product",
          "number": "1",
          "originalUnitaryPrice": 100.0,
          "discountedUnitaryPrice": 90.0,
          "vatPercentage": 22.0,
          "unitaryVatAmount": 19.8,
          "orderLine": {
            "id": "4501"
          },
          "returnedLine": {
            "id": "98765"
          }
        }
      ],
      "returnedLines": [
        {
          "id": "98765",
          "quantityExpected": 2,
          "quantityReceived": 2,
          "quantityCompliant": 2,
          "sku": "SKU-1",
          "skuDescription": "Demo product"
        }
      ],
      "shipping": {
        "id": "790",
        "number": "1",
        "firstName": "Mario",
        "lastName": "Rossi",
        "email": "shipping@example.com",
        "city": "Milano",
        "zipCode": "20100",
        "province": "MI",
        "country": "Italy",
        "isoCountry": "IT",
        "companyName": null,
        "telephone": "0039111111111",
        "status": "delivered",
        "bookingStatus": "confirmed",
        "carrier": {
          "id": "3",
          "code": "DHL",
          "name": "DHL Express"
        },
        "carrierName": "DHL",
        "trackingNumber": "IT2206513999",
        "trackingUrl": "https://track.example.test/IT2206513999",
        "warehouse": {
          "id": "12"
        },
        "parcels": [
          {
            "id": "151",
            "kind": "box",
            "weight": 2500.0,
            "length": 40.0,
            "width": 30.0,
            "height": 20.0,
            "tailLiftRequired": false
          }
        ],
        "labels": [
          {
            "id": "905"
          }
        ],
        "proforma": {
          "id": "906"
        }
      },
      "fiscalDocument": {
        "id": "907"
      },
      "refundTransactions": []
    }
  },
  "extensions": {
    "queryComplexity": 73,
    "bucketBalance": 9927,
    "bucketRestoreRate": 100
  }
}

Relevant permissions

The operations in this page require the following permissions on the API credentials — they are configured for you by Calicantus.

  • repayment_request:query:repayment_request
  • repayment_request:read
  • order:read
  • order_line:read
  • repayment_line:read
  • repayment_returned_line:read
  • repayment_causal:read
  • repayment_shipping:read
  • warehouse:read
  • shipping_label:read
  • accounting_proforma:read
  • accounting_document:read
  • payment_transaction:read
  • shipping_carrier:read
  • shipping_parcel:read