Update payment link

PATCH/payment-links/{paymentLinkId}

Route to update payment link.

⚠️ Note: It will not be possible to update the payment link if it already has a paid order. On a recurring payment link, the paid first order of a subscription started by a buyer counts as a paid order. In this case, the API returns 400 with Invalid param: [it is not possible to update because there is already a sale for this payment link].

A negative valueInCents returns 400 with Error: The field valueInCents must be bigger than zero, without errorCode, before the payment link is read.

Recurring payment link:

  • subscription omitted: the saved recurrence terms do not change.
  • subscription as an object: saves or replaces the recurrence terms, and the payment link is saved with supportedPaymentMethods equal to ["credit-card"].
  • subscription as null: removes the recurrence terms, and the payment link charges once. If the payment link was recurring, supportedPaymentMethods becomes null (all payment methods), unless the same request sends supportedPaymentMethods.
  • Every update of a recurring payment link checks its recurrence terms again, even when the request does not send subscription. A request that changes only name returns 400 if the saved terms no longer follow the rules below, for example after the minimum charge value of the platform has increased.
  • The value after the update (valueInCents sent or saved) must be an integer equal to or greater than the minimum charge value of the platform (by default, 1000). Otherwise the API returns 400 with Invalid param: [valueInCents] and errorCode PAYMENT_LINK_SUBSCRIPTION_BELOW_MINIMUM_VALUE.
  • When the request does not send supportedPaymentMethods, the saved payment methods must be null or contain only credit-card. When the request sends supportedPaymentMethods, it must contain only credit-card, and null or an empty list is refused. Otherwise the API returns 400 with Invalid param: [supportedPaymentMethods] and errorCode PAYMENT_LINK_SUBSCRIPTION_CREDIT_CARD_ONLY. To make recurring a payment link whose saved methods include another method, send supportedPaymentMethods equal to ["credit-card"] in the same request.
  • An invalid field of subscription returns 400 with the field name prefixed by subscription., such as Missing param: [subscription.periodicity], Invalid param: [subscription.numberRecurrences] or Invalid param: [subscription.retry.intervalInDays].

Headers

  • x-api-keystringrequired

    Api key provided on integrations tab in Easyflow platform.

  • x-api-secretstringrequired

    Api Secret provided on integrations tab in Easyflow platform.

  • business-idstringrequired

    Business Identifier

Path parameters

  • paymentLinkIdstringrequired

Request body

