/api/v1/items/[slug]

You can fetch an item by Id. The Response when creating an item contains an item_id variable which can be used. This variable is the same as the button_id which is used for creating a valid checkout button.

Example response:

GET https://debitllama/api/v1/items/89f41c73-7626-4e00-8090-1d91c83c3565

// {
  _self: {
    href: "/api/v1/items/89f41c73-7626-4e00-8090-1d91c83c3565",
    methods: [ "GET", "POST" ]
  },
  _version: "v1",
  _description: "GET: Fetch an item by item_id. POST: Update redirect_url and deactivate item",
  _links: [
    {
      href: "/api/v1/items/89f41c73-7626-4e00-8090-1d91c83c3565 ",
      methods: [ "GET", "POST" ]
    },
    {
      href: "https://debitllama.com/buyitnow?q=89f41c73-7626-4e00-8090-1d91c83c3565",
      methods: [ "GET", "POST" ]
    }
  ],
  item: {
    id: 58,
    created_at: "2023-12-30T16:06:57+00:00",
    payee_address: "0xD97F13b8fd8a54434F7Bd7981F0D6C82EA1b59F3",
    currency: { name: "BTT", native: true, contractAddress: "" },
    max_price: 5000,
    debit_times: 1,
    debit_interval: 1,
    button_id: "89f41c73-7626-4e00-8090-1d91c83c3565",
    redirect_url: "https://asd.com",
    pricing: "Fixed",
    network: {
      name: "BTT Donau Testnet",
      rpc: "https://pre-rpc.bt.io/",
      chain_id: "0x405",
      virtual_accounts_contract: "0xF75515Df5AC843a8B261E232bB890dc2F75A4066",
      connected_wallets_contract: "0x9c85da9E45126Fd45BC62656026A2E7226bba239",
      currency: "BTT",
      available_currencies: [
        { name: "BTT", native: true, contractAddress: "" },
        {
          name: "USDTM",
          native: false,
          contractAddress: "0x4420a4415033bd22393d3A918EF8d2c9c62efD99"
        }
      ]
    },
    name: "testitemname",
    deleted: false,
    payment_intents_count: 0
  },
  checkout: "https://debitllama.com/buyitnow?q=89f41c73-7626-4e00-8090-1d91c83c3565",
  item_id: "89f41c73-7626-4e00-8090-1d91c83c3565"
}

The response contains the link to the checkout in the _links array, you can use it to directly navigate your customers to the checkout page.

Update the item POST

You can disable the item or update it's redirect url using a POST request

Deleting an item is not permanent, it will only disable the checkout, you can re-enable the item again any time.

Request example:

POST https://debitllama/api/v1/items/89f41c73-7626-4e00-8090-1d91c83c3565

Body:

{
    type: "delete" | "redirect",
    value: string | boolean
}

You must specify if you want to delete the item or update the redirect link using type and set the value you want to add.

Last updated