Skip to Content
Paycose Docs
Payment links

Payment links

The payment_link object

A payment link is a shareable URL to a Paycose-hosted page that sells a fixed set of prices. Anyone can open it any number of times; each visit is a checkout session of its own, and each payment a payment intent of its own. List the sessions that paid through a link with GET /checkouts?payment_link=.

Attributes

  • idstringRequired

    Unique identifier for the object.

  • objectstringRequired

    String naming the object's type.

  • livemodebooleanRequired

    true when the object exists in live mode, false in test mode.

  • activebooleanRequired

    Whether the link can still be used. A link with a limit turns itself off once the limit is reached.

  • inactive_messagestringRequiredNullable

    Message the hosted page shows when the link is not active. null when not set.

  • urlstringRequired

    URL of the hosted page. Share it with buyers.

  • currencystringRequired

    Three-letter ISO currency code of the link's prices.

  • allow_promotion_codesbooleanRequired

    Whether buyers can enter a promotion code on the hosted page.

  • payment_method_typesarray of stringsRequired

    Payment method types the hosted page offers, for example card. [] offers every method your account accepts in the country.

  • metadataobjectRequired

    Key-value pairs you attach to the object for your own use. Paycose never reads or changes them.

  • after_completionobjectRequired

    What the buyer sees after paying.

    Show child attributes
    • after_completion.typestringRequired

      Which page follows a payment.

      • hosted_confirmation

        Paycose's confirmation page, with your message.

      • redirect

        Your page; the buyer is sent to redirect.url.

    • after_completion.hosted_confirmationobjectNullable

      The confirmation page's message. Set when type is hosted_confirmation.

      Show child attributes
      • after_completion.hosted_confirmation.custom_messagestring

        Your message on the page, up to 500 characters. Omitted when not set.

    • after_completion.redirectobjectNullable

      Where the buyer is sent. Set when type is redirect.

      Show child attributes
      • after_completion.redirect.urlstringRequired

        HTTPS URL of your page. {CHECKOUT_SESSION_ID} in it is replaced by the paid session's ID.

  • customer_creationenumRequired

    Whether every buyer becomes a customer, or only when something requires one.

    • if_required

      A buyer becomes a customer only when the payment needs one: when the link issues invoices (invoice_creation) or starts a subscription. Otherwise the buyer pays as a guest, and the name and email they enter are kept as the payment's billing details.

    • always

      Every buyer must enter their name and email, and becomes a customer before paying.

  • invoice_creationobjectRequired

    Whether each payment through the link also issues an invoice.

    Show child attributes
    • invoice_creation.enabledbooleanRequired

      Whether each payment also issues an invoice and its receipt.

    • invoice_creation.invoice_dataobjectNullable

      What each invoice carries. Omitted when not set.

      Show child attributes
      • invoice_creation.invoice_data.descriptionstring

        Memo on the invoice. Omitted when not set.

      • invoice_creation.invoice_data.metadataobject

        Key-value pairs you attach to the object for your own use. Paycose never reads or changes them.

      • invoice_creation.invoice_data.default_tax_ratesarray of strings

        IDs of the tax rates applied to each invoice, a Paycose addition for VAT. Omitted when none.

  • subscription_dataobjectRequiredNullable

    The subscription each buyer starts, for a link of recurring prices. null for a link of one-time prices.

    Show child attributes
    • subscription_data.descriptionstring

      Description of each subscription. Omitted when not set.

    • subscription_data.trial_period_daysinteger

      Days of free trial before the first charge. Omitted when there is none.

    • subscription_data.metadataobject

      Key-value pairs you attach to the object for your own use. Paycose never reads or changes them.

  • restrictionsobjectRequiredNullable

    The link's limit on completed payments, with how many it completed so far. null when the link has no limit.

    Show child attributes
    • restrictions.completed_sessionsobjectRequired

      The limit and how many payments the link completed.

      Show child attributes
      • restrictions.completed_sessions.countintegerRequired

        Number of payments the link completed.

      • restrictions.completed_sessions.limitintegerRequired

        Number of payments after which the link turns itself off.

  • payment_intent_dataobjectRequiredNullable

    What each payment carries: capture_method. null on a link of recurring prices.

    Show child attributes
    • payment_intent_data.capture_methodstringRequired

      automatic captures each payment when the buyer pays; manual only authorizes it so you capture later, and the sale counts at authorization. Defaults to automatic.

  • transfer_dataobjectRequiredNullable

    Connected account each payment goes to; Paycose keeps the fee lines, shipping and tax. null when none.

    Show child attributes
    • transfer_data.destinationstringRequired

      Connected account (acct_…) each payment goes to.

  • on_behalf_ofstringRequiredNullable

    Connected account the payments are made on behalf of. null when none.

  • shipping_address_collectionobjectRequiredNullable

    Asks the buyer for a shipping address in one of allowed_countries before paying. One-time prices only.

    Show child attributes
    • shipping_address_collection.allowed_countriesarray of stringsRequired

      Two-letter country codes the order ships to.

  • shipping_optionsarray of objectsRequired

    Shipping rate each payment is charged, at most one. One-time prices only.

    Show child attributes
    • shipping_options.shipping_ratestringRequired

      ID of an active shipping rate in the link's currency.

  • default_tax_ratesarray of stringsRequired

    Tax rates applied to every line, up to 5, each active.

  • default_feesarray of stringsRequired

    Fees added to every payment, up to 10. With transfer_data they are Paycose's application fee.

  • discountsarray of objectsRequired

    Coupon every payment takes, at most one. Not with allow_promotion_codes.

    Show child attributes
    • discounts.couponstringRequired

      ID of the coupon applied to every payment.

  • withholding_taxobjectRequiredNullable

    Thai withholding a buyer with a Thai VAT ID deducts. null when off.

    Show child attributes
    • withholding_tax.rateintegerRequired

      Withholding percent: 1, 2, 3 or 5; 0 turns it off.

  • createdtimestampRequired

    Time the object was created, in Unix seconds.

  • updatedtimestampRequired

    Time the object last changed, in Unix seconds.