API Reference
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.
Creates a new payment that users can then pay
{"amount":"10.00","currency":"USD"}
{"userId":"0xngmi"}
https://mypage.com/success
https://mypage.com/failure
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"
}
}
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.
Optional and for pagination, filters results to those whose id parameters are higher than the id sent
Optional and for pagination, filters results to those whose id parameters are lower than the id sent
GET /charges HTTP/1.1
Host: api.llamapay.io
Authorization: YOUR_API_KEY
Accept: */*
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"
}
]
}
id parameter obtained from /charges or webhook events
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"
}
}
Last updated