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
idstringRequiredUnique identifier for the object.
objectstringRequiredString naming the object's type.
livemodebooleanRequiredtruewhen the object exists in live mode,falsein test mode.activebooleanRequiredWhether the link can still be used. A link with a limit turns itself off once the limit is reached.
inactive_messagestringRequiredNullableMessage the hosted page shows when the link is not active.
nullwhen not set.urlstringRequiredURL of the hosted page. Share it with buyers.
currencystringRequiredThree-letter ISO currency code of the link's prices.
allow_promotion_codesbooleanRequiredWhether buyers can enter a promotion code on the hosted page.
payment_method_typesarray of stringsRequiredPayment method types the hosted page offers, for example
card.[]offers every method your account accepts in the country.metadataobjectRequiredKey-value pairs you attach to the object for your own use. Paycose never reads or changes them.
after_completionobjectRequiredWhat the buyer sees after paying.
Show child attributes
after_completion.typestringRequiredWhich page follows a payment.
hosted_confirmationPaycose's confirmation page, with your message.
redirectYour page; the buyer is sent to
redirect.url.
after_completion.hosted_confirmationobjectNullableThe confirmation page's message. Set when
typeishosted_confirmation.Show child attributes
after_completion.hosted_confirmation.custom_messagestringYour message on the page, up to 500 characters. Omitted when not set.
after_completion.redirectobjectNullableWhere the buyer is sent. Set when
typeisredirect.Show child attributes
after_completion.redirect.urlstringRequiredHTTPS URL of your page.
{CHECKOUT_SESSION_ID}in it is replaced by the paid session's ID.
customer_creationenumRequiredWhether every buyer becomes a customer, or only when something requires one.
if_requiredA 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.alwaysEvery buyer must enter their name and email, and becomes a customer before paying.
invoice_creationobjectRequiredWhether each payment through the link also issues an invoice.
Show child attributes
invoice_creation.enabledbooleanRequiredWhether each payment also issues an invoice and its receipt.
invoice_creation.invoice_dataobjectNullableWhat each invoice carries. Omitted when not set.
Show child attributes
invoice_creation.invoice_data.descriptionstringMemo on the invoice. Omitted when not set.
invoice_creation.invoice_data.metadataobjectKey-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 stringsIDs of the tax rates applied to each invoice, a Paycose addition for VAT. Omitted when none.
subscription_dataobjectRequiredNullableThe subscription each buyer starts, for a link of recurring prices.
nullfor a link of one-time prices.Show child attributes
subscription_data.descriptionstringDescription of each subscription. Omitted when not set.
subscription_data.trial_period_daysintegerDays of free trial before the first charge. Omitted when there is none.
subscription_data.metadataobjectKey-value pairs you attach to the object for your own use. Paycose never reads or changes them.
restrictionsobjectRequiredNullableThe link's limit on completed payments, with how many it completed so far.
nullwhen the link has no limit.Show child attributes
restrictions.completed_sessionsobjectRequiredThe limit and how many payments the link completed.
Show child attributes
restrictions.completed_sessions.countintegerRequiredNumber of payments the link completed.
restrictions.completed_sessions.limitintegerRequiredNumber of payments after which the link turns itself off.
payment_intent_dataobjectRequiredNullableWhat each payment carries:
capture_method.nullon a link of recurring prices.Show child attributes
payment_intent_data.capture_methodstringRequiredautomaticcaptures each payment when the buyer pays;manualonly authorizes it so you capture later, and the sale counts at authorization. Defaults toautomatic.
transfer_dataobjectRequiredNullableConnected account each payment goes to; Paycose keeps the fee lines, shipping and tax.
nullwhen none.Show child attributes
transfer_data.destinationstringRequiredConnected account (
acct_…) each payment goes to.
on_behalf_ofstringRequiredNullableConnected account the payments are made on behalf of.
nullwhen none.shipping_address_collectionobjectRequiredNullableAsks the buyer for a shipping address in one of
allowed_countriesbefore paying. One-time prices only.Show child attributes
shipping_address_collection.allowed_countriesarray of stringsRequiredTwo-letter country codes the order ships to.
shipping_optionsarray of objectsRequiredShipping rate each payment is charged, at most one. One-time prices only.
Show child attributes
shipping_options.shipping_ratestringRequiredID of an active shipping rate in the link's currency.
default_tax_ratesarray of stringsRequiredTax rates applied to every line, up to 5, each active.
default_feesarray of stringsRequiredFees added to every payment, up to 10. With
transfer_datathey are Paycose's application fee.discountsarray of objectsRequiredCoupon every payment takes, at most one. Not with
allow_promotion_codes.Show child attributes
discounts.couponstringRequiredID of the coupon applied to every payment.
withholding_taxobjectRequiredNullableThai withholding a buyer with a Thai VAT ID deducts.
nullwhen off.Show child attributes
withholding_tax.rateintegerRequiredWithholding percent: 1, 2, 3 or 5; 0 turns it off.
createdtimestampRequiredTime the object was created, in Unix seconds.
updatedtimestampRequiredTime the object last changed, in Unix seconds.