Skip to main content
POST
/
api
/
v1
/
payment-links
Create payment link
curl --request POST \
  --url https://payments.coinbase.com/api/v1/payment-links \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "maxAmount": "<string>",
  "networkId": 123,
  "operator": "<string>",
  "receiver": "<string>",
  "authorizationExpiry": "<string>",
  "contractAddress": "<string>",
  "customer": {
    "locale": "<string>",
    "metadata": {}
  },
  "failRedirectUrl": "<string>",
  "feeReceiver": "<string>",
  "fiat": {
    "amount": "<string>",
    "currency": "<string>",
    "metadata": {}
  },
  "hostUrl": "<string>",
  "maxFeeBps": 123,
  "merchant": {
    "name": "<string>",
    "logoUrl": "<string>",
    "locale": "<string>",
    "metadata": {}
  },
  "minFeeBps": 123,
  "preApprovalExpiry": "<string>",
  "provider": "COINBASE_COMMERCE",
  "refundExpiry": "<string>",
  "status": "ACTIVATED",
  "successCallbackUrl": "<string>",
  "successRedirectUrl": "<string>",
  "token": "<string>"
}
'
{
  "entity": "<string>",
  "id": "<string>",
  "url": "<string>",
  "status": "ACTIVATED",
  "maxAmount": "<string>",
  "token": "<string>",
  "networkId": 123,
  "operator": "<string>",
  "receiver": "<string>",
  "minFeeBps": 123,
  "maxFeeBps": 123,
  "feeReceiver": "<string>",
  "maxUsage": 123,
  "usageCount": 123,
  "successRedirectUrl": "<string>",
  "failRedirectUrl": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "contractAddress": "<string>",
  "salt": "<string>",
  "nonce": "<string>",
  "merchant": {
    "name": "<string>",
    "logoUrl": "<string>",
    "locale": "<string>",
    "metadata": {}
  },
  "customer": {
    "locale": "<string>",
    "metadata": {}
  },
  "fiat": {
    "amount": "<string>",
    "currency": "<string>",
    "metadata": {}
  },
  "hostUrl": "<string>",
  "preApprovalExpiry": "<string>",
  "authorizationExpiry": "<string>",
  "refundExpiry": "<string>"
}

Authorizations

Authorization
string
header
required

Authorization header using the Bearer scheme. Learn more about JWT tokens in the Coinbase Developer Portal.

Body

application/json

Request payload for creating a payment link.

maxAmount
string
required

The max amount to be signed by the buyer.

networkId
integer<int32>
required

Identifier for the blockchain network. (Default: 8453)

operator
string
required

Operator handling the payment.

receiver
string
required

The receiver's address.

authorizationExpiry
string<int64>

Timestamp (in seconds) when the authorization expires. Must be at least 1 minute from now. (Default: now() + 7 days)

contractAddress
string

Contract address of the Commerce protocol (PaymentEscrow.sol). (Default: 0xBdEA0D1bcC5966192B070Fdf62aB4EF5b4420cff)

customer
Customer · object

Customer information.

failRedirectUrl
string

URL to redirect on failed payment.

feeReceiver
string

Address that receives the fee. (Default: 0x0000000000000000000000000000000000000000)

fiat
fiat · object

Fiat details.

hostUrl
string

Host URL for the payment link.

maxFeeBps
integer<int32>

Max Fee in basis points. (Default: 0)

merchant
Merchant · object

Merchant information.

minFeeBps
integer<int32>

Min Fee in basis points. (Default: 0)

preApprovalExpiry
string<int64>

Timestamp (in seconds) when the pre-approval expires. Must be at least 1 minute from now. (Default: now() + 1 day)

provider
enum<string>

Payment provider, defaults to COINBASE_COMMERCE. (Default: COINBASE_COMMERCE)

Available options:
COINBASE_COMMERCE,
BASE_PAY
refundExpiry
string<int64>

Timestamp (in seconds) when the refund expires. Must be at least 1 minute from now. (Default: now() + 7 days)

status
enum<string>

Current status of the payment link. (Default: ACTIVATED)

Available options:
ACTIVATED,
DEACTIVATED,
PENDING
successCallbackUrl
string

Callback URL on successful payment preapproval.

successRedirectUrl
string

URL to redirect on successful payment.

token
string

The token address used for the payment. (Default: 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913)

Response

A successful response.

Representation of a payment link including its URL, status, and related merchant, customer, and fiat information.

entity
string
required

Entity type, usually 'paymentLink'.

id
string
required

Unique identifier of the payment link.

url
string
required

URL of the payment link.

status
enum<string>
required

Current status of the payment link.

Available options:
ACTIVATED,
DEACTIVATED,
PENDING
maxAmount
string
required

The max amount to be signed by the buyer.

token
string
required

The token address used for the payment.

networkId
integer<int32>
required

Blockchain network identifier.

operator
string
required

Operator handling the payment link.

receiver
string
required

The receiver's address.

minFeeBps
integer<int32>
required

Min Fee in basis points.

maxFeeBps
integer<int32>
required

Max Fee in basis points.

feeReceiver
string
required

Address that receives the fee.

maxUsage
integer<int32>
required

Maximum number of uses.

usageCount
integer<int32>
required

Current usage count.

successRedirectUrl
string
required

URL to redirect after successful payment.

failRedirectUrl
string
required

URL to redirect after failed payment.

createdAt
string<date-time>
required

Timestamp when the payment link was created.

updatedAt
string<date-time>
required

Timestamp when the payment link was last updated.

contractAddress
string
required

Smart contract address of the Commerce PaymentEscrow protocolof the Commerce PaymentEscrow protocol.

salt
string
required

Source of entropy to ensure unique hashes across different payments.

nonce
string
required

Unique nonce for the payment link preapproval authorization.

merchant
Merchant · object
required

Merchant information.

customer
Customer · object
required

Customer information.

fiat
Fiat · object
required

Fiat details.

hostUrl
string
required

Host URL for the payment link.

preApprovalExpiry
string<int64>

Timestamp (in seconds) when the pre-approval expires.

authorizationExpiry
string<int64>

Timestamp (in seconds) when the authorization expires.

refundExpiry
string<int64>

Timestamp (in seconds) when the refund expires.