# Creating a payment link **POST /{merchantId}/payment** The request allows you to create a link to the imoje payment gateway with all available payment methods or only those selected using the `visibleMethod` array. >Each unpaid link will expire automatically 15 months after its creation date. If you want it to expire sooner, use the `validTo` parameter. ## Servers - Production environment: https://api.imoje.pl/v1/merchant (Production environment) - Test environment: https://sandbox.api.imoje.pl/v1/merchant (Test environment) ## Authentication methods - Authorization token ## Parameters ### Path parameters - **merchantId** (string) Merchant identifier ### Body: application/json (object) - **serviceId** (string(uuid)) Shop identifier as `UUID v4` - **amount** (integer) The transaction amount in the smallest currency unit, e.g. **pennies**. - **currency** (string) Transaction currency in the ISO 4217 standard - **orderId** (string) Order ID - **customer** (object) Payer data - **title** (string) Transaction title - **additionalDescription** (string) Details of the products or services ordered - **visibleMethod** (array[string]) Payment methods visible on the payment gateway. If this field is missing or empty, all payment methods enabled in the customer's shop are displayed. There are many configurations for displaying payment methods. They should always be separated by commas. - **preselectMethodCode** (string) The payment channel set as default and automatically selected when the payment gateway is opened. If this field is not present, the gateway opens without a selected payment channel. The field cannot be defined and left without a value. - **returnUrl** (string(uri)) Return address from the external payment processing site in the event of an undetermined transaction status. The address must comply with the `RFC 3986`` URL standard. - **successReturnUrl** (string(uri)) Return address from the external payment processing site in case of successful payment. The address must comply with the `RFC 3986`` URL standard. - **failureReturnUrl** (string(uri)) Return address from the external payment processing site in the event of a payment error. The address must comply with the `RFC 3986`` URL standard. - **notificationUrl** (string(uri)) Dynamic notification address, possibility to set a specific address for a single transaction. Addresses containing `localhost` and ports will be rejected. - **validTo** (integer | null) Transaction expiry date as a **timestamp in seconds**. Failure to complete the payment by this time will result in its cancellation. If not specified, the transaction is valid until the time set in the *Payment activity* parameter in the imoje Administration Panel (shop settings) or after 15 months. Passing the parameter `validTo`= `NULL` causes the transaction not to expire, ignoring the settings in the *Payment activity* parameter in the imoje Administration Panel (shop settings). The **minimum** link validity time is **60 seconds.** - **billing** (object) Payer's billing address - **shipping** (object) Shipping address - **cart** (object) Information about ordered products. Required for active service [ING Lease Now](https://bump.sh/pgw/doc/imoje-api-en#topic-ing-lease-now). - **multipayout** (array[object]) Information about the account numbers to which the funds from the transaction are to be paid.
The active [multipayout](https://bump.sh/pgw/doc/imoje-api-en#topic-multipayout) function is required. - **invoice** (object) Invoice details required for the active service [ING Księgowość](https://bump.sh/pgw/doc/imoje-api-en#topic-ing-ksiegowosc) and for `Split payment`. - **isKsef** (boolean) Generate KSeF payment identifier (IPKSeF) ## Responses ### 200 Request executed correctly #### Body: application/json (object) - **payment** (object) ### 422 The payload is correct but does not contain the required parameters. #### Body: application/json (object) - **apiErrorResponse** (object) Error details [Powered by Bump.sh](https://bump.sh)