Content typeapplication/jsonobject

  • namestring
  • descriptionstring
  • valueInCentsinteger

    Value of the payment link in cents.

  • checkoutTemplateIdstring · uuid

    ID of the checkout template.

  • preferenceobject

    Data that the checkout of the payment link asks from the buyer.

    Show child attributesHide child attributes
    • acceptNaturalPersonBuyerboolean
    • acceptCorporationBuyerboolean
    • requestAddressboolean
    • requestDeliveryAddressboolean
    • requireEmailReentryboolean
    • disableCouponFormboolean

      Default:false

  • paymentConfigurationobject
    Show child attributesHide child attributes
    • billetobject
      Show child attributesHide child attributes
      • dueDateDelayinteger
    • pixobject
      Show child attributesHide child attributes
      • expirationInMinutesinteger
    • creditCardobject
      Show child attributesHide child attributes
      • defaultInstallmentsinteger
      • maxInstallmentsinteger
      • invoiceDescriptionstring
      • installmentOptionsarray of objects
        Show child attributesHide child attributes
        • installmentsinteger
        • installmentValueInCentsintegernullable
        • interestRateintegernullable
  • supportContactobject
    Show child attributesHide child attributes
    • contactEmailIdstring · uuid

      ID of a validated contact email of the business.

  • advancedobject
    Show child attributesHide child attributes
    • redirectobject

      Redirect shown to the buyer after the payment.

      Show child attributesHide child attributes
      • urlstring
      • buttonNamestring
      • delayInSecondsintegernullable
    • buyerWhitelistobject
      Show child attributesHide child attributes
      • emailDomainsarray of strings

        Email domains allowed to buy with the payment link, such as example.com. Empty or omitted means that any email can buy.

  • interestSettingsobject
    Show child attributesHide child attributes
    • sellerAbsorbsInterestbooleanrequired

      When true, the seller absorbs the installment interest and every installment option has an interest rate of 0.

  • payerobject

    Data of the payer of the payment link.

    Show child attributesHide child attributes
    • namestringrequired
    • emailstringrequired
    • documentobjectrequired
      Show child attributesHide child attributes
      • typestringrequired

        Possible values:CPFCNPJ

      • numberstringrequired

        Document number with digits only.

    • phoneobject
      Show child attributesHide child attributes
      • areaCodestring

        Example:+55

      • dddstring

        Example:11

      • numberstring

        Example:912345678

      • isMobileboolean
    • addressobject
      Show child attributesHide child attributes
      • zipCodestring

        Zip code with digits only, such as 01310100.

      • streetstring
      • numberstring
      • complementstring
      • neighborhoodstring
      • citystring
      • statestring

        State code with 2 letters, such as SP.

    • deliveryAddressobject
      Show child attributesHide child attributes
      • zipCodestring

        Zip code with digits only, such as 01310100.

      • streetstring
      • numberstring
      • complementstring
      • neighborhoodstring
      • citystring
      • statestring

        State code with 2 letters, such as SP.

  • expiresAtstring · date-timenullable

    Date and time when the payment link expires. Send null to remove the expiration.

  • maxOrdersPerLinkintegernullable

    Number of paid orders after which the payment link is canceled. Send null to remove the limit.

  • supportedPaymentMethodsarray of stringsnullable

    Payment methods that the payment link presents. Send null to present all payment methods. On a recurring payment link, send only credit-card.

    Possible values:credit-cardpixbank-billetcryptodebit-cardtransfer

  • subscriptionobjectnullable

    Recurrence terms of the payment link. Omit it to keep the saved terms, send an object to save or replace them, or send null to remove them.

    Show child attributesHide child attributes
    • periodicitystringrequired

      Interval between recurrences.

      Possible values:MonthlyQuarterlyBiannualyAnnualy

    • repeatIndefinitelybooleanrequired

      When true, the subscription has no end and numberRecurrences must be omitted, null or 0.

    • numberRecurrencesintegernullable

      Total number of recurrences, the first one included. Required, as an integer from 1 to 1200, when repeatIndefinitely is false. When repeatIndefinitely is true, omit it or send null or 0. In responses, it is 0 when repeatIndefinitely is true.

      <= 1200

    • retryobjectnullable

      How Easyflow retries a failed recurrence. When omitted or null, it makes 5 attempts every 3 days. When sent as an object, both fields are required.

      Show child attributesHide child attributes
      • retriesMaxNumberintegerrequired

        Maximum number of attempts, from 1 to 10.

        >= 1<= 10

      • intervalInDaysintegerrequired

        Days between attempts, from 1 to 15.

        >= 1<= 15

Responses

200returns true if you managed to update the payment link.

returns true if you managed to update the payment link.

Content typeapplication/jsonobject

  • statusCodeinteger

    Example:200

  • dataobject
    Show child attributesHide child attributes
    • updatedboolean
400If the provided parameter is invalid, the API will return the following error response:

If the provided parameter is invalid, the API will return the following error response:

Content typeapplication/jsonobject

  • messagestring

    Invalid param: []

    Example:Invalid param: []

  • errorstring

    Bad Request

    Example:Bad Request

  • statusCodeinteger

    400

    Example:400

  • errorCodestring

    Code that identifies the error. Present only on some errors.

401If the request is unauthorized, the API will return the following error response:

If the request is unauthorized, the API will return the following error response:

Content typeapplication/jsonobject

  • messagestring

    Invalid field

    Example:Unauthorized

  • errorstring

    Unauthorized

    Example:Unauthorized

  • statusCodeinteger

    401

    Example:401

403If the request is forbidden, the API will return the following error response:

If the request is forbidden, the API will return the following error response:

Content typeapplication/jsonobject

  • messagestring

    Forbidden resource

    Example:Forbidden resource

  • errorstring

    Forbidden

    Example:Forbidden

  • statusCodeinteger

    403

    Example:403

500If an unexpected condition occurs and the server cannot process the request, the API will return the following error response. This response has no error field.

If an unexpected condition occurs and the server cannot process the request, the API will return the following error response. This response has no error field.

Content typeapplication/jsonobject

  • statusCodeinteger

    HTTP status code.

    Example:500

  • messagestring

    Explanation of the error.

    Example:Internal Server Error