List OCP links
List your payment links, newest first. 15 per page by default.
query Parameters
per_pageinteger · min: 1 · max: 250Results per page, maximum 250. The default depends on the endpoint: 25 for invoices and contacts, 50 for products, 20 for payments, purchases and tags, 15 for OCP links. Responses carry
links.next(null on the last page) andmeta.current_page/meta.last_page; request the next page withpage=<n>.Example: 100pageinteger · min: 1The page to return.
qstringLinks of contacts whose company, AFM, email, phone or alias contains this text.
tagidintegerOnly links with this tag id.
unpaidstring · enumon: only links with a customer that have not been paid.Enum values:onscheduledstringOnly recurring links (any value).
Headers
Acceptstringapplication/json
Responses
OK
dataobject[]linksobjectmetaobject
Create a new OCP link
Create a payment link (OCP).
Strict and dynamic links
- Strict: one specific customer, paid once. Send
customerIdandinvoiceTypeId; that document type is issued when the link is paid. - Dynamic: one link, many payments. Leave
invoiceTypeIdout (and usuallycustomerId). Each payer fills in their own details and Billit issues the right document from the account's OCP settings: an invoice type for businesses, a receipt type for individuals, the product or the service variant depending onis_service(or the attached product's).
The response's linkType says which one a link is.
Before you create links
- Set up OCP once in the web app (Settings → OCP): the document types issued when a link is paid. Without them, creating a link returns 422 on
ocpSettings. paymentMethodIdmust be an active online payment method:GET /account→data.relations.paymentMethods[]withisOnlineMethod: true.- Alpha Bank payment methods need a customer (
customerId): 422 oncustomerIdotherwise. costis the amount the payer pays (with VAT), up to 5000;netValueis the amount before VAT, up to 10000.
The request body's Examples dropdown has a dynamic link and a strict link; the 422 tab shows an account without OCP settings.
Headers
Acceptstringapplication/json
Request Body
titlestring · requiredRequired. What is being paid, shown on the payment page.
descriptionstring · requiredRequired. Longer text shown on the payment page.
costnumber · min: 0 · max: 5000 · requiredRequired. The amount the payer pays, VAT included.
netValuenumber · min: 0 · max: 10000 · requiredRequired. The amount before VAT.
paymentMethodIdinteger · requiredRequired. An active online payment method:
GET /account→data.relations.paymentMethods[]withisOnlineMethod: true. Alpha Bank needscustomerId.langstring · enum · requiredRequired. Language of the payment page and the issued document.
Enum values:elen
vatIdintegerA VAT id from
GET /account→data.relations.vats(not a hidden one).customerIdinteger | nullThe customer of a strict link (a contact id). Leave out for a dynamic link.
invoiceTypeIdinteger | nullStrict link: the document type issued when paid. Leave out for a dynamic link: the type is chosen at payment from the OCP settings.
expirationAtstring | null · dateOptional last day the link can be paid,
Y-m-d.productIdinteger | nullOptional product id from
GET /products.is_serviceboolean | nullDynamic links: whether the link sells a service (true) or a product (false); decides between the service and the product document type at payment. Left out, the attached product's setting is used, else product.
lock_quantitybooleanThe payer cannot change the quantity.
imagestringOptional image shown on the payment page, as a base64 data URL (jpeg, png or webp, up to 5MB).
image_circlebooleanShow the image as a circle.
tagsstring[]Tag names; missing tags are created.
Responses
Created.
dataobject
Update OCP link
Update a payment link.
PUT replaces the link. Left out,
customerId,productId,vatIdandexpirationAtbecome empty, and leaving outinvoiceTypeIdturns a strict link into a dynamic one. Send them again to keep them.image_circle,lock_quantityandis_servicekeep their values when left out; the image stays unless you send a new one orremove_image: true.
Another account's link returns 404.
path Parameters
uuidstring · required
Headers
Acceptstringapplication/json
Request Body
titlestring · requiredRequired. What is being paid, shown on the payment page.
descriptionstring · requiredRequired. Longer text shown on the payment page.
costnumber · min: 0 · max: 5000 · requiredRequired. The amount the payer pays, VAT included.
netValuenumber · min: 0 · max: 10000 · requiredRequired. The amount before VAT.
paymentMethodIdinteger · requiredRequired. An active online payment method:
GET /account→data.relations.paymentMethods[]withisOnlineMethod: true. Alpha Bank needscustomerId.langstring · enum · requiredRequired. Language of the payment page and the issued document.
Enum values:elen
vatIdintegerA VAT id from
GET /account→data.relations.vats(not a hidden one).customerIdinteger | nullThe customer of a strict link (a contact id). Leave out for a dynamic link.
invoiceTypeIdinteger | nullStrict link: the document type issued when paid. Leave out for a dynamic link: the type is chosen at payment from the OCP settings.
expirationAtstring | null · dateOptional last day the link can be paid,
Y-m-d.productIdinteger | nullOptional product id from
GET /products.is_serviceboolean | nullDynamic links: whether the link sells a service (true) or a product (false); decides between the service and the product document type at payment. Left out, the attached product's setting is used, else product.
lock_quantitybooleanThe payer cannot change the quantity.
imagestringOptional image shown on the payment page, as a base64 data URL (jpeg, png or webp, up to 5MB).
image_circlebooleanShow the image as a circle.
tagsstring[]Tag names; missing tags are created.
remove_imagebooleanRemove the current image.
Responses
The updated link.
dataobject