Create payment link | Moov Documentation

Create payment link

Create a payment link that allows an end user to make a payment on Moov's hosted payment link page.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/transfers.write scope.

Endpoint

POST

/accounts/{accountID}/payment-links

Example Request

curl -X POST "https://api.moov.io/accounts/{accountID}/payment-links" \
  -H "Authorization: Bearer {token}" \
  -H "X-Moov-Version: v2026.07.00" \
  -d '{\n    "partnerAccountID": "d290f1ee-6c54-4b01-90e6-d701748f0851",\n    "merchantPaymentMethodID": "4c4e7f8e-81f4-4f3d-8f6f-6f6e7f8e4c4e",\n    "amount": {\n      "currency": "USD",\n      "value": 10000\n    },\n    "display": {\n      "title": "Example Payment Link",\n      "description": "This is an example payment link.",\n      "callToAction": "pay"\n    },\n    "customer": {\n      "requirePhone": true,\n      "tippingEnabled": true\n    },\n    "payment": {\n      "allowedMethods": [\n        "card-payment",\n        "ach-debit-collect"\n      ]\n    }\n  }'

TypeScript Example

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.paymentLinks.create({
    accountID: "cc1d04a8-03b1-4600-b675-e6180d574074",
    createPaymentLink: {
      partnerAccountID: "d290f1ee-6c54-4b01-90e6-d701748f0851",
      merchantPaymentMethodID: "4c4e7f8e-81f4-4f3d-8f6f-6f6e7f8e4c4e",
      display: {
        title: "Support our cause",
        description: "Choose an amount to contribute.",
        callToAction: "donate",
      },
      customer: {
        requirePhone: true,
      },
      customAmountPayment: {
        allowedMethods: [\
          "card-payment",\
          "ach-debit-collect",\
        ],
        amountRange: {
          minimum: {
            currency: "USD",
            valueDecimal: "0.00",
          },
          maximum: {
            currency: "USD",
            valueDecimal: "1000.00",
          },
        },
        suggestedAmounts: [\
          {\
            currency: "USD",\
            valueDecimal: "50.00",\
          },\
          {\
            currency: "USD",\
            valueDecimal: "100.00",\
          },\
          {\
            currency: "USD",\
            valueDecimal: "500.00",\
          },\
          {\
            currency: "USD",\
            valueDecimal: "1000.00",\
          },\
        ],
      },
    },
  });

console.log(result);
}

run();

PHP Example

declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;

$sdk = MoovPhp\Moov::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$createPaymentLink = new Components\CreatePaymentLink(
    partnerAccountID: 'd290f1ee-6c54-4b01-90e6-d701748f0851',
    merchantPaymentMethodID: '4c4e7f8e-81f4-4f3d-8f6f-6f6e7f8e4c4e',
    display: new Components\PaymentLinkDisplayOptions(
        title: 'Support our cause',
        description: 'Choose an amount to contribute.',
        callToAction: Components\CallToAction::Donate,
    ),
    customer: new Components\PaymentLinkCustomerOptions(
        requirePhone: true,
    ),
    customAmountPayment: new Components\PaymentLinkCustomAmountPaymentDetails(
        allowedMethods: [\
            Components\CollectionPaymentMethodType::CardPayment,\
            Components\CollectionPaymentMethodType::AchDebitCollect,\
        ],
        amountRange: new Components\AmountDecimalRange(
            minimum: new Components\AmountDecimal(
                currency: 'USD',
                valueDecimal: '0.00',
            ),
            maximum: new Components\AmountDecimal(
                currency: 'USD',
                valueDecimal: '1000.00',
            ),
        ),
        suggestedAmounts: [\
            new Components\AmountDecimal(\
                currency: 'USD',\
                valueDecimal: '50.00',\
            ),\
            new Components\AmountDecimal(\
                currency: 'USD',\
                valueDecimal: '100.00',\
            ),\
            new Components\AmountDecimal(\
                currency: 'USD',\
                valueDecimal: '500.00',\
            ),\
            new Components\AmountDecimal(\
                currency: 'USD',\
                valueDecimal: '1000.00',\
            ),\
        ],
    ),
);

$response = $sdk->paymentLinks->create(
    accountID: 'cc1d04a8-03b1-4600-b675-e6180d574074',
    createPaymentLink: $createPaymentLink
);

if ($response->paymentLink !== null) {
    // handle response
}

Java Example

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.*;
import io.moov.sdk.models.errors.CreatePaymentLinkError;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.operations.CreatePaymentLinkResponse;
import java.lang.Exception;
import java.util.List;

