🦙
LlamaPay
  • Overview
  • Payments Gateway
    • Why use LlamaPay?
      • How are gas fees so cheap?
      • Why use LlamaPay instead of paying and sending an etherscan link?
    • Integration
      • Create a new payment
      • Set up webhooks
      • API Reference
    • Subscriptions Yield
  • Pricing
  • Outgoing Payments
    • Features
      • Multi-chain
      • Deposits
      • Withdrawals
      • Debt
      • Gas
      • Disperse
      • Precision
    • Gnosis Safe
      • Importing CSV for Vesting
    • Bot
    • Links
    • Tutorials
      • Depositing
      • Creating a Stream
      • Withdrawing
    • Importing CSV for Payments
    • Contracts
    • Subgraph
    • FAQ
      • How LlamaPay works
      • How to Withdraw from LlamaPay
  • Security
    • Bounty
Powered by GitBook
On this page
  1. Payments Gateway
  2. Integration

API Reference

PreviousSet up webhooksNextSubscriptions Yield

Last updated 10 months ago

Authentication

All calls must be authenticated with the header Authorization: llamapay_sk_YOUR_API_KEY. You can obtain the required API Key in the Developer tab on .

LlamaPay's interface

Fetch a paginated list of payments

get

Pagination is handled by querying the urls returned in pagination.previous_uri and pagination.next_uri or by using the query parameters ending_before and starting_after directly with payment ids. In other words, to see all results keep querying pagination.next_uri until its null.

Authorizations
Query parameters
starting_afterstringOptional

Optional and for pagination, filters results to those whose id parameters are higher than the id sent

ending_beforestringOptional

Optional and for pagination, filters results to those whose id parameters are lower than the id sent

Responses
200
Array of payments
application/json
get
GET /charges HTTP/1.1
Host: api.llamapay.io
Authorization: YOUR_API_KEY
Accept: */*
200

Array of payments

{
  "pagination": {
    "previous_uri": "https://api.llamapay.io/charges?ending_before=fd533947-6889-4970-8fb9-6441342dc07d",
    "next_uri": "https://api.llamapay.io/charges?starting_after=082ac3c4-8c93-4c59-8e43-e4531640e264"
  },
  "data": [
    {
      "id": "3e66112f-e4ad-4d5d-acb2-332e18fe4e4f",
      "hosted_url": "https://checkout.llamapay.io/pay/3e66112f-e4ad-4d5d-acb2-332e18fe4e4f",
      "created_at": "2024-07-01T04:57:41.034Z",
      "metadata": {
        "userId": "0xngmi"
      },
      "pricing_type": "fixed_price"
    }
  ]
}

Fetch a single payment

get
Authorizations
Path parameters
payment_idstringRequired

id parameter obtained from /charges or webhook events

Responses
200
Payment info
application/json
404
Payment doesn't exist
get
GET /charges/{payment_id} HTTP/1.1
Host: api.llamapay.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": {
    "id": "3e66112f-e4ad-4d5d-acb2-332e18fe4e4f",
    "hosted_url": "https://checkout.llamapay.io/pay/3e66112f-e4ad-4d5d-acb2-332e18fe4e4f",
    "created_at": "2024-07-01T04:57:41.034Z",
    "metadata": {
      "userId": "0xngmi"
    },
    "pricing_type": "fixed_price"
  }
}
  • Authentication
  • POSTCreate a new payment
  • GETFetch a paginated list of payments
  • GETFetch a single payment

Create a new payment

post

Creates a new payment that users can then pay

Authorizations
Body
pricing_typestring · enumOptionalPossible values:
local_priceobjectOptionalExample: {"amount":"10.00","currency":"USD"}
metadataobjectOptionalExample: {"userId":"0xngmi"}
redirect_urlstringOptionalExample: https://mypage.com/success
cancel_urlstringOptionalExample: https://mypage.com/failure
Responses
200
Successfully created a payment
application/json
401
Invalid API Key sent on Authorization header
post
POST /charges HTTP/1.1
Host: api.llamapay.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 197

{
  "pricing_type": "fixed_price",
  "local_price": {
    "amount": "10.00",
    "currency": "USD"
  },
  "metadata": {
    "userId": "0xngmi"
  },
  "redirect_url": "https://mypage.com/success",
  "cancel_url": "https://mypage.com/failure"
}
{
  "data": {
    "id": "3e66112f-e4ad-4d5d-acb2-332e18fe4e4f",
    "hosted_url": "https://checkout.llamapay.io/pay/3e66112f-e4ad-4d5d-acb2-332e18fe4e4f",
    "created_at": "2024-07-01T04:57:41.034Z",
    "metadata": {
      "userId": "0xngmi"
    },
    "pricing_type": "fixed_price"
  }
}