POST
/
payment-links

This endpoint requires the payment-links.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for creating a new payment link.

amount
number
required

The amount to request payment for.

Required range: 1 < x < 99999999
country
string
required

The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction.

currency
string
required

The ISO-4217 currency code for the payment.

buyer
object

Guest buyer details provided inline. No buyer resource will be created on Gr4vy when used.

cart_items
object[]

An array of cart items that represents the line items of a payment link.

connection_options
object

Allows for passing optional configuration per connection to take advantage of connection specific features. When provided, the data is only passed to the target connection type to prevent sharing configuration across connections.

Please note that each of the keys this object are in kebab-case, for example cybersource-anti-fraud as they represent the ID of the connector. All the other keys will be snake case, for example merchant_defined_data or camel case to match an external API that the connector uses.

expires_at
string | null

The date and time when this payment link expires. Defaults to 24 hours from creation.

external_identifier
string | null

A value that can be used to match the payment link against your own records. This will also be applied to any transaction.

Required string length: 1 - 200
intent
enum<string> | null
default:
authorize

The intent of the payment link.

Available options:
authorize,
capture
merchant_banner_url
string | null

The URL of the merchant banner to display on the payment link.

merchant_color
string | null

The color code of the merchant to display on the payment link.

merchant_message
string | null

The message to display on the payment link.

Maximum length: 255
merchant_name
string | null

The name of the merchant to display on the payment link.

Maximum length: 100
merchant_terms_and_conditions_url
string | null

The URL of the merchant terms and conditions to display on the payment link.

merchant_url
string | null

The URL of the merchant to display on the payment link.

metadata
object | null

Any additional information about the payment link that you would like to store as key-value pairs. This data is passed to payment service providers that support it.

payment_source
enum<string> | null

The source of the payment link.

Available options:
ecommerce,
moto,
recurring,
installment,
card_on_file
return_url
string | null

The URL to redirect the buyer to after payment.

statement_descriptor
object

The statement descriptor is the text to be shown on the buyer's statements.

The specific usage of these fields will depend on the capabilities of the underlying PSP and bank. As a typical example, 'name' and 'description' could be concatenated using '* ' as a separator, and then the resulting descriptor would be truncated to 22 characters by the issuing bank.

Response

201 - application/json
amount
integer

The monetary amount for this payment link, in the smallest currency unit for the given currency, for example 1299 cents to create an authorization for $12.99.

buyer
object

The buyer used for this transaction.

cart_items
object[]

An array of cart items that represents the line items of a payment link.

country
string | null

The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction.

created_at
string

The date and time when this payment link was created.

currency
string

A supported ISO-4217 currency code.

expires_at
string

The date and time when this payment link expires.

external_identifier
string | null

A value that can be used to match the payment link against your own records.

Required string length: 1 - 200
id
string

The ID of a payment link.

intent
enum<string> | null

The intent of the payment link.

Available options:
authorize,
capture
merchant_banner_url
string | null

The URL of the merchant banner to display on the payment link.

merchant_color
string | null

The color code of the merchant to display on the payment link.

merchant_message
string | null

The message to display on the payment link.

Maximum length: 255
merchant_name
string | null

The name of the merchant to display on the payment link.

Maximum length: 100
merchant_terms_and_conditions_url
string | null

The URL of the merchant terms and conditions to display on the payment link.

merchant_url
string | null

The URL of the merchant to display on the payment link.

metadata
object | null

Any additional information about the payment link that you would like to store as key-value pairs. This data is passed to payment service providers that support it.

payment_source
enum<string> | null

The source of the payment link. Defaults to ecommerce.

Available options:
ecommerce,
moto,
recurring,
installment,
card_on_file
return_url
string | null

The URL to redirect the buyer to after payment.

shipping_details
object

Shipping details for the payment link.

statement_descriptor
object

The statement descriptor is the text to be shown on the buyer's statements.

The specific usage of these fields will depend on the capabilities of the underlying PSP and bank. As a typical example, 'name' and 'description' could be concatenated using '* ' as a separator, and then the resulting descriptor would be truncated to 22 characters by the issuing bank.

status
enum<string>
Available options:
active,
expired
type
enum<string>

The type of this resource. Is always payment_link.

Available options:
payment_link
updated_at
string

The date and time when this payment link was created.