Create a payment link
Create or retrieve the payment link for an existing charge.
Creates or retrieves the link for a charge already registered in the company
and authenticated environment. In charge_id, provide the identifier of
the charge the customer should pay.
The charge must be open and within its due date to create or configure its link.
The link uses the customer, amount, due date and other charge data. While the charge allows this action, repeating the request reuses the existing link. You can configure return URLs and restrict the payment methods accepted in the checkout. Creating the link does not create another charge or request an email. A new link starts active. If the charge already has a paused link, this request keeps it paused; use PATCH to reactivate it.
See Payment links to understand the configuration fields and track payment through the linked charge.
Headers
Unique key chosen by your system to identify this request. When retrying, send the same key and parameters. Without this header, the request is processed normally. See the idempotency guide for retention and handling pending or uncertain responses.
1 to 255 characters
Body Params
Applying an example replaces the body fields.
Existing charge identifier. The link uses that charge's customer, amount and due date.
Up to 100 characters
HTTPS return URL after confirmed payment. Omitting it, sending null or empty text keeps the existing URL.
Up to 2048 characters
HTTPS URL for returning to your website. This return does not cancel the charge. Omitting it, sending null or empty text keeps the existing URL.
Up to 2048 characters
Methods allowed in the link. Omitting it keeps the configuration; null removes the custom configuration. A list limits checkout methods and does not expand those allowed by the charge.
1 to 2 items
Responses
Response Body
Link and current settings.
Public payment link identifier.
Linked charge identifier. Look up the charge for its financial data.
Checkout URL for this charge. Repeating creation reuses the same link.
Return URL after payment confirmation, or null when not configured.
Return URL to your website, or null when not configured. Returning to the website does not cancel the charge.
Link's custom payment method configuration, or null for inheritance. The charge and platform availability still limit accepted methods.
Link creation date in Unix UTC seconds.
Date of the last change to the link or its settings, in Unix UTC seconds.
Indicates whether the link is active. False means checkout was paused. An active link remains subject to the charge's conditions.
Response Body
Link created for the charge.
Public payment link identifier.
Linked charge identifier. Look up the charge for its financial data.
Checkout URL for this charge. Repeating creation reuses the same link.
Return URL after payment confirmation, or null when not configured.
Return URL to your website, or null when not configured. Returning to the website does not cancel the charge.
Link's custom payment method configuration, or null for inheritance. The charge and platform availability still limit accepted methods.
Link creation date in Unix UTC seconds.
Date of the last change to the link or its settings, in Unix UTC seconds.
Indicates whether the link is active. False means checkout was paused. An active link remains subject to the charge's conditions.
Response Body
A request field is invalid. Check error.details for the public field name, code and indicated correction.
Code and explanation of the error returned by the API.
Stable error code.
Error explanation in English. For validation errors, it summarizes the category; details identify the corrections. Use the codes to handle the response.
Invalid fields or references submitted in the body, with the field, code and explanation. Omitted for general errors and when there is no field correction to indicate.
Public name of the JSON field, query parameter, path parameter or header related to the error. Nested fields and lists retain their path and index. $ represents the root of the JSON body.
Reason for the field error, such as REQUIRED, INVALID_TAXID, UNKNOWN_FIELD, DUPLICATE_FIELD or INVALID_TYPE.
Explanation in English of the problem with this field or parameter and the available correction. Do not use the text to determine your integration flow.
Response Body
Charge not found in the authenticated company and environment.
Code and explanation of the error returned by the API.
Stable error code.
Error explanation in English. For validation errors, it summarizes the category; details identify the corrections. Use the codes to handle the response.
Invalid fields or references submitted in the body, with the field, code and explanation. Omitted for general errors and when there is no field correction to indicate.
Public name of the JSON field, query parameter, path parameter or header related to the error. Nested fields and lists retain their path and index. $ represents the root of the JSON body.
Reason for the field error, such as REQUIRED, INVALID_TAXID, UNKNOWN_FIELD, DUPLICATE_FIELD or INVALID_TYPE.
Explanation in English of the problem with this field or parameter and the available correction. Do not use the text to determine your integration flow.
Response Body
The message identifies whether the action is prevented by the charge's state, due date or another request in progress. When the state prevents the action, it shows the current and accepted states. Look up the linked charge before trying again.
Code and explanation of the error returned by the API.
Stable error code.
Error explanation in English. For validation errors, it summarizes the category; details identify the corrections. Use the codes to handle the response.
Invalid fields or references submitted in the body, with the field, code and explanation. Omitted for general errors and when there is no field correction to indicate.
Public name of the JSON field, query parameter, path parameter or header related to the error. Nested fields and lists retain their path and index. $ represents the root of the JSON body.
Reason for the field error, such as REQUIRED, INVALID_TAXID, UNKNOWN_FIELD, DUPLICATE_FIELD or INVALID_TYPE.
Explanation in English of the problem with this field or parameter and the available correction. Do not use the text to determine your integration flow.
For common errors, see HTTP response codes.