public class Application {

public static void main(String[] args) throws GenericError, CreatePaymentLinkError, Exception {

Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

CreatePaymentLinkResponse res = sdk.paymentLinks().create()
                .accountID("cc1d04a8-03b1-4600-b675-e6180d574074")
                .createPaymentLink(CreatePaymentLink.builder()
                    .partnerAccountID("d290f1ee-6c54-4b01-90e6-d701748f0851")
                    .merchantPaymentMethodID("4c4e7f8e-81f4-4f3d-8f6f-6f6e7f8e4c4e")
                    .display(PaymentLinkDisplayOptions.builder()
                        .title("Support our cause")
                        .description("Choose an amount to contribute.")
                        .callToAction(CallToAction.DONATE)
                        .build())
                    .customer(PaymentLinkCustomerOptions.builder()
                        .requirePhone(true)
                        .build())
                    .customAmountPayment(PaymentLinkCustomAmountPaymentDetails.builder()
                        .allowedMethods(List.of(
                            CollectionPaymentMethodType.CARD_PAYMENT,
                            CollectionPaymentMethodType.ACH_DEBIT_COLLECT))
                        .amountRange(AmountDecimalRange.builder()
                            .minimum(AmountDecimal.builder()
                                .currency("USD")
                                .valueDecimal("0.00")
                                .build())
                            .maximum(AmountDecimal.builder()
                                .currency("USD")
                                .valueDecimal("1000.00")
                                .build())
                            .build())
                        .suggestedAmounts(List.of(
                            AmountDecimal.builder()
                                .currency("USD")
                                .valueDecimal("50.00")
                                .build(),
                            AmountDecimal.builder()
                                .currency("USD")
                                .valueDecimal("100.00")
                                .build(),
                            AmountDecimal.builder()
                                .currency("USD")
                                .valueDecimal("500.00")
                                .build(),
                            AmountDecimal.builder()
                                .currency("USD")
                                .valueDecimal("1000.00")
                                .build()))
                        .build())
                    .build())
                .call();

if (res.paymentLink().isPresent()) {
            System.out.println(res.paymentLink().get());
        }
    }
}

Python Example

from moovio_sdk import Moov
from moovio_sdk.models import components

