payment-links

Stable. Describes behaviour that is built and covered by tests in this repository.

API reference

Models

CreatePaymentLinkRequest

FieldTypeDescription
kindinvoice | adhoc | credit_packDefault: invoice when invoice_id is set, credit_pack when pack_id is set, else adhoc
invoice_idstring · uuid
pack_idstring · uuidcredit_pack: the active credit pack to sell. Its price and currency become the link's amount; they are never taken from the request
quantityintegercredit_pack: how many packs one payment buys (default 1)
amount_minorstring · int64adhoc: a positive int64 in minor units (a string or a number)
currencystringadhoc: ISO 4217; the tenant's currency when empty
descriptionstringadhoc: what it is for; printed on the invoice
customer_external_idstringadhoc: make the invoice out to this customer. credit_pack: required, the customer who receives the credits
single_usebooleanDefault true for adhoc, false for invoice
promotion_codestringadhoc and credit_pack, optional: a promotion code the payer gets without typing it (a one-off invoice with a discount). Checked against the link's own amount now (a coupon.* error if it does not work); claimed when the payer continues. An invoice that exists is not changed, so a kind invoice link takes none
required_contractsarray of distance_sales | pre_info | tos | privacyOptional: the agreements the payer must accept on this link's page. The list replaces the seller's tenant-wide required_kinds for this link (it does not add to it); empty or absent: the setting applies. The texts must be published before the link is used, or the page offers no way to pay. An ad-hoc link hands its list to the invoice link the payer continues on. 400 billing.payment_link.bad_required_contracts for an unknown kind or one named twice
expires_in_daysintegerDefault 30 for adhoc, 90 for invoice
idempotency_keystring

Error

FieldTypeDescription
error requiredobject

ListPaymentLinksResponse

FieldTypeDescription
links requiredarray of PaymentLink
next_page_token requiredstring