The Paylink API
Paylinks allow clients to charge a customer for products without storing them in SPiD's product database. A paylink contains products, their prices and other metadata. It comes with a URL that takes the user to SPiD checkout where they can pay for the products. Upon completion, the user is sent back to the client with a confirmation from SPiD. A paylink object represents a single purchase, and may only be used once.
Paylink items are what end-users actually pay for. Each item has a price (which is the total price, including VAT) and VAT, as well as other metadata. The total price payed is the sum of each paylink item.
Paylink items can optionally be coupled to a current product in SPiD, identified by the
productId field. Paylink items also contain a type, indicating the kind of item and how it is processed, tracked and visualized to the end-user.
By providing a
redirectUri during the payment flow, the client can control where the user is sent after successful payment. If one is not provided, the client-default redirect URI will be used.
Both the whole paylink object and each paylink item have client reference fields. These can be used by the client in order to track and process paylinks and orders generated by them.
Each paylink item will generate a corresponding order item. The
clientItemReference for each paylink item will be added to each order item as well as the
clientReference for the paylink header, which will be added to the order header. This enables clients to track each order item and each order using their own references.
When using paylinks, it is strongly recommended to also implement the callback functionality.
In the following diagrams, "SPiD API" is the REST API, and "SPiD Web" is SPiD in the browser - the UI your users will see when entering credit cards, logging in etc.
Paylink direct purchase flow
DIRECT to use this flow. It is the default flow (when
purchaseFlow is omitted).
Paylink authorize/capture flow
AUTHORIZE to use this flow.
Did you spot an error? Or maybe you just have a suggestion for how we can improve? Leave a comment, or better yet, send us a pull request on GitHub to fix it (in-browser editing, only takes a moment).