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._disable |
| Optional |
attributes._enable |
| Optional |
attributes.client_id |
| Required |
attributes.domain |
| Optional, default to "commercelayer.link" |
attributes.expires_at |
| Required |
attributes.item_type |
| Optional |
attributes.metadata |
| Optional |
attributes.name |
| Required |
attributes.reference |
| Optional |
attributes.reference_origin |
| Optional |
attributes.scope |
| Required |
attributes.starts_at |
| Required |
relationships.item |
| Required |
Example
The following request creates a new link:
Last updated