with Moov(
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

res = moov.payment_links.create(account_id="cc1d04a8-03b1-4600-b675-e6180d574074", partner_account_id="d290f1ee-6c54-4b01-90e6-d701748f0851", merchant_payment_method_id="4c4e7f8e-81f4-4f3d-8f6f-6f6e7f8e4c4e", display={
        "title": "Support our cause",
        "description": "Choose an amount to contribute.",
        "call_to_action": components.CallToAction.DONATE,
    }, amount={
        "currency": "USD",
        "value": 1204,
    }, customer={
        "require_phone": True,
    }, payment={
        "allowed_methods": [\
            components.CollectionPaymentMethodType.GOOGLE_PAY,\
        ],
        "card_details": {
            "dynamic_descriptor": "WhlBdy *Yoga 11-12",
        },
        "ach_details": {
            "company_entry_description": "Gym dues",
            "originating_company_name": "Whole Body Fit",
        },
    }, payout={
        "allowed_methods": [],
        "recipient": {
            "email": "jordan.lee@classbooker.dev",
            "phone": {
                "number": "8185551212",
                "country_code": "1",
            },
        },
    }, custom_amount_payment=components.PaymentLinkCustomAmountPaymentDetails(
        allowed_methods=[\
            components.CollectionPaymentMethodType.CARD_PAYMENT,\
            components.CollectionPaymentMethodType.ACH_DEBIT_COLLECT,\
        ],
        amount_range=components.AmountDecimalRange(
            minimum=components.AmountDecimal(
                currency="USD",
                value_decimal="0.00",
            ),
            maximum=components.AmountDecimal(
                currency="USD",
                value_decimal="1000.00",
            ),
        ),
        suggested_amounts=[\
            components.AmountDecimal(\
                currency="USD",\
                value_decimal="50.00",\
            ),\
            components.AmountDecimal(\
                currency="USD",\
                value_decimal="100.00",\
            ),\
            components.AmountDecimal(\
                currency="USD",\
                value_decimal="500.00",\
            ),\
            components.AmountDecimal(\
                currency="USD",\
                value_decimal="1000.00",\
            ),\
        ],
    ), line_items={
        "items": [\
            {\
                "name": "<value>",\
                "base_price": {\
                    "currency": "USD",\
                    "value_decimal": "12.987654321",\
                },\
                "quantity": 61283,\
                "options": [\
                    {\
                        "name": "<value>",\
                        "quantity": 306874,\
                        "price_modifier": {\
                            "currency": "USD",\
                            "value_decimal": "12.987654321",\
                        },\
                    },\
                ],\
            },\
        ],
    }, amount_details=components.CreatePaymentLinkAmountDetails(
        tax=components.AmountDecimal(
            currency="USD",
            value_decimal="12.987654321",
        ),
        surcharge=components.AmountDecimal(
            currency="USD",
            value_decimal="12.987654321",
        ),
    ))

# Handle response
    print(res)

Ruby Example

require 'moov_ruby'

Models = ::Moov::Models
s = ::Moov::Client.new(
  security: Models::Components::Security.new(
    username: '',
    password: ''
  )
)
res = s.payment_links.create(account_id: 'cc1d04a8-03b1-4600-b675-e6180d574074', create_payment_link: Models::Components::CreatePaymentLink.new(
  partner_account_id: 'd290f1ee-6c54-4b01-90e6-d701748f0851',
  merchant_payment_method_id: '4c4e7f8e-81f4-4f3d-8f6f-6f6e7f8e4c4e',
  display: Models::Components::PaymentLinkDisplayOptions.new(
    title: 'Support our cause',
    description: 'Choose an amount to contribute.',
    call_to_action: Models::Components::CallToAction::DONATE
  ),
  customer: Models::Components::PaymentLinkCustomerOptions.new(
    require_phone: true
  ),
  custom_amount_payment: Models::Components::PaymentLinkCustomAmountPaymentDetails.new(
    allowed_methods: [\
      Models::Components::CollectionPaymentMethodType::CARD_PAYMENT,\
      Models::Components::CollectionPaymentMethodType::ACH_DEBIT_COLLECT,\
    ],
    amount_range: Models::Components::AmountDecimalRange.new(
      minimum: Models::Components::AmountDecimal.new(
        currency: 'USD',
        value_decimal: '0.00'
      ),
      maximum: Models::Components::AmountDecimal.new(
        currency: 'USD',
        value_decimal: '1000.00'
      )
    ),
    suggested_amounts: [\
      Models::Components::AmountDecimal.new(\
        currency: 'USD',\
        value_decimal: '50.00'\
      ),\
      Models::Components::AmountDecimal.new(\
        currency: 'USD',\
        value_decimal: '100.00'\
      ),\
      Models::Components::AmountDecimal.new(\
        currency: 'USD',\
        value_decimal: '500.00'\
      ),\
      Models::Components::AmountDecimal.new(\
        currency: 'USD',\
        value_decimal: '1000.00'\
      ),\
    ]
  )
))

unless res.payment_link.nil?
  # handle response
end

C# Example

using Moov.Sdk;
using Moov.Sdk.Models.Components;
using System.Collections.Generic;

var sdk = new MoovClient(security: new Security() {
    Username = "",
    Password = "",
});

var res = await sdk.PaymentLinks.CreateAsync(
    accountID: "cc1d04a8-03b1-4600-b675-e6180d574074",
    body: new CreatePaymentLink() {
        PartnerAccountID = "d290f1ee-6c54-4b01-90e6-d701748f0851",
        MerchantPaymentMethodID = "4c4e7f8e-81f4-4f3d-8f6f-6f6e7f8e4c4e",
        Display = new PaymentLinkDisplayOptions() {
            Title = "Support our cause",
            Description = "Choose an amount to contribute.",
            CallToAction = CallToAction.Donate,
        },
        Customer = new PaymentLinkCustomerOptions() {
            RequirePhone = true,
        },
        CustomAmountPayment = new PaymentLinkCustomAmountPaymentDetails() {
            AllowedMethods = new List<CollectionPaymentMethodType>() {
                CollectionPaymentMethodType.CardPayment,
                CollectionPaymentMethodType.AchDebitCollect,
            },
            AmountRange = new AmountDecimalRange() {
                Minimum = new AmountDecimal() {
                    Currency = "USD",
                    ValueDecimal = "0.00",
                },
                Maximum = new AmountDecimal() {
                    Currency = "USD",
                    ValueDecimal = "1000.00",
                },
            },
            SuggestedAmounts = new List<AmountDecimal>() {
                new AmountDecimal() {
                    Currency = "USD",
                    ValueDecimal = "50.00",
                },
                new AmountDecimal() {
                    Currency = "USD",
                    ValueDecimal = "100.00",
                },
                new AmountDecimal() {
                    Currency = "USD",
                    ValueDecimal = "500.00",
                },
                new AmountDecimal() {
                    Currency = "USD",
                    ValueDecimal = "1000.00",
                },
            },
        },
    }
);

// handle response