Create Payment Link
POST /paymentlinks/create
This endpoint allows merchants to create new payment links for both payment collection and card tokenization. The request structure varies depending on the type of link being created.
Test URL
Send the request to the following URL:
https://checkout-api.staging.straumur.is/api/v1/paymentlinks/create
This call creates a new payment link with the specified configuration.
Live environment
On live, use the same path on https://greidslugatt.straumur.is. Headers, request and response are identical. See Live environment.
Minimum Request Example – Pay by Link
{
"type": "PayByLink",
"terminalIdentifier": "1adfe4a1b2c3",
"amount": 20000,
"currency": "ISK",
"items": [
{
"name": "Playstation 2 Analog RCA/SCART to HDMI Adapter Low Latency",
"quantity": 1,
"amountWithoutDiscount": 25000,
"amount": 20000,
"unitPrice": 20000
}
],
}
Minimum Request Example – Tokenize by Link
{
"type": "TokenizeByLink",
"terminalIdentifier": "1adfe4a1b2c3",
"recurringProcessingModel": "CardOnFile",
"amount": 0,
"currency": "ISK"
}
Request Required Fields
| Field | Type | Required | Description | Example | Min Length | Max Length |
|---|---|---|---|---|---|---|
| terminalIdentifier | String | Required | The terminal identifier that uniquely identifies the terminal used for this request. See Terminal Identifier for how to find it in the Merchant Portal and what to do if it's missing. | 1adfe4a1b2c3 | 12 | 12 |
| amount | Integer | Required | The amount to be charged in minor units. Must end in 00 for ISK. Must be 0 for TokenizeByLink type. | 48900 | - | - |
| currency | String | Required | The three-character ISO currency code. | ISK | 3 | 3 |
| type | String | Required | Type of payment link. | PayByLink | - | - |
| items | Array | Required | A detailed list of items the customer is purchasing. This information appears on the checkout page. Must be empty for TokenizeByLink. | - | - | 200 |
Item Array Fields
| Subfield | Type | Required | Description | Example | Min Length | Max Length |
|---|---|---|---|---|---|---|
| Array | Optional | List of cart items. Each item should have the following fields: | - | - | 200 | |
| name | String | Required | The name of the item. | item 1 | - | - |
| amount | Integer | Required | The amount of the item in minor units. | 42000 | - | - |
| unitPrice | Integer | Required | The amount of a single quantity of item in minor units. | 23500 | - | - |
| quantity | Integer | Required | The quantity of the items bought. | 2 | - | - |
| amountWithoutDiscount | Integer | Required | The amount of the item without discount in minor units. If provided, Amount cannot be higher than the amount without discount | 47000 | - | - |
Supported Type Values
| Value | Description |
|---|---|
| PayByLink | Creates a pay-by-link for collecting payments |
| TokenizeByLink | Creates a tokenize-by-link for saving payment methods |
Example Success Response
{
"paymentLinkReference": "30001aylo2a",
"url": "https://pay.example.com/link/30001aylo2a",
"responseDateTime": "2025-01-04T09:50:14.343503Z",
"responseIdentifier": "e3605f81-6b09-4ce1-83ad-5a8d49f3cd44"
}
Response Fields
| Field | Type | Description | Example |
|---|---|---|---|
| paymentLinkReference | String | Unique reference for the payment link | 30001aylo2a |
| url | String | The shareable payment link URL | https://pay.example.com/link/30001aylo2a |
| responseDateTime | String | The date and time when the response was generated. | 2025-01-04T09:50:14.343503Z |
| responseIdentifier | String | The unique identifier for the response. | e3605f81-6b09-4ce1-83ad-5a8d49f3cd44 |
Error Response
Error responses are standardized. For details, see Errors, including troubleshooting for Origin, Return URL, and Terminal Identifier errors.
You can also find a detailed overview of our HTTP Status Codes.