> For the complete documentation index, see [llms.txt](https://docs.pgecom.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pgecom.com/api-endpoint/ecommerce/form/getformbyid.md).

# GetFormById

You'll need to replace the {{formId}} with the actual form to fetch the API

<mark style="color:blue;">`GET`</mark> `https://sandbox.pgecom.com/api/v1/order-form/{{formId}}`

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "href": "/shoes",
    "shopId": "0a40d129-0728-4b10-b32e-117abd6938c3",
    "updatedAt": "2023-11-22T22:55:37Z",
    "slug": "shoes",
    "createdAt": "2023-11-22T22:55:37Z",
    "menuItemId": "db123901-5646-4061-88d8-bfcb83df21aa",
    "productIds": [],
    "id": "acdc3018-1fb9-4127-9097-f1b8270d87d5",
    "title": "Shoes",
    "subCategories": [
        {
            "href": "/sandal",
            "shopId": "0a40d129-0728-4b10-b32e-117abd6938c3",
            "categoryId": "acdc3018-1fb9-4127-9097-f1b8270d87d5",
            "updatedAt": "2023-11-27T10:31:22Z",
            "createdAt": "2023-11-27T10:31:22Z",
            "id": "9f4bcae6-a199-4adc-80fa-d02234550c86",
            "title": "Sandal"
        }
    ]
}
```

{% endtab %}

{% tab title="404: Not Found Not found" %}

```json
{
    "message": "Category with id acdc3018-1fb9-4127-9097-f1b8270d87d not found",
    "status": 404
}
```

{% endtab %}

{% tab title="429: Too Many Requests Too many request" %}

```json
{
    "message": "Too many requests, please try again later.",
    "status": 429
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Nodejs" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://sandbox.pgecom.com/api/v1/storefront/category/acdc3018-1fb9-4127-9097-f1b8270d87d5',
  headers: { }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://sandbox.pgecom.com/api/v1/storefront/category/acdc3018-1fb9-4127-9097-f1b8270d87d5"

payload = {}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require "uri"
require "net/http"

url = URI("https://sandbox.pgecom.com/api/v1/storefront/category/acdc3018-1fb9-4127-9097-f1b8270d87d5")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://sandbox.pgecom.com/api/v1/storefront/category/acdc3018-1fb9-4127-9097-f1b8270d87d5');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

{% endtab %}

{% tab title="Curl" %}

```javascript
curl --location 'https://sandbox.pgecom.com/api/v1/storefront/category/acdc3018-1fb9-4127-9097-f1b8270d87d5'
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pgecom.com/api-endpoint/ecommerce/form/getformbyid.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
