Create a link
How to create a link via API
To create a new link, send a POST
request to the /api/links
endpoint, passing the resource arguments in the request body.
Request
POST https://yourdomain.commercelayer.io/api/links
Arguments
Body Parameter | Type | Required |
---|---|---|
type |
| Required |
attributes.name |
| Required |
attributes.client_id |
| Required |
attributes.scope |
| Required |
attributes.starts_at |
| Required |
attributes.expires_at |
| Required |
attributes.domain |
| Optional, default to "commercelayer.link" |
attributes.item_type |
| Optional |
attributes.params |
| Optional |
attributes._disable |
| Optional |
attributes._enable |
| Optional |
attributes.reference |
| Optional |
attributes.reference_origin |
| Optional |
attributes.metadata |
| Optional |
relationships.item |
| Required |
Example
The following request creates a new link:
Last updated