Retrieve a payment link
How to fetch a specific payment link via API
To fetch a single payment link, send a GET request to the /api/2026-05/payment_links/:id endpoint, where id is the ID of the resource that you want to retrieve.
Request
GET https://yourdomain.commercelayer.io/api/2026-05/payment_links/:id
Example
The following request fetches the payment link identified by the ID "XAyRWNUzyN":
curl -g -X GET \
'https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token'On success, the API responds with a 200 OK status code, returning a single resource object:
{
"data": {
"id": "XAyRWNUzyN",
"type": "payment_links",
"links": {
"self": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN"
},
"attributes": {
"status": "succeeded",
"amount_cents": 1000,
"amount_float": 10.0,
"formatted_amount": "€10,00",
"currency_code": "EUR",
"name": "Invoice #1234 balance due",
"token": "xxxx-yyyy-zzzz",
"url": "https://checkout.yourbrand.com/:order_id",
"return_url": "http://commercelayer.dev/payment_link/process",
"options": {
"usage": "on_session"
},
"request_data": {},
"response_data": {},
"completed_at": "2018-01-01T12:00:00.000Z",
"expired_at": "2018-01-01T12:00:00.000Z",
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANY-EXTERNAL-REFEFERNCE",
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
"metadata": {
"foo": "bar"
}
},
"relationships": {
"order": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/relationships/order",
"related": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/order"
}
},
"billing_address": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/relationships/billing_address",
"related": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/billing_address"
}
},
"payment_setting": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/relationships/payment_setting",
"related": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/payment_setting"
}
},
"payment_session": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/relationships/payment_session",
"related": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/payment_session"
}
},
"attachments": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/relationships/attachments",
"related": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/attachments"
}
},
"events": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/relationships/events",
"related": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/events"
}
},
"event_stores": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/relationships/event_stores",
"related": "https://yourdomain.commercelayer.io/api/2026-05/payment_links/XAyRWNUzyN/event_stores"
}
}
},
"meta": {
"created_with_version": "2026-05"
}
},
"meta": {
"trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74",
"api_versions": [
"2026-05"
]
}
}Last updated