Payment links

Collect a subscription now (merchant)

"Collect now" for one subscriber of this link: charges the current period at any time within it (the merchant's choice, not the automatic window). A success also restarts automatic collection for a stopped subscriber; a failure changes nothing but the reason shown. An ended subscription is never revived (the buyer may have signed up again since): it answers PERMISSION_REVOKED or SUBSCRIPTION_EXPIRED.

post/v1/links/collect

Request

  • Base URL: https://api.p2flux.com
  • URL: https://api.p2flux.com/v1/links/collect
  • Auth: none required

Request body

managestring required

A signed P2Flux capability: payment intent (p2f1.), setup token (p2setup2.), subscription capability (p2s2.), cancel token (p2cancel1.) or refund token (p2refund1.). Opaque to the caller and unforgeable - the signature is what authorises the call. Treat it as a bearer secret: keep it server-side, never in a URL query or a log.

subscription_idstring required

A 32-byte hex value, lowercase. Transaction hashes and references.

Example request

{
  "subscription_id": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708"
}

Response

The charge result, as /v1/charges answers it.

status'CHARGED' | 'ALREADY_CHARGED' | 'CONFIRMING'
period_indexinteger
tx_hashstring

A 32-byte hex value, lowercase. Transaction hashes and references.

next_period_atstring

Example response

{
  "tx_hash": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708"
}

Changes

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