# Retrieve Incoming Peppol Documents with Sorting and Filters

Retrieve Incoming Peppol Documents. Use the 'sortField' parameter to choose the ordering field: 'createdAt' (default) or 'lastModifiedAt', and the 'sortOrder' parameter to choose the direction: 'desc' (default) or 'asc'. The 'from' and 'until' filters apply to the same field selected by 'sortField'. By default, the response contains the 100 (maxItems property) first items. To retrieve the next items matching the request, use the query parameter 'after' with the ID of the last item.

Endpoint: GET /peppol-incoming-documents
Version: 1.0.0
Security: api_key

## Security:

  - `api_key` (unknown)
    apiKey in header x-api-key

## Query parameters:

  - `id` (string)
    Filter for a Peppol Incoming Document using a specific DocumentID

  - `senderName` (string)
    Filter for a Peppol Incoming Document with a given Sender Name

  - `documentType` (string)
    Document Type of the Peppol Incoming Document

  - `status` (array)
    Only return documents with one of these statuses. Repeat the parameter for several statuses, for example status=NOT_STARTED&status=ON_HOLD

  - `from` (string)
    Filter for PePPOL Documents with the sort field (createdAt by default, or lastModifiedAt when sortField=lastModifiedAt) greater than a specific datetime expressed in UTC timezone (format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

  - `until` (string)
    Filter for PePPOL Documents with the sort field (createdAt by default, or lastModifiedAt when sortField=lastModifiedAt) less than a specific datetime expressed in UTC timezone (format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

  - `sortField` (string)
    Field used to sort the results. The from/until filters apply to this same field. Defaults to createdAt.

  - `sortOrder` (string)
    Order in which to sort the results. Defaults to desc.

  - `after` (string)
    Pagination cursor. Provide the 'after' parameter value returned in the previous response to retrieve the next page of Peppol Documents (items that come immediately after that document in the result order). This value must be URL-encoded as it may contain special characters like #.

  - `maxItems` (number)
    Maximum number (1 - 1000) of Peppol Documents that might be returned. It is possible that the response contains fewer elements. Default to 100

## Header parameters:

  - `x-managed-company-id` (string)
    Optional: the ID of the managed company on behalf of which the request is made

## Response 200 fields (application/json):

  - `items` (array, required)
    List of items for the current page

  - `items.id` (string, required)
    Unique identifier of the Peppol Document

  - `items.companyId` (string, required)
    Company identifier

  - `items.issueDate` (string, required)
    Issue Date of the Peppol Document

  - `items.senderParticipantId` (string, required)
    Sender Participant identification

  - `items.receiverParticipantId` (string, required)
    Receiver Participant identification

  - `items.createdAt` (string, required)
    Datetime of the Peppol Document creation

  - `items.lastModifiedAt` (string, required)
    Datetime of the last modification

  - `items.lastModifiedBy` (string, required)
    User who last modified the document

  - `items.direction` (string, required)
    Direction of the Peppol Document
    Enum: "INCOMING"

  - `items.senderLegalPartyRegistrationName` (string)
    Sender name

  - `items.status` (string, required)
    Processing status set in the portal or through the Public API. NOT_STARTED until it is first changed
    Enum: "NOT_STARTED", "IN_PROGRESS", "ON_HOLD", "DONE"

  - `items.lastStatusChange` (object)
    Most recent status change. Absent when the status was never changed

  - `items.lastStatusChange.from` (string, required)
    Enum: "NOT_STARTED", "IN_PROGRESS", "ON_HOLD", "DONE"

  - `items.lastStatusChange.to` (string, required)
    Enum: "NOT_STARTED", "IN_PROGRESS", "ON_HOLD", "DONE"

  - `items.lastStatusChange.changedAt` (string, required)

  - `items.lastStatusChange.changedBy` (object, required)

  - `items.lastStatusChange.changedBy.type` (string, required)
    Who changed the status: a portal user, EasyPost support or an integration through the Public API
    Enum: "USER", "EASYPOST_SUPPORT", "PUBLIC_API"

  - `items.lastStatusChange.changedBy.name` (string)
    Name of the portal user. Only present when type is USER

  - `items.documentType` (string, required)
    Enum: "INVOICE_RESPONSE_3_0"

  - `items.documentReference` (string, required)

  - `items.responseStatus` (string, required)
    Enum: "SENT", "NOT_SENT", "ACKNOWLEDGED", "IN_PROCESS", "UNDER_QUERY", "COND_ACCEPTED", "REJECTED", "ACCEPTED", "PAID"

  - `items.ttl` (number, required)

  - `items.currency` (string, required)
    ISO 4217 currency code, as sent in the UBL
    Example: EUR

  - `items.dueDate` (string)

  - `items.documentType` (string, required)
    Enum: "BIS_BILLING_CREDIT_NOTE_V3", "BIS_BILLING_INVOICE_V3", "BIS_SELF_BILLING_INVOICE_V3", "BIS_SELF_BILLING_CREDIT_NOTE_V3"

  - `items.totalAmount` (number, required)

  - `items.supplierParty` (object, required)

  - `items.supplierParty.endpointId` (string, required)

  - `items.supplierParty.legalRegistrationName` (string, required)

  - `items.supplierParty.postalAddress` (object, required)

  - `items.supplierParty.postalAddress.country` (string, required)
    Country code from the UBL (Peppol code list: ISO 3166-1 alpha-2, plus 1A for Kosovo and XI for Northern Ireland)
    Enum: "AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW", "1A", "XI"

  - `items.supplierParty.postalAddress.streetName` (string, required)

  - `items.supplierParty.postalAddress.additionalStreetName` (string, required)

  - `items.supplierParty.postalAddress.cityName` (string, required)

  - `items.supplierParty.postalAddress.postalZone` (string, required)

  - `items.documentType` (string, required)
    Enum: "ORDER_3_0", "ORDER_AGREEMENT_3_0", "ORDER_RESPONSE_3_0", "CATALOGUE_3_0", "CATALOGUE_RESPONSE_3_0", "PUNCH_OUT_3_0", "DESPATCH_ADVICE_3_0", "MESSAGE_LEVEL_RESPONSE_3_0", "ORDER_CHANGE", "ORDER_CANCELLATION", "ORDER_RESPONSE_ADVANCED", "UNKNOWN"

  - `totalItems` (number, required)
    Total number of items available (without pagination)

  - `after` (string)
    Pagination cursor of the current page. This identifier represents the last item returned in the response. Use its value as the 'after' parameter in the next request to retrieve the following page of results.

## Response 400:

  - `400` (unknown)
    Invalid query parameter format or cursor

