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

# Quick Start

In this guide, we will go through the process of setting up an API connection, and a few basic endpoints that you can use for EDI document management.

We will use PHP as the example language but you can translate the examples to any programming language you desire.

## Connecting to the API

We assume for this PHP example that `Guzzle` is installed and available to the script.

<CodeGroup>
  ```php php theme={null}
  $client = new \GuzzleHttp\Client();

  $response = $client->request('GET', '<your-desired-endpoint>', [
  'headers' => [
  'Accept' => 'application/json',
  'Authorization' => 'Bearer <your-api-token>',
  ],
  ]);
  ```
</CodeGroup>

## Listing Documents

Following on from this, you can use the connection to list orders from your trade partners.

<CodeGroup>
  ```php php theme={null}
  $response = $client->request('GET', 'https://api.procuros.io/v2/transactions', [
    'headers' => $headers,
  ]);

  $body = json_decode((string) $response->getBody());

  $items = $body->items;
  ```
</CodeGroup>

All types of documents are returned from this API call. In order to filter for a specific type, you may pass the `filter` URL parameter. For example:

<CodeGroup>
  ```php php theme={null}
  $response = $client->request('GET', 'https://api.procuros.io/v2/transactions?filter[type]=ORDER', [
    'headers' => $headers,
  ]);
  ```
</CodeGroup>

For a list of all available parameters, please see the [List Incoming Transactions](/en/api/v2/incoming-transactions/list-incoming-transactions) API reference.

## Sending Documents

Similar to listing documents, you can use the connection to send documents to your trade partners.

<CodeGroup>
  ```php php theme={null}
  $transaction =   [
    "type": "ORDER",
    "content": [
      "header": [
        "orderIdentifier": "bestellung-20231203-001",
        "orderDate": "2023-12-03",
        "currency": "EUR",
        "requestedDeliveryDate": "2023-12-06",
        "buyer": ["identifiers": [["domain": "GS1", "identifier": "3220010000001" ]]],
        "supplier": ["identifiers": [["domain": "GS1", "identifier": "3220010000013" ]]],
        "billTo": ["identifiers": [["domain": "GS1", "identifier": "3220010000001" ]]],
        "shipTo": ["identifiers": [["domain": "GS1", "identifier": "3220010000003" ]]],
      ],
      "items": [
        [
          "identifiers": [["domain": "GS1", "identifier": "2330000000007" ]],
          "lineNumber": 1,
          "quantity": 10,
          "isDepositItem": false,
          "unitOfMeasure": "EA",
          "description": "A description of the item",
          "requestedDeliveryDate": null,
          "unitPrice": 1.23
        ]
      ]
    ]
  ];

  $client->request('POST', 'https://api.procuros.io/v2/transactions', [
  'headers' => $headers,
  'json' => $transaction,
  ]);

  ```
</CodeGroup>

For a list of all available document types that can be created, as well as the JSON body format for each, please see the [Send Transaction](/en/api/v2/outgoing-transactions/send-transaction) API reference.
