---
updatedAt: 2025-08-22T04:46:21.000Z
agentTools:
  siteIndex: https://merchants.westpac.com.au/llms.txt
  projectIndex: https://merchants.westpac.com.au/onlinepay/llms.txt
---

# Create Payment Link with the Checkout API

```javascript JavaScript
const nodemailer = require("nodemailer");

const options = {
  method: "POST",
  headers: {
    accept: "application/json",
    "content-type": "application/json",
    authorization: "Basic PDx1c2VyPj46PDxwYXNzPj4=",
  },
  body: JSON.stringify({
    entity_id: "{{entityId}}",
    currency_code: "AUD",
    amount: 20,
    merchant_reference: "Shirt sale",
    customer: "{{customerId}}",
    interaction_type: "PAYMENT_LINK",
    configurations: {
      card: {
        payment_contract_id: "{{paymentContract}}",
        threed_secure: {
          threeds_contract_id: "{{3dsContract}}",
          enabled: true,
        },
      },
      google_pay: {
        card: {
          threed_secure: {
            threeds_contract_id: "{{3dsContract}}",
          },
          sca_compliance_level: "WALLET",
          payment_contract_id: "{{paymentContract}}",
        },
      },
      apple_pay: {
        card: {
          sca_compliance_level: "NONE",
          payment_contract_id: "{{paymentContract}}",
        },
      },
    },
  }),
};

fetch(
  "https://au.gsc.verifone.cloud/oidc/checkout-service/v2/checkout",
  options
)
  .then((res) => res.json())
  .then((res) => {
    sendInvoice({
      recipient: "customer@gmail.com",
      url: res.url,
    });
  })
  .catch((err) => console.error(err));

function sendInvoice({ recipient, url }) {
  let transporter = nodemailer.createTransport({
    service: "gmail",
    auth: {
      user: "your-email@gmail.com",
      pass: "your-email-password",
    },
  });

  let info = await transporter.sendMail({
    from: '"Your Name" <your-email@gmail.com>',
    to: recipient,
    subject: "Your payment invoice",
    text: `Your invoice URL is: ${url}`,
  });

  console.log("Email sent: " + info.response);
}
```

```json Response Example
{
  id: '8c6ac2d9-d26b-1111-2222-ddeff90b8840',
  url: 'https://prod-au.checkout.verifone.cloud/v2/checkout/{{checkoutId}}/view',
  details: {}
}
```

# Create the payment link

<!-- javascript@3-47 -->

Creating the payment link using the Checkout API, providing the required fields with Card payments, Google Pay and Apple Pay supported.

# Setup a function to email the URL

<!-- javascript@57-74 -->

Using the Nodemailer module, set up a function to email the payment link URL to the customer to complete payment.

# Send the payment link URL

<!-- javascript@50-53 -->

The email function sends the URL to the customer.