Developers

Payment links API

Create, list and pause payment links programmatically.

Create reusable payment links from your code. Each payment through a link becomes its own checkout, with payment_link set to the link's id.

Custom form fields are set up in the dashboard, because answers are encrypted to a key that only exists in your browser.
POST/v1/payment_links

Body

titlestringrequired

What the customer is paying for.

currencystringrequired

USD or ZEC.

amount_typestringrequired

fixed (everyone pays amount) or custom (the customer chooses).

amountstring

Required for fixed links.

min_amount, max_amountstring

Optional bounds for custom links.

presetsstring[]

Up to 4 suggested amounts for custom links.

descriptionstring

Shown on the link's page.
curl https://api.petrapay.xyz/v1/payment_links \
  -H "Authorization: Bearer pp_sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "title": "Tip jar", "currency": "USD", "amount_type": "custom", "min_amount": "2", "presets": ["5", "10", "25"] }'

Retrieve, list and update

GET/v1/payment_links/{id}
GET/v1/payment_links
POST/v1/payment_links/{id}

Update accepts { "active": false } to pause a link, or true to resume it.