Ginger Payments
Payment links

Create a payment link

POST
/v1/paymentlinks/

Creates a link to the hosted payment page that you can send to your customer, for example by email or in an invoice. Every time your customer opens the link and tries to pay, Ginger Payments creates a new order, up to 25 attempts.

See Payment links.

Authorization

apiKey
headerAuthorizationBasic <token>

Use your project's API key as the username and leave the password empty. Only use the API key from your server: it gives full access to your project.

Request Body

application/json
  1. body
merchant_order_id*string

Your own order reference.

amount*Amount

Amount in the smallest currency unit, including VAT. 1234 is € 12.34. For currencies without minor units, send the whole amount.

Range0 <= value
currency*Currency

ISO 4217 currency code, such as EUR, GBP or USD. Get supported currencies lists the currencies of your project.

Match^[A-Z]{3}$
description?string

Description of the payment. Without it, the orders have no description.

payment_methods?array<>

Payment methods to show on the hosted payment page. Without it, every active payment method is shown.

expiration_period?Duration

How long the link stays valid, such as P20D for 20 days. The default is 30 days.

return_url?string

Where your customer goes after paying.

Formaturi
webhook_url?string

Where status changes of the orders created from the link are sent.

Formaturi

Response Body

The payment link has been created.

application/json
  1. response
id?string

Payment link ID.

Formatuuid
project_id?string
Formatuuid
merchant_id?string
Formatuuid
merchant_order_id*string

Your own order reference.

amount*Amount

Amount in the smallest currency unit, including VAT. 1234 is € 12.34. For currencies without minor units, send the whole amount.

Range0 <= value
currency*Currency

ISO 4217 currency code, such as EUR, GBP or USD. Get supported currencies lists the currencies of your project.

Match^[A-Z]{3}$
description?string

Description of the payment. Without it, the orders have no description.

payment_methods?array<>

Payment methods to show on the hosted payment page. Without it, every active payment method is shown.

expiration_period?Duration

How long the link stays valid, such as P20D for 20 days. The default is 30 days.

return_url?string

Where your customer goes after paying.

Formaturi
webhook_url?string

Where status changes of the orders created from the link are sent.

Formaturi
payment_url?string

The link to send to your customer.

Formaturi
status?string
  • new: your customer hasn't tried to pay yet.
  • processing: a payment is in progress.
  • all_unsuccessful: every attempt so far failed. Your customer can try again until the link expires.
  • completed: one of the attempts succeeded.
  • expired: the link expired without a successful payment.
Value in"new""processing""completed""expired""all_unsuccessful"
reason?string

Why the link has its current status.

completed_order_id?string

ID of the order that was paid.

Formatuuid
orders?

IDs of the orders created from the link, grouped by order status.

created?Timestamp

Date and time in ISO 8601 format.

Formatdate-time
modified?Timestamp

Date and time in ISO 8601 format.

Formatdate-time
completed?Timestamp

Date and time in ISO 8601 format.

Formatdate-time
curl -X POST 'https://api.dev.gingerpayments.com/v1/paymentlinks/' \  -H 'Content-Type: application/json' \  -d '{  "merchant_order_id": "EXAMPLE001",  "amount": 995,  "currency": "EUR",  "description": "Invoice EXAMPLE001",  "expiration_period": "P20D",  "payment_methods": [    "credit-card",    "apple-pay",    "google-pay"  ],  "return_url": "https://www.example.com/thank-you",  "webhook_url": "https://www.example.com/webhook"}'
{  "id": "a8c1b7b0-9c73-4bd8-94f4-37c3070e78c7",  "project_id": "05ad138f-52fa-40dc-9751-5fde949dcb57",  "merchant_id": "b251b220-5d8b-4b9d-9915-b89676dc0948",  "merchant_order_id": "EXAMPLE001",  "amount": 995,  "currency": "EUR",  "description": "Invoice EXAMPLE001",  "expiration_period": "P20D",  "payment_methods": [    "credit-card",    "apple-pay",    "google-pay"  ],  "payment_url": "https://api.dev.gingerpayments.com/paylink/a8c1b7b0-9c73-4bd8-94f4-37c3070e78c7/",  "created": "2026-10-12T15:39:12.773776+00:00",  "orders": {},  "status": "new",  "reason": "Payment Link was created, not yet visited"}