> ## Documentation Index
> Fetch the complete documentation index at: https://developers.leadwaycrm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List fulfillment

> List all fulfillment history of an order

List all fulfillment history of an order

```http theme={null}
GET https://services.leadconnectorhq.com/payments/orders/{orderId}/fulfillments
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="orderId" type="string" required default="653f5e0cde5a1314e62a837c">
  ID of the order that needs to be returned
</ParamField>

## Query parameters

<ParamField query="altId" type="string" required default="6578278e879ad2646715ba9c">
  Account Id or Agency Id
</ParamField>

<ParamField query="altType" type="string" required />

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="status" type="boolean" required default="True">
    Status of api action
  </ResponseField>

  <ResponseField name="data" type="object[]" required>
    An array of fulfilled items

    <Expandable title="cada item">
      <ResponseField name="altId" type="string" required default="6578278e879ad2646715ba9c">
        Account Id or Agency Id
      </ResponseField>

      <ResponseField name="altType" type="string" required>
        Posibles valores: 'account'
      </ResponseField>

      <ResponseField name="trackings" type="object[]" required>
        Fulfillment tracking information

        <Expandable title="cada item">
          <ResponseField name="trackingNumber" type="string" default="40012345678">
            Tracking number provided by the shipping carrier
          </ResponseField>

          <ResponseField name="shippingCarrier" type="string" default="FedEx">
            Shipping carrier name
          </ResponseField>

          <ResponseField name="trackingUrl" type="string" default="https://www.fedex.com/wtrk/track/?trknbr=40012345678">
            Tracking URL
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="_id" type="string" required default="655b33a82209e60b6adb87a5">
        The unique identifier for the fulfillment item.
      </ResponseField>

      <ResponseField name="items" type="object[]" required>
        Fulfilled items

        <Expandable title="cada item">
          <ResponseField name="_id" type="string" required default="6578278e879ad2646715ba9c">
            The id of product price
          </ResponseField>

          <ResponseField name="name" type="string" required default="Iphone 15 pro">
            Name
          </ResponseField>

          <ResponseField name="product" type="object" required>
            Product details
          </ResponseField>

          <ResponseField name="price" type="object" required>
            Price details
          </ResponseField>

          <ResponseField name="qty" type="number" required default="1">
            The no of quantity of the current fulfilled item
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="createdAt" type="string" required default="2023-12-12T09:27:42.355Z">
        created at
      </ResponseField>

      <ResponseField name="updatedAt" type="string" required default="2023-12-12T09:27:42.355Z">
        updated at
      </ResponseField>
    </Expandable>
  </ResponseField>

  ```json theme={null}
  {
    "status": true,
    "data": [
      {
        "altId": "6578278e879ad2646715ba9c",
        "altType": "account",
        "trackings": [
          {}
        ],
        "_id": "655b33a82209e60b6adb87a5",
        "items": [
          {}
        ],
        "createdAt": "2023-12-12T09:27:42.355Z",
        "updatedAt": "2023-12-12T09:27:42.355Z"
      }
    ]
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/fulfillments' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/fulfillments', {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
    },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'GET',
      'https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/fulfillments',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
      },
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/fulfillments');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'GET',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
      ],
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
