🦙
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

Create a new payment

POST https://api.llamapay.io/charges

Headers

Name
Value

Authorization

llamapay_sk_YOUR_API_KEY

Body parameters

Key
Value
Example

pricing_type

Can be either: - fixed_price for simple one-time payments - no_price for payments where user picks amount, eg donations - subscription for recurring subscriptions

"fixed_price"

local_price

Amount to charge user. If pricing_type is subscription, this is the monthly cost

{ "amount": "10.00", "currency": "USD" }

metadata

[Optional] Arbitrary JSON object, it will be returned on webhooks for the payment. Object must be smaller than 20kB

{ "userId": "0xngmi" }

redirect_url

[Optional] URL to redirect user to after successful payment.

"https://mypage.com/success"

cancel_url

[Optional] URL to redirect user to if they cancel the payment

"https://mypage.com/failure"

Example body

Charge the user a one-time payment of 10$:

{
	"pricing_type": "fixed_price",
	"local_price": {
		"amount": "10.00",
		"currency": "USD"
	},
	"metadata": {
		"userId": "0xngmi"
	}
}

Response

{
  "data": {
    ...
    "hosted_url": "https://checkout.llamapay.io/pay/fd533947-6889-4970-8fb9-6441342dc07d",
    ...
  }
}
PreviousIntegrationNextSet up webhooks

Last updated 10 months ago