Update Payment Link

Update configuration options for a payment link.

Updates will overwrite existing values. Make sure to include all existing values along with updated ones.

PUT/api/v1/ypp/payment-links/{paymentLinkId}

Update configuration options for a payment link.

Updates will overwrite existing values. Make sure to include all existing values along with updated ones.

Path Parameters

paymentLinkIdpathrequired

The ID of the payment link

Request Body

object
totalAmountintegermin: 50

The total amount in cents (before a surcharge is applied).

If patronCanEnterAmount is set to true, then this will be used as the initial value for the field where the patron can enter the amount.

If patronCanEnterAmount is not set to true, then this must be a value greater than 50 (50 cents).

If taxes are configured, then totalAmount must be the pre-tax subtotal amount, before any taxes have been added.

patronCanEnterAmountbooleandefault: false

If this is set to true, then the patron will enter the amount to be charged (before a surcharge is applied).

If a totalAmount is not provided, then the patron will be required to enter an amount before payment can be submitted.

NOTE: If this is not set to true, then a totalAmount must be provided.

namestring

Internal description for use in identifying a payment link in the UI.

NOTE: This is not exposed to the patron.

disabledPaymentOptionsarray any[]

Specify payment options that will be disabled for this payment link.

By default, the following payment options will be enabled:

  • us_bank_account
  • link
  • visa
  • mastercard
  • american_express
  • discover_global_network

Disabling a payment option will prevent it from being available to the patron.

patronLocationobjectPatron Location

Based on the patron's shipping or billing address.

This should be taken from the shipping address on the invoice. If a shipping address is not available, then use the billing address instead.

This will be used in the calculation of the surcharge.

patronEmailstring

Optional email that the receipt will be sent to.

If provided, this will also be displayed to the patron on the payment page.

If not provided, then the patron will be required to enter a valid email address.

additionalDataarray object[]
taxesobject

Configure tax handling for this payment link.

This will be used calculate an additional tax amount on the surcharge when applicable.

This additional tax amount will be added to the Stripe Payment Intent metadata as metadata.totalTaxAmount, and metadata.surchargeTaxAmount.

HINT: If any item that is being purchased is taxable, then taxes should be configured on the payment link.

To configure taxes, you must provide both taxRate and taxAmount.

NOTE: Taxes are not supported if patronCanEnterAmount is set to true.

patronUsStatestring

[DEPRECATED] - Use patronLocation instead.

Allowed values (62):
ALAKAZARCACOCTDEFLGAHIIDILINIAKSKYLAMEMDMAMIMNMSMOMTNENVNHNJNMNYNCNDOHOKORPARISCSDTNTXUTVTVAWAWVWIWYASDCFMGUMHMPPWPRVIAAAEAP

Responses

200Default Response
RequestPUT/api/v1/ypp/payment-links/{paymentLinkId}
curl 'https://api.theyeeld.com/api/v1/ypp/payment-links/{paymentLinkId}' \
  --request PUT \
  --header 'Content-Type: application/json' \
  --data '{
  "totalAmount": 0,
  "patronCanEnterAmount": false,
  "name": "string",
  "disabledPaymentOptions": [
    null
  ],
  "patronLocation": {
    "country": "US",
    "stateProvince": "WA"
  },
  "patronEmail": "string",
  "additionalData": [
    {
      "type": null,
      "key": "string",
      "label": "string",
      "required": false,
      "valueForDisplay": "string",
      "value": null,
      "addToReceipt": false
    }
  ],
  "taxes": {
    "taxRate": 0,
    "taxAmount": 0
  },
  "patronUsState": null
}'
Response
{
"id": "string",
"url": "string",
"enabled": false,
"createdAt": "string",
"updatedAt": "string",
"paymentStatus": null,
"patronEmail": "string",
"patronLocation": {
"country": "string",
"stateProvince": "string"
},
"totalAmount": 0,
"patronCanEnterAmount": false,
"disabledPaymentOptions": [
null
],
"name": "string",
"additionalData": [
{
"type": null,
"key": "string",
"label": "string",
"required": false,
"valueForDisplay": "string",
"value": null,
"addToReceipt": false
}
],
"taxes": {
"taxRate": 0,
"taxAmount": 0
},
"patronUsState": null
}