---
title: PayByLink via API
slug: paybylink
docTags: 
createdAt: 2024-05-23T09:31:03.934Z
---

PayByLink is an easy way to request and accept payments. Just add the link to your emails, SMS, or invoices that you send out to your consumers.&#x20;
You do not need to have a website or a mobile app to be able to use PayByLink.

You can also generate a **QR code** linking to the payment link. Download the QR code and add the QR Code image to any printed materials:

::Image[]{src="https://api.archbee.com/api/optimize/QGXTyW3MgdNcMjdEa0v8r/cj2Pmoa8hsdz5SBIQ7sFF_docs-pay-by-link-qr-code-hres.png" size="74" width="1127" height="431" position="center" alt="paybylink qr code" showCaption="false"}

The consumer clicks on the link, and is re-directed to the payment page hosted by Judopay. This means you do not require any integration, and also reduces your PCI scope.

Once the payment is complete, a message is presented to the consumer to let them know the transaction status. You can choose to set a success or failure URL for the consumer to be redirected to.

You can also add your logo to the payment page, to provide a seamless payment journey for your consumer. Contact [customer support](mailto\:help@judopay.com) to arrange for your logo to be added.

:::hint{type="info"}
You can generate as many PayByLink payments as you need.&#x20;
Each generated link can only be used to take a **single&#x20;**&#x70;ayment.
:::

You can create a link via the:

- [Create PayByLink via API](docId:44rRmA0kRzsQsVnri7Qbw)
- [PayByLink via Judopay Portal](docId\:FR-wtitYYgtkcxLuDdma8)&#x20;

***

## Create PayByLink via API

Add the link to your emails, SMS, or invoices sent to your consumers.

:::hint{type="warning"}
Make sure your account has **3D Secure 2 API credentials&#x20;**&#x65;nabled.&#x20;
Contact ​Customer Support​​ to set this up.
:::

Call the Judopay Transaction API to create a payment link:
Make a HTTPS **POST&#x20;**&#x52;equest: `https://api-sandbox.judopay.com/webpayments/payments`

:::CodeblockTabs
Create a Payment Link

```json
{
"judoId": "yourJudoId",
  "yourConsumerReference": "yourConsumerReference",
  "yourPaymentReference": "yourPaymentReference",
  "yourPaymentMetaData": {
    "internalLocationRef": "Example",
    "internalId": 99,
    "hideBackButton": true
  },
  "currency": "GBP",
  "amount": 12.99,
  "cardAddress": {
    "address1": "CardHolder House",
    "address2": "1 CardHolder Street",
    "address3": "CardHolder Area",
    "town": "CardHolder Town",
    "postCode": "AB1 2CD",
    "countryCode": 826,
    "state": "FL",
    "cardHolderName": "John Doe"
  },
  "expiryDate": "2028-02-05T16:28:32.8596+00:00",
  "isPayByLink": false,
  "isJudoAccept": false,
  "successUrl": "https://my.site.com/success",
  "cancelUrl": "https://my.site.com/cancel",
  "emailAddress": "test.user@judopay.com",
  "mobileNumber": "7999999999",
  "phoneCountryCode": "44",
  "threeDSecure": {
    "challengeRequestIndicator": "challengeAsMandate"
  },
  "hideBillingInfo": true,
  "hideReviewInfo": true,
  "primaryAccountDetails": {
    "name": "Doe",
    "accountNumber": "12345678",
    "dateOfBirth": "1980-01-31",
    "postCode": "AB1 2CD"
  }
}
```
:::

*For the full schema details and descriptions, see Transaction API:&#x20;*[webpayments/payments ](docId\:bcXNM5keOk-nlNrZTafUT)

### PayByLink Response Model

| **Parameter**              | **Description**                                                                   |
| -------------------------- | --------------------------------------------------------------------------------- |
| `payByLinkUrl`<br />String | The short URL of the PayByLink payment form.                                      |
| `postUrl`<br />String      | The root URL of the payment link.                                                 |
| `reference`<br />String    | Unique identifier of the payment.<br />This can be used to query payment details. |

