Payment links

Create a payment link: a hosted page at /l/{id} and the target of the widget's buy button

post/payment_links

Request

  • Base URL: https://shieldz.cash/api/v1
  • URL: https://shieldz.cash/api/v1/payment_links
  • Auth: HTTP bearer

Request body

idempotency_keystring

Retrying with the same key returns the first object (200, idempotent_replay: true) instead of creating another. The SDKs add one for you.

collect_emailboolean

Ask the buyer for an email before payment.

collect_shipping_addressboolean

Ask for a shipping address. It's on the invoice as shipping, for your API key and webhooks only.

Example request

{
  "line_items": [
    {
      "product": "prod_3hQ8ZpW2Nc6Ty0Lk",
      "quantity": 1,
      "adjustable_quantity": {
        "enabled": true,
        "minimum": 1,
        "maximum": 5
      }
    }
  ],
  "collect_shipping_address": true,
  "after_completion": {
    "type": "hosted_confirmation",
    "hosted_confirmation": {
      "custom_message": "Thanks! We ship within 2 days."
    }
  }
}

Response

Created

idstring
object'payment_link'
urlstring uri

The hosted page (/l/plink_…). Share it, or put the ID on a buy button: <button data-shieldz-link="plink_…">.

activeboolean

false once turned off; the page then says the item isn't available.

collect_emailboolean
collect_shipping_addressboolean
after_completionobject

{ type: "redirect", redirect: { url } } or { type: "hosted_confirmation", hosted_confirmation: { custom_message } }.

paid_countinteger

Invoices from this link that were paid.

paid_usd_centsinteger

Their total, in USD cents.

created_atinteger

Unix milliseconds.

updated_atinteger

Unix milliseconds.

Example response

{
  "id": "plink_7Gd1KsP0aZ4Hn8Wq",
  "line_items": [
    {
      "price": {
        "id": "price_9fK2LmQx7Rt4Vb1N"
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.