# /api/v1/items

#### GET - Get all items paginated with filter

This is an endpoint that implements filtering and pagination just like the previous endpoints.

You can fetch all the items created by the access token creator.

For items, the sortBy parameter and the parameters to filter by are the same. \
You can use the values from this enum to do it:

```typescript
enum Items_sortBy {
  created_at = "created_at",
  payee_address = "payee_address",
  currency = "currency",
  max_price = "max_price",
  debit_times = "debit_times",
  debit_interval = "debit_interval",
  button_id = "button_id",
  redirect_url = "redirect_url",
  pricing = "pricing",
  network = "network",
  name = "name",
  deleted = "deleted",
  payment_intents_count = "payment_intents_count",
}
```

#### POST - Create a new item

This is an authenticated endpoint that allows you to save a brand new item. <br>

{% hint style="success" %}
You can create a new item for each of your users automatically using the API. You don't have to use the dashboard to create them.
{% endhint %}

You need to send a post request to <https://debitllama.com/api/v1/items> to save a new item.

Request Body:

```typescript
        name : string,
        chainId : string,
        walletaddress : string,
        currency : CurrencyApiV1,
        pricing : "Fixed" | "Dynamic",
        maxAmount : string,
        debitTimes: number,
        debitInterval : number,
        redirectto : string,
```

Let me explain them in order:

* **name** is the name of your item. It will be visible on the checkout page
* **chainId** is the hexadecimal blockchain id the account needs to be created on
* **walletaddres** is the recipient's wallet address, all payments will be forwarded here&#x20;
* **currency** is the tokens used for payment, it's an object with a defined schema.
* **pricing** is the subsciption payment flow. It is either Fixed or Dynamic
* **maxAmount** is the amount paid for the subscription. For Fixed pricing this is the actual amount that is automatically paid, for Dynamic this is the maximum that can be debited and serves as a limit
* **debitTimes** is the amount of times the subsciption payments are allowed to happen. Must be an Integer!
* **debitInterval** is the time in days that must pass before the next payment is available
* **redirectto** must be a valid URL string, it is the website the checkout will redirect to after payment

The Api returns the same response as /api/v1/items/\[slug] so navigate to the next page to learn more about it!


---

# Agent Instructions: 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:

```
GET https://debitllama.gitbook.io/debitllama/rest-api-v1/api-v1-items.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
