π§API Reference
This guide describes all the endpoints, parameters, and responses of the PAY API.
Base URL: https://api-pay.venly.io
1) Create Checkout for a Single Payment
Initiate the checkout process for a single payment by calling the following endpoint:
POST /checkout/sessions
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
line_items.price_data.product_data. | string | β | The name of the product to be displayed to your end-user. Such as βRing NFTβ |
line_items.price_data. | integer | β | Non-negative integer in cents representing the price of your product. |
line_items.price_data. | string | β | Three-letter ISO currency code, in uppercase. |
line_items. | integer | β | The quantity of products you want to create a checkout for. |
| string | β | The URL where your user will be directed in case of successful checkout. (URLs must begin with |
| string | β | The URL where your user will be directed in case they decide to cancel the payment. (URLs must begin with |
| string | β | Only β |
customer. | string | β | The unique ID of your customer for whom this checkout request is being created. |
Request Body
In this example, we are creating a checkout link for one Ring NFT with a value of β¬20. We have also specified the success and cancel URLs.
Response Body
Save the following parameters from response body:
id
: This parameter is the sessionId (Used when checking status of this checkout)url
: This parameter is the checkout URL (You pass this to your end-user)
2) Check Status of a Checkout
To retrieve the details of a completed or canceled checkout, call this endpoint using the corresponding session ID:
GET /checkout/sessions/{sessionId}
Path Parameter
{sessionId} : This is the session ID to check the status of a specific checkout payment. Itβs in the response body when you create a checkout link.
Response Body
Look for the following parameters in the response body:
Parameter | Possible Values & Description |
---|---|
|
|
|
|
| The |
| The total sum of all items, factoring in applied discounts and taxes. |
| The |
3) Fetch Stripe Dashboard
This endpoint allows you to fetch a login link for your Stripe dashboard:
GET /stripe-dashboard
Response
The API will provide the login URL as a response. Copy and paste this link into a web browser to gain access to your Stripe dashboard. Here you can get an overview of all the transactions.
4) Customize Branding for Checkout Page
You can customize the checkout page by incorporating your business logo and chosen color scheme.
4.1) Upload icon
Personalize your checkout page by adding your business' icon or logo. To begin, upload your chosen icon.
The icon must be a square image and have a minimum size of 128px x 128px.
Endpoint:
POST /account/settings/branding/icon
Request Body
Parameter | Type | Description | Request Type |
---|---|---|---|
| File | A square icon image with a minimum size of 128px x 128px. | multipart/form-data |
Response Body
Save the first id
field. This is the icon ID, and will be used when customizing the checkout page.
4.2) Customize the checkout page
You can select a primary color for the left side of the checkout page, and a secondary color for the PAY button. The checkout page will also feature your icon.
Endpoint:
POST /account/settings/branding
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
settings.branding. | string | β | A color hex code to customize your checkout page. |
settings.branding. | string | β | A color hex code to customize the PAY button. |
settings.branding. | string | β | This is the |
Example Request
In this example, we will customize the checkout URL with following properties:
Primary Color: Bright Purple (#BF40BF)
Secondary Color: Black (#000000)
Icon: Icon ID from the response of the upload icon endpoint.
POST /account/settings/branding
Customized Checkout URL Preview
The logo is evident on the top. The primary color is applied on the left side, while the secondary color is applied on the Pay button.
5) Configuring Webhooks/Notifications
You can register your endpoint which allows you to get notifications whenever your end-user makes a successful payment or declines/cancels payment. You can subscribe to a webhook to receive updates of your user's payments.
POST /webhooks
Request Body Parameters
Parameter | Type | Required | Description & Possible Values |
---|---|---|---|
| string | β | This is your endpoint URL which can accept |
| string | β | This can only have the value |
authenticationMethod. | string | β | We allow two types:
|
authenticationMethod. | string | (Required only when | This is the username for your endpoint. |
authenticationMethod. | string | (Required only when | This is the password for your endpoint. |
authenticationMethod. | string | (Used only when | This is the name of your api key. |
authenticationMethod. | string | (Used only when | This is the value of api key for your endpoint. |
Example Request with authentication method: BASIC_AUTHENTICATION
BASIC_AUTHENTICATION
POST /webhooks
Example Request with authentication method: API_KEY
API_KEY
POST /webhooks
Last updated