Payment Links
Payment Links — methods, parameters, and examples for easy-sdk (gem).
A payment link is a hosted, shareable URL that runs the Easy checkout without any code on your site. Use them for invoicing, sales outreach, and one-off requests for payment.
Accessed via client.payment_links. Maps to the /v1/api/payment-link/*
routes — branding endpoints under /v1/auth/branding/payment-link/* are
intentionally out of scope for this SDK.
Methods
create(**body)
POST /payment-link.
link = client.payment_links.create(
amount_type: "FIXED",
products: [
{ name: "Annual plan", quantity: 1, unit_price: 19_900, currency: "USD" }
]
)
puts link[:url]list(limit: nil, offset: nil, ids: nil)
GET /payment-link/.
client.payment_links.list(limit: 25)retrieve(id)
GET /payment-link/:id.
client.payment_links.retrieve("plink_…")update(id, **body)
PATCH /payment-link/:id. Adjust the active state, expiration, products,
or metadata.
client.payment_links.update("plink_…", active: false)delete(id)
DELETE /payment-link/:id.
client.payment_links.delete("plink_…")list_payments(id, limit: nil, offset: nil, ids: nil)
GET /payment-link/:id/payments. Every payment captured against a link.
client.payment_links.list_payments("plink_…", limit: 100)Object shape
The response includes :id, :url, :amount_type (FIXED or
CUSTOMER_DECIDES), :products, :active, :expires_at, :created_at,
:metadata, …
Examples
Send a fixed-amount link via email
link = client.payment_links.create(
amount_type: "FIXED",
products: [{ name: "Consultation", quantity: 1, unit_price: 25_000, currency: "USD" }],
expires_at: (Time.now + 7 * 86_400).iso8601
)
CustomerMailer.with(to: "client@example.com", url: link[:url]).pay_now.deliver_laterReconcile payments captured by a link
client.payment_links
.list_payments("plink_…", limit: 100)
.fetch(:data, [])
.each { |p| puts "#{p[:id]} — #{p[:amount]} #{p[:currency]}" }