> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.payroc.com/llms.txt.
> For full documentation content, see https://docs.payroc.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.payroc.com/_mcp/server.

# Partially update subscription

PATCH https://api.payroc.com/v1/processing-terminals/{processingTerminalId}/subscriptions/{subscriptionId}
Content-Type: application/json

Use this method to partially update a subscription. Structure your request to follow the [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) standard.  

To update a subscription, you need its subscriptionId, which you sent in the request of the [Create subscription](https://docs.payroc.com/api/schema/repeat-payments/subscriptions/create) method.  

**Note:** If you don't have the subscriptionId, use our [List subscriptions](https://docs.payroc.com/api/schema/repeat-payments/subscriptions/list) method to search for the payment.  

You can update all of the properties of the subscription except for the following:  

**Can't delete**  
- recurringOrder
- description
- name

**Can't perform any PATCH operation**  
- currentState
- type
- frequency
- paymentPlan


Reference: https://docs.payroc.com/api/schema/repeat-payments/subscriptions/partially-update

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Payroc API
  version: 1.0.0
paths:
  /processing-terminals/{processingTerminalId}/subscriptions/{subscriptionId}:
    patch:
      operationId: partially-update
      summary: Partially update subscription
      description: >
        Use this method to partially update a subscription. Structure your
        request to follow the [RFC
        6902](https://datatracker.ietf.org/doc/html/rfc6902) standard.  


        To update a subscription, you need its subscriptionId, which you sent in
        the request of the [Create
        subscription](https://docs.payroc.com/api/schema/repeat-payments/subscriptions/create)
        method.  


        **Note:** If you don't have the subscriptionId, use our [List
        subscriptions](https://docs.payroc.com/api/schema/repeat-payments/subscriptions/list)
        method to search for the payment.  


        You can update all of the properties of the subscription except for the
        following:  


        **Can't delete**  

        - recurringOrder

        - description

        - name


        **Can't perform any PATCH operation**  

        - currentState

        - type

        - frequency

        - paymentPlan
      tags:
        - subpackage_repeatPayments.subpackage_repeatPayments/subscriptions
      parameters:
        - name: processingTerminalId
          in: path
          description: Unique identifier that we assigned to the terminal.
          required: true
          schema:
            type: string
        - name: subscriptionId
          in: path
          description: Unique identifier that the merchant assigned to the subscription.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          description: >-
            Unique identifier that you generate for each request. You must use
            the [UUID v4 format](https://www.rfc-editor.org/rfc/rfc4122) for the
            identifier. For more information about the idempotency key, go to
            [Idempotency](https://docs.payroc.com/api/idempotency).
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful request. We have updated the subscription.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/subscription'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400'
        '401':
          description: Identity could not be verified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '403':
          description: Do not have permissions to perform this action
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404'
        '406':
          description: Not acceptable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/406'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/409'
        '415':
          description: Unsupported media type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/415'
        '500':
          description: An error has occured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/500'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/patchRequest'
servers:
  - url: https://api.payroc.com/v1
    description: Production
  - url: https://api.uat.payroc.com/v1
    description: UAT
components:
  schemas:
    '400':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorsItems'
      required:
        - type
        - title
        - status
        - detail
      title: '400'
    '401':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
      required:
        - type
        - title
        - status
        - detail
      title: '401'
    '403':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
        instance:
          type: string
          description: Resource path the action was attempted on
        resource:
          type: string
          description: Resource the action was attempted on
      required:
        - type
        - title
        - status
        - detail
      title: '403'
    '404':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
        resource:
          type: string
          description: Resource that was not found
      required:
        - type
        - title
        - status
        - detail
      title: '404'
    '406':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
      required:
        - type
        - title
        - status
        - detail
      title: '406'
    '409':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
        instance:
          type: string
          description: Resource path to the existing resource
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorsItems'
        link:
          $ref: '#/components/schemas/link'
      required:
        - type
        - title
        - status
        - detail
      title: '409'
    '415':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
      required:
        - type
        - title
        - status
        - detail
      title: '415'
    '500':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorsItems'
      required:
        - type
        - title
        - status
        - detail
      title: '500'
    patchDocument:
      oneOf:
        - type: object
          properties:
            op:
              type: string
              enum:
                - add
              description: 'Discriminator value: add'
            path:
              type: string
              description: |
                Location where you want to add the value.
                The format for this value is JSON Pointer.
            value:
              description: Value that you want to add to the resource.
          required:
            - op
            - path
            - value
          description: A Patch Add Operation.
        - type: object
          properties:
            op:
              type: string
              enum:
                - remove
              description: 'Discriminator value: remove'
            path:
              type: string
              description: |
                Location of the value that you want to remove.
                The format for this value is JSON Pointer.
          required:
            - op
            - path
          description: A Patch Remove Operation.
        - type: object
          properties:
            op:
              type: string
              enum:
                - replace
              description: 'Discriminator value: replace'
            path:
              type: string
              description: |
                Location of the value that you want to replace.
                The format for this value is JSON Pointer.
            value:
              description: Value that you want to use as the replacement.
          required:
            - op
            - path
            - value
          description: A Patch Replace Operation.
        - type: object
          properties:
            op:
              type: string
              enum:
                - move
              description: 'Discriminator value: move'
            from:
              type: string
              description: |
                Location of the value that you want to move.
                The format for this value is JSON Pointer.
            path:
              type: string
              description: |
                Location where you want to move the value to.
                The format for this value is JSON Pointer.
          required:
            - op
            - from
            - path
          description: A Patch Move Operation.
        - type: object
          properties:
            op:
              type: string
              enum:
                - copy
              description: 'Discriminator value: copy'
            from:
              type: string
              description: |
                Location of the value that you want to copy.
                The format for this value is JSON Pointer.
            path:
              type: string
              description: |
                Location where you want to copy the value to.
                The format for this value is JSON Pointer.
          required:
            - op
            - from
            - path
          description: A Patch Copy Operation.
        - type: object
          properties:
            op:
              type: string
              enum:
                - test
              description: 'Discriminator value: test'
            path:
              type: string
              description: |
                Location of the value that you want to test.
                The format for this value is JSON Pointer.
            value:
              description: >-
                Value that you want to compare with the current value at the
                path.
          required:
            - op
            - path
            - value
          description: A Patch Test Operation.
      discriminator:
        propertyName: op
      description: A JSON Patch operation as defined by RFC 6902.
      title: patchDocument
    patchRequest:
      type: array
      items:
        $ref: '#/components/schemas/patchDocument'
      description: A JSON Patch document as defined by RFC 6902.
      title: patchRequest
    link:
      type: object
      properties:
        rel:
          type: string
          description: >-
            Indicates the relationship between the current resource and the
            target resource.
        method:
          type: string
          description: HTTP method that you need to use with the target resource.
        href:
          type: string
          description: URL of the target resource.
      required:
        - rel
        - method
        - href
      description: Object that contains HATEOAS links for the resource.
      title: link
    paymentPlanSummary:
      type: object
      properties:
        paymentPlanId:
          type: string
          description: Unique identifier that the merchant assigns to the payment plan.
        name:
          type: string
          description: Name of the payment plan.
        link:
          $ref: '#/components/schemas/link'
      required:
        - paymentPlanId
        - name
      title: paymentPlanSummary
    SecureTokenSummaryStatus:
      type: string
      enum:
        - notValidated
        - cvvValidated
        - validationFailed
        - issueNumberValidated
        - cardNumberValidated
        - bankAccountValidated
      description: >
        Status of the customer's bank account. The processor performs a security
        check on the customer's bank account and returns the status of the
        account.  

        **Note:** Depending on the merchant's account settings, this feature may
        be unavailable.
      title: SecureTokenSummaryStatus
    secureTokenSummary:
      type: object
      properties:
        secureTokenId:
          type: string
          description: Unique identifier that the merchant assigned to the secure token.
        customerName:
          type: string
          description: Customer's name.
        token:
          type: string
          description: >
            Token that the merchant can use in future transactions to represent
            the customer's payment details. The token:  

            - Begins with the six-digit identification number **296753**.  

            - Contains up to 12 digits.  

            - Contains a single check digit that we calculate using the Luhn
            algorithm.  
        status:
          $ref: '#/components/schemas/SecureTokenSummaryStatus'
          description: >
            Status of the customer's bank account. The processor performs a
            security check on the customer's bank account and returns the status
            of the account.  

            **Note:** Depending on the merchant's account settings, this feature
            may be unavailable.
        link:
          $ref: '#/components/schemas/link'
      required:
        - secureTokenId
        - customerName
        - token
        - status
      description: Object that contains information about the secure token.
      title: secureTokenSummary
    currency:
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BOV
        - BRL
        - BSD
        - BTN
        - BWP
        - BYR
        - BZD
        - CAD
        - CDF
        - CHE
        - CHF
        - CHW
        - CLF
        - CLP
        - CNY
        - COP
        - COU
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - IRR
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LTL
        - LVL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRO
        - MRU
        - MUR
        - MVR
        - MWK
        - MXN
        - MXV
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLL
        - SOS
        - SRD
        - SSP
        - STD
        - STN
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - USN
        - USS
        - UYI
        - UYU
        - UZS
        - VEF
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
        - ZWL
      description: >-
        Currency of the transaction. The value for the currency follows the [ISO
        4217](https://www.iso.org/iso-4217-currency-codes.html) standard.
      title: currency
    convenienceFee:
      type: object
      properties:
        amount:
          type: integer
          format: int64
          description: >
            If the merchant added a convenience fee, this value indicates the
            amount of the convenience fee

            in the currency’s lowest denomination, for example, cents.
      required:
        - amount
      description: >-
        Object that contains information about the convenience fee for the
        transaction.
      title: convenienceFee
    surcharge:
      type: object
      properties:
        bypass:
          type: boolean
          description: >
            Indicates if the merchant wants to remove the surcharge fee from the
            transaction.  

            - `true` - Gateway removes the surcharge fee from the transaction.  

            - `false` - Gateway adds the fee to the transaction.   
        amount:
          type: integer
          format: int64
          description: >
            If the merchant added a surcharge fee, this value indicates the
            amount of the surcharge fee

            in the currency’s lowest denomination, for example, cents.
        percentage:
          type: number
          format: double
          description: >-
            If the merchant added a surcharge fee, this value indicates the
            surcharge percentage.
      description: |
        Object that contains information about the surcharge.
      title: surcharge
    retrievedTax:
      type: object
      properties:
        name:
          type: string
          description: Name of the tax.
        rate:
          type: number
          format: double
          description: Tax percentage for the transaction.
        amount:
          type: integer
          format: int64
          description: >-
            Amount of tax that was applied to the transaction. The value is in
            the currency's lowest denomination, for example, cents.
      required:
        - name
        - rate
      title: retrievedTax
    subscriptionOrderBreakdown:
      type: object
      properties:
        subtotal:
          type: integer
          format: int64
          description: >-
            Total amount for the transaction before tax. The value is in the
            currency's lowest denomination, for example, cents.
        convenienceFee:
          $ref: '#/components/schemas/convenienceFee'
        surcharge:
          $ref: '#/components/schemas/surcharge'
          description: >-
            Object that contains information about the
            [surcharge](https://docs.payroc.com/knowledge/card-payments/credit-card-surcharging)
            that we applied to the transaction.
        taxes:
          type: array
          items:
            $ref: '#/components/schemas/retrievedTax'
          description: Array of tax objects.
      required:
        - subtotal
      description: >
        Object that contains information about the surcharge and taxes that
        apply to the transaction.
      title: subscriptionOrderBreakdown
    subscriptionPaymentOrder:
      type: object
      properties:
        orderId:
          type: string
          description: A unique identifier assigned by the merchant.
        amount:
          type: integer
          format: int64
          description: >
            Total amount for the transaction. The value is in the currency's
            lowest denomination, for example, cents.<br/>

            <br/>**Important:** Do not add the surcharge to the amount parameter
            in the request. If the transaction is eligible for surcharging, our
            gateway adds the surcharge to the amount in the request, and then
            returns the updated amount in the response.
        description:
          type: string
          description: Description of the transaction.
        breakdown:
          $ref: '#/components/schemas/subscriptionOrderBreakdown'
      description: >-
        Object that contains information about the initial cost that a customer
        pays to set up the subscription.
      title: subscriptionPaymentOrder
    subscriptionRecurringOrder:
      type: object
      properties:
        amount:
          type: integer
          format: int64
          description: >
            Total amount for the transaction. The value is in the currency's
            lowest denomination, for example, cents.<br/>

            <br/>**Important:** Do not add the surcharge to the amount parameter
            in the request. If the transaction is eligible for surcharging, our
            gateway adds the surcharge to the amount in the request, and then
            returns the updated amount in the response.
        description:
          type: string
          description: Description of the transaction.
        breakdown:
          $ref: '#/components/schemas/subscriptionOrderBreakdown'
      description: |
        Object that contains information about the cost of each payment.
      title: subscriptionRecurringOrder
    SubscriptionStateStatus:
      type: string
      enum:
        - active
        - completed
        - suspended
        - cancelled
      description: >
        Status of the Subscription.


        - 'active' - Subscription is active.

        - 'completed' - Subscription has reached the end date or the total
        number of billing cycles.

        - 'cancelled' - Merchant deactivated the subscription.

        - 'suspended' - Subscription is suspended. For example, if the customer
        misses payments.
      title: SubscriptionStateStatus
    subscriptionState:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/SubscriptionStateStatus'
          description: >
            Status of the Subscription.


            - 'active' - Subscription is active.

            - 'completed' - Subscription has reached the end date or the total
            number of billing cycles.

            - 'cancelled' - Merchant deactivated the subscription.

            - 'suspended' - Subscription is suspended. For example, if the
            customer misses payments.
        nextDueDate:
          type: string
          format: date
          description: Date that the merchant collects the next payment.
        paidInvoices:
          type: integer
          description: Number of payments that the merchant has collected.
        outstandingInvoices:
          type: integer
          description: >
            Number of payments until the end of the subscription. 

            Our gateway returns a value for **outstandingInvoices** only if the
            subscription 

            has an end date or a fixed number of billing cycles.
      required:
        - status
        - paidInvoices
      description: A snapshot of the subscription's current state.
      title: subscriptionState
    SubscriptionType:
      type: string
      enum:
        - manual
        - automatic
      description: >
        How the merchant takes the payment from the customer’s account.  

        - `manual` – The merchant manually collects payments from the
        customer.  

        - `automatic` – The terminal automatically collects payments from the
        customer.
      title: SubscriptionType
    SubscriptionFrequency:
      type: string
      enum:
        - weekly
        - fortnightly
        - monthly
        - quarterly
        - yearly
      description: >-
        Indicates how often the merchant or the terminal collects a payment from
        the customer.
      title: SubscriptionFrequency
    customField:
      type: object
      properties:
        name:
          type: string
          description: Name of the custom field.
        value:
          type: string
          description: Value for the custom field.
      required:
        - name
        - value
      title: customField
    subscription:
      type: object
      properties:
        subscriptionId:
          type: string
          description: Unique identifier that the merchant assigned to the subscription.
        processingTerminalId:
          type: string
          description: >-
            Unique identifier of the terminal that the subscription is linked
            to.
        paymentPlan:
          $ref: '#/components/schemas/paymentPlanSummary'
        secureToken:
          $ref: '#/components/schemas/secureTokenSummary'
        name:
          type: string
          description: Name of the subscription.
        description:
          type: string
          description: Description of the subscription.
        currency:
          $ref: '#/components/schemas/currency'
        setupOrder:
          $ref: '#/components/schemas/subscriptionPaymentOrder'
        recurringOrder:
          $ref: '#/components/schemas/subscriptionRecurringOrder'
        currentState:
          $ref: '#/components/schemas/subscriptionState'
        startDate:
          type: string
          format: date
          description: |
            Format: **YYYY-MM-DD**  
            Subscription's start date.
        endDate:
          type: string
          format: date
          description: >
            Format: **YYYY-MM-DD** 

            Subscription's end date.  

            **Note:** If you provide values for both **length** and
            **endDate**, 

            our gateway uses the value for **endDate** to determine when the
            subscription should end. 
        length:
          type: integer
          description: >
            Total number of billing cycles. To indicate that the subscription
            should run indefinitely, send a value of `0`. This value replaces
            the **length** inherited from the payment plan.  

            **Note:** If you provide values for both **length** and **endDate**,
            our gateway uses the value for **endDate** to determine when the
            subscription should end.
        type:
          $ref: '#/components/schemas/SubscriptionType'
          description: >
            How the merchant takes the payment from the customer’s account.  

            - `manual` – The merchant manually collects payments from the
            customer.  

            - `automatic` – The terminal automatically collects payments from
            the customer.
        frequency:
          $ref: '#/components/schemas/SubscriptionFrequency'
          description: >-
            Indicates how often the merchant or the terminal collects a payment
            from the customer.
        pauseCollectionFor:
          type: integer
          description: >
            Number of billing cycles that the merchant wants to pause payments
            for. 

            For example, if the merchant wants to offer a free trial period.
        customFields:
          type: array
          items:
            $ref: '#/components/schemas/customField'
          description: |
            Array of customField objects.
      required:
        - subscriptionId
        - processingTerminalId
        - paymentPlan
        - secureToken
        - name
        - currency
        - currentState
        - startDate
        - type
        - frequency
      title: subscription
    ErrorsItems:
      type: object
      properties:
        message:
          type: string
          description: Error message
      title: ErrorsItems
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

```

## Examples

### Subscription with surcharge



**Request**

```json
undefined
```

**Response**

```json
{
  "subscriptionId": "SubRef7654",
  "processingTerminalId": "1234001",
  "paymentPlan": {
    "paymentPlanId": "PlanRef8765",
    "name": "Monthly Premium Club subscription",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/payment-plans/PlanRef8765"
    }
  },
  "secureToken": {
    "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
    "customerName": "Sarah Hazel Hopper",
    "token": "296753123456",
    "status": "notValidated",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
    }
  },
  "name": "Premium Club",
  "currency": "USD",
  "currentState": {
    "status": "active",
    "paidInvoices": 0,
    "nextDueDate": "2024-08-02",
    "outstandingInvoices": 3
  },
  "startDate": "2024-07-02",
  "type": "automatic",
  "frequency": "monthly",
  "description": "Premium Club subscription",
  "setupOrder": {
    "orderId": "OrderRef6543",
    "amount": 4999,
    "description": "Initial setup fee for Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "recurringOrder": {
    "amount": 4999,
    "description": "Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "endDate": "2025-07-01",
  "length": 12,
  "pauseCollectionFor": 0,
  "customFields": [
    {
      "name": "yourCustomField",
      "value": "abc123"
    }
  ]
}
```

**SDK Code**

```typescript Subscription with surcharge
import { PayrocClient } from "payroc";

async function main() {
    const client = new PayrocClient();
    await client.repeatPayments.subscriptions.partiallyUpdate("1234001", "SubRef7654", {
        idempotencyKey: "8e03978e-40d5-43e8-bc93-6894a57f9324",
    });
}
main();

```

```python Subscription with surcharge
from payroc import Payroc

client = Payroc()

client.repeat_payments.subscriptions.partially_update(
    processing_terminal_id="1234001",
    subscription_id="SubRef7654",
    idempotency_key="8e03978e-40d5-43e8-bc93-6894a57f9324",
)

```

```java Subscription with surcharge
package com.example.usage;

import com.payroc.api.PayrocApiClient;
import com.payroc.api.resources.repeatpayments.subscriptions.requests.PartiallyUpdateSubscriptionsRequest;

public class Example {
    public static void main(String[] args) {
        PayrocApiClient client = PayrocApiClient
            .builder()
            .build();

        client.repeatPayments().subscriptions().partiallyUpdate(
            "1234001",
            "SubRef7654",
            PartiallyUpdateSubscriptionsRequest
                .builder()
                .idempotencyKey("8e03978e-40d5-43e8-bc93-6894a57f9324")
                .build()
        );
    }
}
```

```ruby Subscription with surcharge
require "payroc"

client = Payroc::Client.new

client.repeat_payments.subscriptions.partially_update(
  processing_terminal_id: "1234001",
  subscription_id: "SubRef7654",
  idempotency_key: "8e03978e-40d5-43e8-bc93-6894a57f9324"
)

```

```csharp Subscription with surcharge
using Payroc;
using System.Threading.Tasks;
using Payroc.RepeatPayments.Subscriptions;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayrocClient();

        await client.RepeatPayments.Subscriptions.PartiallyUpdateAsync(
            new PartiallyUpdateSubscriptionsRequest {
                ProcessingTerminalId = "1234001",
                SubscriptionId = "SubRef7654",
                IdempotencyKey = "8e03978e-40d5-43e8-bc93-6894a57f9324"
            }
        );
    }

}

```

```go Subscription with surcharge
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654"

	req, _ := http.NewRequest("PATCH", url, nil)

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Subscription with surcharge
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

echo $response->getBody();
```

```swift Subscription with surcharge
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Subscription with convenience fee



**Request**

```json
undefined
```

**Response**

```json
{
  "subscriptionId": "SubRef7654",
  "processingTerminalId": "1234001",
  "paymentPlan": {
    "paymentPlanId": "PlanRef8765",
    "name": "Monthly Premium Club subscription",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/payment-plans/PlanRef8765"
    }
  },
  "secureToken": {
    "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
    "customerName": "Sarah Hazel Hopper",
    "token": "296753123456",
    "status": "notValidated",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
    }
  },
  "name": "Premium Club",
  "currency": "USD",
  "currentState": {
    "status": "active",
    "paidInvoices": 0,
    "nextDueDate": "2024-08-02",
    "outstandingInvoices": 3
  },
  "startDate": "2024-07-02",
  "type": "automatic",
  "frequency": "monthly",
  "description": "Premium Club subscription",
  "setupOrder": {
    "orderId": "OrderRef6543",
    "amount": 4999,
    "description": "Initial setup fee for Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "convenienceFee": {
        "amount": 217
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "recurringOrder": {
    "amount": 4999,
    "description": "Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "convenienceFee": {
        "amount": 217
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "endDate": "2025-07-01",
  "length": 12,
  "pauseCollectionFor": 0,
  "customFields": [
    {
      "name": "yourCustomField",
      "value": "abc123"
    }
  ]
}
```

**SDK Code**

```typescript Subscription with convenience fee
import { PayrocClient } from "payroc";

async function main() {
    const client = new PayrocClient();
    await client.repeatPayments.subscriptions.partiallyUpdate("1234001", "SubRef7654", {
        idempotencyKey: "8e03978e-40d5-43e8-bc93-6894a57f9324",
    });
}
main();

```

```python Subscription with convenience fee
from payroc import Payroc

client = Payroc()

client.repeat_payments.subscriptions.partially_update(
    processing_terminal_id="1234001",
    subscription_id="SubRef7654",
    idempotency_key="8e03978e-40d5-43e8-bc93-6894a57f9324",
)

```

```java Subscription with convenience fee
package com.example.usage;

import com.payroc.api.PayrocApiClient;
import com.payroc.api.resources.repeatpayments.subscriptions.requests.PartiallyUpdateSubscriptionsRequest;

public class Example {
    public static void main(String[] args) {
        PayrocApiClient client = PayrocApiClient
            .builder()
            .build();

        client.repeatPayments().subscriptions().partiallyUpdate(
            "1234001",
            "SubRef7654",
            PartiallyUpdateSubscriptionsRequest
                .builder()
                .idempotencyKey("8e03978e-40d5-43e8-bc93-6894a57f9324")
                .build()
        );
    }
}
```

```ruby Subscription with convenience fee
require "payroc"

client = Payroc::Client.new

client.repeat_payments.subscriptions.partially_update(
  processing_terminal_id: "1234001",
  subscription_id: "SubRef7654",
  idempotency_key: "8e03978e-40d5-43e8-bc93-6894a57f9324"
)

```

```csharp Subscription with convenience fee
using Payroc;
using System.Threading.Tasks;
using Payroc.RepeatPayments.Subscriptions;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayrocClient();

        await client.RepeatPayments.Subscriptions.PartiallyUpdateAsync(
            new PartiallyUpdateSubscriptionsRequest {
                ProcessingTerminalId = "1234001",
                SubscriptionId = "SubRef7654",
                IdempotencyKey = "8e03978e-40d5-43e8-bc93-6894a57f9324"
            }
        );
    }

}

```

```go Subscription with convenience fee
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654"

	req, _ := http.NewRequest("PATCH", url, nil)

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Subscription with convenience fee
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

echo $response->getBody();
```

```swift Subscription with convenience fee
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update subscription



**Request**

```json
[
  {
    "op": "add",
    "path": "/setupOrder/amount",
    "value": null
  },
  {
    "op": "add",
    "path": "/recurringOrder/amount",
    "value": null
  },
  {
    "op": "add",
    "path": "/frequency",
    "value": null
  }
]
```

**Response**

```json
{
  "subscriptionId": "SubRef7654",
  "processingTerminalId": "1234001",
  "paymentPlan": {
    "paymentPlanId": "PlanRef8765",
    "name": "Monthly Premium Club subscription",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/payment-plans/PlanRef8765"
    }
  },
  "secureToken": {
    "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
    "customerName": "Sarah Hazel Hopper",
    "token": "296753123456",
    "status": "notValidated",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
    }
  },
  "name": "Premium Club",
  "currency": "USD",
  "currentState": {
    "status": "active",
    "paidInvoices": 0,
    "nextDueDate": "2024-08-02",
    "outstandingInvoices": 3
  },
  "startDate": "2024-07-02",
  "type": "automatic",
  "frequency": "monthly",
  "description": "Premium Club subscription",
  "setupOrder": {
    "orderId": "OrderRef6543",
    "amount": 4999,
    "description": "Initial setup fee for Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "recurringOrder": {
    "amount": 4999,
    "description": "Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "endDate": "2025-07-01",
  "length": 12,
  "pauseCollectionFor": 0,
  "customFields": [
    {
      "name": "yourCustomField",
      "value": "abc123"
    }
  ]
}
```

**SDK Code**

```typescript Update subscription
import { PayrocClient } from "payroc";

async function main() {
    const client = new PayrocClient();
    await client.repeatPayments.subscriptions.partiallyUpdate("1234001", "SubRef7654", {
        idempotencyKey: "8e03978e-40d5-43e8-bc93-6894a57f9324",
        body: [
            {
                op: "add",
                path: "/setupOrder/amount",
            },
            {
                op: "add",
                path: "/recurringOrder/amount",
            },
            {
                op: "add",
                path: "/frequency",
            },
        ],
    });
}
main();

```

```python Update subscription
from payroc import Payroc, PatchDocument_Add

client = Payroc()

client.repeat_payments.subscriptions.partially_update(
    processing_terminal_id="1234001",
    subscription_id="SubRef7654",
    idempotency_key="8e03978e-40d5-43e8-bc93-6894a57f9324",
    request=[
        PatchDocument_Add(
            path="/setupOrder/amount",
        ),
        PatchDocument_Add(
            path="/recurringOrder/amount",
        ),
        PatchDocument_Add(
            path="/frequency",
        )
    ],
)

```

```java Update subscription
package com.example.usage;

import com.payroc.api.PayrocApiClient;
import com.payroc.api.resources.repeatpayments.subscriptions.requests.PartiallyUpdateSubscriptionsRequest;
import com.payroc.api.types.PatchAdd;
import com.payroc.api.types.PatchDocument;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        PayrocApiClient client = PayrocApiClient
            .builder()
            .build();

        client.repeatPayments().subscriptions().partiallyUpdate(
            "1234001",
            "SubRef7654",
            PartiallyUpdateSubscriptionsRequest
                .builder()
                .idempotencyKey("8e03978e-40d5-43e8-bc93-6894a57f9324")
                .body(
                    Arrays.asList(
                        PatchDocument.add(
                            PatchAdd
                                .builder()
                                .path("/setupOrder/amount")
                                .build()
                        ),
                        PatchDocument.add(
                            PatchAdd
                                .builder()
                                .path("/recurringOrder/amount")
                                .build()
                        ),
                        PatchDocument.add(
                            PatchAdd
                                .builder()
                                .path("/frequency")
                                .build()
                        )
                    )
                )
                .build()
        );
    }
}
```

```ruby Update subscription
require "payroc"

client = Payroc::Client.new

client.repeat_payments.subscriptions.partially_update(
  processing_terminal_id: "1234001",
  subscription_id: "SubRef7654",
  idempotency_key: "8e03978e-40d5-43e8-bc93-6894a57f9324",
  request: []
)

```

```csharp Update subscription
using Payroc;
using System.Threading.Tasks;
using Payroc.RepeatPayments.Subscriptions;
using System.Collections.Generic;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayrocClient();

        await client.RepeatPayments.Subscriptions.PartiallyUpdateAsync(
            new PartiallyUpdateSubscriptionsRequest {
                ProcessingTerminalId = "1234001",
                SubscriptionId = "SubRef7654",
                IdempotencyKey = "8e03978e-40d5-43e8-bc93-6894a57f9324",
                Body = new List<PatchDocument>(){
                    new PatchDocument(
                        new PatchAdd {
                            Path = "/setupOrder/amount"
                        }
                    ),
                    new PatchDocument(
                        new PatchAdd {
                            Path = "/recurringOrder/amount"
                        }
                    ),
                    new PatchDocument(
                        new PatchAdd {
                            Path = "/frequency"
                        }
                    ),
                }

            }
        );
    }

}

```

```go Update subscription
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654"

	payload := strings.NewReader("[\n  {\n    \"op\": \"add\",\n    \"path\": \"/setupOrder/amount\",\n    \"value\": null\n  },\n  {\n    \"op\": \"add\",\n    \"path\": \"/recurringOrder/amount\",\n    \"value\": null\n  },\n  {\n    \"op\": \"add\",\n    \"path\": \"/frequency\",\n    \"value\": null\n  }\n]")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Update subscription
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654', [
  'body' => '[
  {
    "op": "add",
    "path": "/setupOrder/amount",
    "value": null
  },
  {
    "op": "add",
    "path": "/recurringOrder/amount",
    "value": null
  },
  {
    "op": "add",
    "path": "/frequency",
    "value": null
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

echo $response->getBody();
```

```swift Update subscription
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "op": "add",
    "path": "/setupOrder/amount",
    "value": 
  ],
  [
    "op": "add",
    "path": "/recurringOrder/amount",
    "value": 
  ],
  [
    "op": "add",
    "path": "/frequency",
    "value": 
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update subscription: add



**Request**

```json
[
  {
    "op": "add",
    "path": "/customFields",
    "value": null
  }
]
```

**Response**

```json
{
  "subscriptionId": "SubRef7654",
  "processingTerminalId": "1234001",
  "paymentPlan": {
    "paymentPlanId": "PlanRef8765",
    "name": "Monthly Premium Club subscription",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/payment-plans/PlanRef8765"
    }
  },
  "secureToken": {
    "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
    "customerName": "Sarah Hazel Hopper",
    "token": "296753123456",
    "status": "notValidated",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
    }
  },
  "name": "Premium Club",
  "currency": "USD",
  "currentState": {
    "status": "active",
    "paidInvoices": 0,
    "nextDueDate": "2024-08-02",
    "outstandingInvoices": 3
  },
  "startDate": "2024-07-02",
  "type": "automatic",
  "frequency": "monthly",
  "description": "Premium Club subscription",
  "setupOrder": {
    "orderId": "OrderRef6543",
    "amount": 4999,
    "description": "Initial setup fee for Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "recurringOrder": {
    "amount": 4999,
    "description": "Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "endDate": "2025-07-01",
  "length": 12,
  "pauseCollectionFor": 0,
  "customFields": [
    {
      "name": "yourCustomField",
      "value": "abc123"
    }
  ]
}
```

**SDK Code**

```typescript Update subscription: add
import { PayrocClient } from "payroc";

async function main() {
    const client = new PayrocClient();
    await client.repeatPayments.subscriptions.partiallyUpdate("1234001", "SubRef7654", {
        idempotencyKey: "8e03978e-40d5-43e8-bc93-6894a57f9324",
        body: [
            {
                op: "add",
                path: "/customFields",
            },
        ],
    });
}
main();

```

```python Update subscription: add
from payroc import Payroc, PatchDocument_Add

client = Payroc()

client.repeat_payments.subscriptions.partially_update(
    processing_terminal_id="1234001",
    subscription_id="SubRef7654",
    idempotency_key="8e03978e-40d5-43e8-bc93-6894a57f9324",
    request=[
        PatchDocument_Add(
            path="/customFields",
        )
    ],
)

```

```java Update subscription: add
package com.example.usage;

import com.payroc.api.PayrocApiClient;
import com.payroc.api.resources.repeatpayments.subscriptions.requests.PartiallyUpdateSubscriptionsRequest;
import com.payroc.api.types.PatchAdd;
import com.payroc.api.types.PatchDocument;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        PayrocApiClient client = PayrocApiClient
            .builder()
            .build();

        client.repeatPayments().subscriptions().partiallyUpdate(
            "1234001",
            "SubRef7654",
            PartiallyUpdateSubscriptionsRequest
                .builder()
                .idempotencyKey("8e03978e-40d5-43e8-bc93-6894a57f9324")
                .body(
                    Arrays.asList(
                        PatchDocument.add(
                            PatchAdd
                                .builder()
                                .path("/customFields")
                                .build()
                        )
                    )
                )
                .build()
        );
    }
}
```

```ruby Update subscription: add
require "payroc"

client = Payroc::Client.new

client.repeat_payments.subscriptions.partially_update(
  processing_terminal_id: "1234001",
  subscription_id: "SubRef7654",
  idempotency_key: "8e03978e-40d5-43e8-bc93-6894a57f9324",
  request: []
)

```

```csharp Update subscription: add
using Payroc;
using System.Threading.Tasks;
using Payroc.RepeatPayments.Subscriptions;
using System.Collections.Generic;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayrocClient();

        await client.RepeatPayments.Subscriptions.PartiallyUpdateAsync(
            new PartiallyUpdateSubscriptionsRequest {
                ProcessingTerminalId = "1234001",
                SubscriptionId = "SubRef7654",
                IdempotencyKey = "8e03978e-40d5-43e8-bc93-6894a57f9324",
                Body = new List<PatchDocument>(){
                    new PatchDocument(
                        new PatchAdd {
                            Path = "/customFields"
                        }
                    ),
                }

            }
        );
    }

}

```

```go Update subscription: add
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654"

	payload := strings.NewReader("[\n  {\n    \"op\": \"add\",\n    \"path\": \"/customFields\",\n    \"value\": null\n  }\n]")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Update subscription: add
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654', [
  'body' => '[
  {
    "op": "add",
    "path": "/customFields",
    "value": null
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

echo $response->getBody();
```

```swift Update subscription: add
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "op": "add",
    "path": "/customFields",
    "value": 
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update subscription: remove



**Request**

```json
[
  {
    "op": "remove",
    "path": "/description"
  }
]
```

**Response**

```json
{
  "subscriptionId": "SubRef7654",
  "processingTerminalId": "1234001",
  "paymentPlan": {
    "paymentPlanId": "PlanRef8765",
    "name": "Monthly Premium Club subscription",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/payment-plans/PlanRef8765"
    }
  },
  "secureToken": {
    "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
    "customerName": "Sarah Hazel Hopper",
    "token": "296753123456",
    "status": "notValidated",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
    }
  },
  "name": "Premium Club",
  "currency": "USD",
  "currentState": {
    "status": "active",
    "paidInvoices": 0,
    "nextDueDate": "2024-08-02",
    "outstandingInvoices": 3
  },
  "startDate": "2024-07-02",
  "type": "automatic",
  "frequency": "monthly",
  "description": "Premium Club subscription",
  "setupOrder": {
    "orderId": "OrderRef6543",
    "amount": 4999,
    "description": "Initial setup fee for Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "recurringOrder": {
    "amount": 4999,
    "description": "Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "endDate": "2025-07-01",
  "length": 12,
  "pauseCollectionFor": 0,
  "customFields": [
    {
      "name": "yourCustomField",
      "value": "abc123"
    }
  ]
}
```

**SDK Code**

```typescript Update subscription: remove
import { PayrocClient } from "payroc";

async function main() {
    const client = new PayrocClient();
    await client.repeatPayments.subscriptions.partiallyUpdate("1234001", "SubRef7654", {
        idempotencyKey: "8e03978e-40d5-43e8-bc93-6894a57f9324",
        body: [
            {
                op: "remove",
                path: "/description",
            },
        ],
    });
}
main();

```

```python Update subscription: remove
from payroc import Payroc, PatchDocument_Remove

client = Payroc()

client.repeat_payments.subscriptions.partially_update(
    processing_terminal_id="1234001",
    subscription_id="SubRef7654",
    idempotency_key="8e03978e-40d5-43e8-bc93-6894a57f9324",
    request=[
        PatchDocument_Remove(
            path="/description",
        )
    ],
)

```

```java Update subscription: remove
package com.example.usage;

import com.payroc.api.PayrocApiClient;
import com.payroc.api.resources.repeatpayments.subscriptions.requests.PartiallyUpdateSubscriptionsRequest;
import com.payroc.api.types.PatchDocument;
import com.payroc.api.types.PatchRemove;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        PayrocApiClient client = PayrocApiClient
            .builder()
            .build();

        client.repeatPayments().subscriptions().partiallyUpdate(
            "1234001",
            "SubRef7654",
            PartiallyUpdateSubscriptionsRequest
                .builder()
                .idempotencyKey("8e03978e-40d5-43e8-bc93-6894a57f9324")
                .body(
                    Arrays.asList(
                        PatchDocument.remove(
                            PatchRemove
                                .builder()
                                .path("/description")
                                .build()
                        )
                    )
                )
                .build()
        );
    }
}
```

```ruby Update subscription: remove
require "payroc"

client = Payroc::Client.new

client.repeat_payments.subscriptions.partially_update(
  processing_terminal_id: "1234001",
  subscription_id: "SubRef7654",
  idempotency_key: "8e03978e-40d5-43e8-bc93-6894a57f9324",
  request: []
)

```

```csharp Update subscription: remove
using Payroc;
using System.Threading.Tasks;
using Payroc.RepeatPayments.Subscriptions;
using System.Collections.Generic;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayrocClient();

        await client.RepeatPayments.Subscriptions.PartiallyUpdateAsync(
            new PartiallyUpdateSubscriptionsRequest {
                ProcessingTerminalId = "1234001",
                SubscriptionId = "SubRef7654",
                IdempotencyKey = "8e03978e-40d5-43e8-bc93-6894a57f9324",
                Body = new List<PatchDocument>(){
                    new PatchDocument(
                        new PatchRemove {
                            Path = "/description"
                        }
                    ),
                }

            }
        );
    }

}

```

```go Update subscription: remove
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654"

	payload := strings.NewReader("[\n  {\n    \"op\": \"remove\",\n    \"path\": \"/description\"\n  }\n]")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Update subscription: remove
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654', [
  'body' => '[
  {
    "op": "remove",
    "path": "/description"
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

echo $response->getBody();
```

```swift Update subscription: remove
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "op": "remove",
    "path": "/description"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update subscription: replace



**Request**

```json
[
  {
    "op": "add",
    "path": "/recurringOrder/amount",
    "value": null
  }
]
```

**Response**

```json
{
  "subscriptionId": "SubRef7654",
  "processingTerminalId": "1234001",
  "paymentPlan": {
    "paymentPlanId": "PlanRef8765",
    "name": "Monthly Premium Club subscription",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/payment-plans/PlanRef8765"
    }
  },
  "secureToken": {
    "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
    "customerName": "Sarah Hazel Hopper",
    "token": "296753123456",
    "status": "notValidated",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
    }
  },
  "name": "Premium Club",
  "currency": "USD",
  "currentState": {
    "status": "active",
    "paidInvoices": 0,
    "nextDueDate": "2024-08-02",
    "outstandingInvoices": 3
  },
  "startDate": "2024-07-02",
  "type": "automatic",
  "frequency": "monthly",
  "description": "Premium Club subscription",
  "setupOrder": {
    "orderId": "OrderRef6543",
    "amount": 4999,
    "description": "Initial setup fee for Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "recurringOrder": {
    "amount": 4999,
    "description": "Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "endDate": "2025-07-01",
  "length": 12,
  "pauseCollectionFor": 0,
  "customFields": [
    {
      "name": "yourCustomField",
      "value": "abc123"
    }
  ]
}
```

**SDK Code**

```typescript Update subscription: replace
import { PayrocClient } from "payroc";

async function main() {
    const client = new PayrocClient();
    await client.repeatPayments.subscriptions.partiallyUpdate("1234001", "SubRef7654", {
        idempotencyKey: "8e03978e-40d5-43e8-bc93-6894a57f9324",
        body: [
            {
                op: "add",
                path: "/recurringOrder/amount",
            },
        ],
    });
}
main();

```

```python Update subscription: replace
from payroc import Payroc, PatchDocument_Add

client = Payroc()

client.repeat_payments.subscriptions.partially_update(
    processing_terminal_id="1234001",
    subscription_id="SubRef7654",
    idempotency_key="8e03978e-40d5-43e8-bc93-6894a57f9324",
    request=[
        PatchDocument_Add(
            path="/recurringOrder/amount",
        )
    ],
)

```

```java Update subscription: replace
package com.example.usage;

import com.payroc.api.PayrocApiClient;
import com.payroc.api.resources.repeatpayments.subscriptions.requests.PartiallyUpdateSubscriptionsRequest;
import com.payroc.api.types.PatchAdd;
import com.payroc.api.types.PatchDocument;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        PayrocApiClient client = PayrocApiClient
            .builder()
            .build();

        client.repeatPayments().subscriptions().partiallyUpdate(
            "1234001",
            "SubRef7654",
            PartiallyUpdateSubscriptionsRequest
                .builder()
                .idempotencyKey("8e03978e-40d5-43e8-bc93-6894a57f9324")
                .body(
                    Arrays.asList(
                        PatchDocument.add(
                            PatchAdd
                                .builder()
                                .path("/recurringOrder/amount")
                                .build()
                        )
                    )
                )
                .build()
        );
    }
}
```

```ruby Update subscription: replace
require "payroc"

client = Payroc::Client.new

client.repeat_payments.subscriptions.partially_update(
  processing_terminal_id: "1234001",
  subscription_id: "SubRef7654",
  idempotency_key: "8e03978e-40d5-43e8-bc93-6894a57f9324",
  request: []
)

```

```csharp Update subscription: replace
using Payroc;
using System.Threading.Tasks;
using Payroc.RepeatPayments.Subscriptions;
using System.Collections.Generic;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayrocClient();

        await client.RepeatPayments.Subscriptions.PartiallyUpdateAsync(
            new PartiallyUpdateSubscriptionsRequest {
                ProcessingTerminalId = "1234001",
                SubscriptionId = "SubRef7654",
                IdempotencyKey = "8e03978e-40d5-43e8-bc93-6894a57f9324",
                Body = new List<PatchDocument>(){
                    new PatchDocument(
                        new PatchAdd {
                            Path = "/recurringOrder/amount"
                        }
                    ),
                }

            }
        );
    }

}

```

```go Update subscription: replace
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654"

	payload := strings.NewReader("[\n  {\n    \"op\": \"add\",\n    \"path\": \"/recurringOrder/amount\",\n    \"value\": null\n  }\n]")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Update subscription: replace
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654', [
  'body' => '[
  {
    "op": "add",
    "path": "/recurringOrder/amount",
    "value": null
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

echo $response->getBody();
```

```swift Update subscription: replace
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "op": "add",
    "path": "/recurringOrder/amount",
    "value": 
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update subscription: move



**Request**

```json
[
  {
    "op": "move",
    "from": "/customFields/0",
    "path": "/customFields/1"
  }
]
```

**Response**

```json
{
  "subscriptionId": "SubRef7654",
  "processingTerminalId": "1234001",
  "paymentPlan": {
    "paymentPlanId": "PlanRef8765",
    "name": "Monthly Premium Club subscription",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/payment-plans/PlanRef8765"
    }
  },
  "secureToken": {
    "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
    "customerName": "Sarah Hazel Hopper",
    "token": "296753123456",
    "status": "notValidated",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
    }
  },
  "name": "Premium Club",
  "currency": "USD",
  "currentState": {
    "status": "active",
    "paidInvoices": 0,
    "nextDueDate": "2024-08-02",
    "outstandingInvoices": 3
  },
  "startDate": "2024-07-02",
  "type": "automatic",
  "frequency": "monthly",
  "description": "Premium Club subscription",
  "setupOrder": {
    "orderId": "OrderRef6543",
    "amount": 4999,
    "description": "Initial setup fee for Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "recurringOrder": {
    "amount": 4999,
    "description": "Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "endDate": "2025-07-01",
  "length": 12,
  "pauseCollectionFor": 0,
  "customFields": [
    {
      "name": "yourCustomField",
      "value": "abc123"
    }
  ]
}
```

**SDK Code**

```typescript Update subscription: move
import { PayrocClient } from "payroc";

async function main() {
    const client = new PayrocClient();
    await client.repeatPayments.subscriptions.partiallyUpdate("1234001", "SubRef7654", {
        idempotencyKey: "8e03978e-40d5-43e8-bc93-6894a57f9324",
        body: [
            {
                op: "move",
                from: "/customFields/0",
                path: "/customFields/1",
            },
        ],
    });
}
main();

```

```python Update subscription: move
from payroc import Payroc, PatchDocument_Move

client = Payroc()

client.repeat_payments.subscriptions.partially_update(
    processing_terminal_id="1234001",
    subscription_id="SubRef7654",
    idempotency_key="8e03978e-40d5-43e8-bc93-6894a57f9324",
    request=[
        PatchDocument_Move(
            from_="/customFields/0",
            path="/customFields/1",
        )
    ],
)

```

```java Update subscription: move
package com.example.usage;

import com.payroc.api.PayrocApiClient;
import com.payroc.api.resources.repeatpayments.subscriptions.requests.PartiallyUpdateSubscriptionsRequest;
import com.payroc.api.types.PatchDocument;
import com.payroc.api.types.PatchMove;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        PayrocApiClient client = PayrocApiClient
            .builder()
            .build();

        client.repeatPayments().subscriptions().partiallyUpdate(
            "1234001",
            "SubRef7654",
            PartiallyUpdateSubscriptionsRequest
                .builder()
                .idempotencyKey("8e03978e-40d5-43e8-bc93-6894a57f9324")
                .body(
                    Arrays.asList(
                        PatchDocument.move(
                            PatchMove
                                .builder()
                                .from("/customFields/0")
                                .path("/customFields/1")
                                .build()
                        )
                    )
                )
                .build()
        );
    }
}
```

```ruby Update subscription: move
require "payroc"

client = Payroc::Client.new

client.repeat_payments.subscriptions.partially_update(
  processing_terminal_id: "1234001",
  subscription_id: "SubRef7654",
  idempotency_key: "8e03978e-40d5-43e8-bc93-6894a57f9324",
  request: []
)

```

```csharp Update subscription: move
using Payroc;
using System.Threading.Tasks;
using Payroc.RepeatPayments.Subscriptions;
using System.Collections.Generic;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayrocClient();

        await client.RepeatPayments.Subscriptions.PartiallyUpdateAsync(
            new PartiallyUpdateSubscriptionsRequest {
                ProcessingTerminalId = "1234001",
                SubscriptionId = "SubRef7654",
                IdempotencyKey = "8e03978e-40d5-43e8-bc93-6894a57f9324",
                Body = new List<PatchDocument>(){
                    new PatchDocument(
                        new PatchMove {
                            From = "/customFields/0",
                            Path = "/customFields/1"
                        }
                    ),
                }

            }
        );
    }

}

```

```go Update subscription: move
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654"

	payload := strings.NewReader("[\n  {\n    \"op\": \"move\",\n    \"from\": \"/customFields/0\",\n    \"path\": \"/customFields/1\"\n  }\n]")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Update subscription: move
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654', [
  'body' => '[
  {
    "op": "move",
    "from": "/customFields/0",
    "path": "/customFields/1"
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

echo $response->getBody();
```

```swift Update subscription: move
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "op": "move",
    "from": "/customFields/0",
    "path": "/customFields/1"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update subscription: copy



**Request**

```json
[
  {
    "op": "copy",
    "from": "/name",
    "path": "/description"
  }
]
```

**Response**

```json
{
  "subscriptionId": "SubRef7654",
  "processingTerminalId": "1234001",
  "paymentPlan": {
    "paymentPlanId": "PlanRef8765",
    "name": "Monthly Premium Club subscription",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/payment-plans/PlanRef8765"
    }
  },
  "secureToken": {
    "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
    "customerName": "Sarah Hazel Hopper",
    "token": "296753123456",
    "status": "notValidated",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
    }
  },
  "name": "Premium Club",
  "currency": "USD",
  "currentState": {
    "status": "active",
    "paidInvoices": 0,
    "nextDueDate": "2024-08-02",
    "outstandingInvoices": 3
  },
  "startDate": "2024-07-02",
  "type": "automatic",
  "frequency": "monthly",
  "description": "Premium Club subscription",
  "setupOrder": {
    "orderId": "OrderRef6543",
    "amount": 4999,
    "description": "Initial setup fee for Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "recurringOrder": {
    "amount": 4999,
    "description": "Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "endDate": "2025-07-01",
  "length": 12,
  "pauseCollectionFor": 0,
  "customFields": [
    {
      "name": "yourCustomField",
      "value": "abc123"
    }
  ]
}
```

**SDK Code**

```typescript Update subscription: copy
import { PayrocClient } from "payroc";

async function main() {
    const client = new PayrocClient();
    await client.repeatPayments.subscriptions.partiallyUpdate("1234001", "SubRef7654", {
        idempotencyKey: "8e03978e-40d5-43e8-bc93-6894a57f9324",
        body: [
            {
                op: "copy",
                from: "/name",
                path: "/description",
            },
        ],
    });
}
main();

```

```python Update subscription: copy
from payroc import Payroc, PatchDocument_Copy

client = Payroc()

client.repeat_payments.subscriptions.partially_update(
    processing_terminal_id="1234001",
    subscription_id="SubRef7654",
    idempotency_key="8e03978e-40d5-43e8-bc93-6894a57f9324",
    request=[
        PatchDocument_Copy(
            from_="/name",
            path="/description",
        )
    ],
)

```

```java Update subscription: copy
package com.example.usage;

import com.payroc.api.PayrocApiClient;
import com.payroc.api.resources.repeatpayments.subscriptions.requests.PartiallyUpdateSubscriptionsRequest;
import com.payroc.api.types.PatchCopy;
import com.payroc.api.types.PatchDocument;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        PayrocApiClient client = PayrocApiClient
            .builder()
            .build();

        client.repeatPayments().subscriptions().partiallyUpdate(
            "1234001",
            "SubRef7654",
            PartiallyUpdateSubscriptionsRequest
                .builder()
                .idempotencyKey("8e03978e-40d5-43e8-bc93-6894a57f9324")
                .body(
                    Arrays.asList(
                        PatchDocument.copy(
                            PatchCopy
                                .builder()
                                .from("/name")
                                .path("/description")
                                .build()
                        )
                    )
                )
                .build()
        );
    }
}
```

```ruby Update subscription: copy
require "payroc"

client = Payroc::Client.new

client.repeat_payments.subscriptions.partially_update(
  processing_terminal_id: "1234001",
  subscription_id: "SubRef7654",
  idempotency_key: "8e03978e-40d5-43e8-bc93-6894a57f9324",
  request: []
)

```

```csharp Update subscription: copy
using Payroc;
using System.Threading.Tasks;
using Payroc.RepeatPayments.Subscriptions;
using System.Collections.Generic;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayrocClient();

        await client.RepeatPayments.Subscriptions.PartiallyUpdateAsync(
            new PartiallyUpdateSubscriptionsRequest {
                ProcessingTerminalId = "1234001",
                SubscriptionId = "SubRef7654",
                IdempotencyKey = "8e03978e-40d5-43e8-bc93-6894a57f9324",
                Body = new List<PatchDocument>(){
                    new PatchDocument(
                        new PatchCopy {
                            From = "/name",
                            Path = "/description"
                        }
                    ),
                }

            }
        );
    }

}

```

```go Update subscription: copy
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654"

	payload := strings.NewReader("[\n  {\n    \"op\": \"copy\",\n    \"from\": \"/name\",\n    \"path\": \"/description\"\n  }\n]")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Update subscription: copy
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654', [
  'body' => '[
  {
    "op": "copy",
    "from": "/name",
    "path": "/description"
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

echo $response->getBody();
```

```swift Update subscription: copy
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "op": "copy",
    "from": "/name",
    "path": "/description"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update subscription: test



**Request**

```json
[
  {
    "op": "add",
    "path": "/length",
    "value": null
  }
]
```

**Response**

```json
{
  "subscriptionId": "SubRef7654",
  "processingTerminalId": "1234001",
  "paymentPlan": {
    "paymentPlanId": "PlanRef8765",
    "name": "Monthly Premium Club subscription",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/payment-plans/PlanRef8765"
    }
  },
  "secureToken": {
    "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
    "customerName": "Sarah Hazel Hopper",
    "token": "296753123456",
    "status": "notValidated",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
    }
  },
  "name": "Premium Club",
  "currency": "USD",
  "currentState": {
    "status": "active",
    "paidInvoices": 0,
    "nextDueDate": "2024-08-02",
    "outstandingInvoices": 3
  },
  "startDate": "2024-07-02",
  "type": "automatic",
  "frequency": "monthly",
  "description": "Premium Club subscription",
  "setupOrder": {
    "orderId": "OrderRef6543",
    "amount": 4999,
    "description": "Initial setup fee for Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "recurringOrder": {
    "amount": 4999,
    "description": "Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "endDate": "2025-07-01",
  "length": 12,
  "pauseCollectionFor": 0,
  "customFields": [
    {
      "name": "yourCustomField",
      "value": "abc123"
    }
  ]
}
```

**SDK Code**

```typescript Update subscription: test
import { PayrocClient } from "payroc";

async function main() {
    const client = new PayrocClient();
    await client.repeatPayments.subscriptions.partiallyUpdate("1234001", "SubRef7654", {
        idempotencyKey: "8e03978e-40d5-43e8-bc93-6894a57f9324",
        body: [
            {
                op: "add",
                path: "/length",
            },
        ],
    });
}
main();

```

```python Update subscription: test
from payroc import Payroc, PatchDocument_Add

client = Payroc()

client.repeat_payments.subscriptions.partially_update(
    processing_terminal_id="1234001",
    subscription_id="SubRef7654",
    idempotency_key="8e03978e-40d5-43e8-bc93-6894a57f9324",
    request=[
        PatchDocument_Add(
            path="/length",
        )
    ],
)

```

```java Update subscription: test
package com.example.usage;

import com.payroc.api.PayrocApiClient;
import com.payroc.api.resources.repeatpayments.subscriptions.requests.PartiallyUpdateSubscriptionsRequest;
import com.payroc.api.types.PatchAdd;
import com.payroc.api.types.PatchDocument;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        PayrocApiClient client = PayrocApiClient
            .builder()
            .build();

        client.repeatPayments().subscriptions().partiallyUpdate(
            "1234001",
            "SubRef7654",
            PartiallyUpdateSubscriptionsRequest
                .builder()
                .idempotencyKey("8e03978e-40d5-43e8-bc93-6894a57f9324")
                .body(
                    Arrays.asList(
                        PatchDocument.add(
                            PatchAdd
                                .builder()
                                .path("/length")
                                .build()
                        )
                    )
                )
                .build()
        );
    }
}
```

```ruby Update subscription: test
require "payroc"

client = Payroc::Client.new

client.repeat_payments.subscriptions.partially_update(
  processing_terminal_id: "1234001",
  subscription_id: "SubRef7654",
  idempotency_key: "8e03978e-40d5-43e8-bc93-6894a57f9324",
  request: []
)

```

```csharp Update subscription: test
using Payroc;
using System.Threading.Tasks;
using Payroc.RepeatPayments.Subscriptions;
using System.Collections.Generic;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayrocClient();

        await client.RepeatPayments.Subscriptions.PartiallyUpdateAsync(
            new PartiallyUpdateSubscriptionsRequest {
                ProcessingTerminalId = "1234001",
                SubscriptionId = "SubRef7654",
                IdempotencyKey = "8e03978e-40d5-43e8-bc93-6894a57f9324",
                Body = new List<PatchDocument>(){
                    new PatchDocument(
                        new PatchAdd {
                            Path = "/length"
                        }
                    ),
                }

            }
        );
    }

}

```

```go Update subscription: test
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654"

	payload := strings.NewReader("[\n  {\n    \"op\": \"add\",\n    \"path\": \"/length\",\n    \"value\": null\n  }\n]")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Update subscription: test
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654', [
  'body' => '[
  {
    "op": "add",
    "path": "/length",
    "value": null
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

echo $response->getBody();
```

```swift Update subscription: test
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "op": "add",
    "path": "/length",
    "value": 
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Example patch operations that apply the RFC 6902 standard



**Request**

```json
[
  {
    "op": "add",
    "path": "/a/b/c",
    "value": null
  },
  {
    "op": "remove",
    "path": "/a/b/c"
  },
  {
    "op": "add",
    "path": "/a/b/c",
    "value": null
  },
  {
    "op": "move",
    "from": "/a/b/c",
    "path": "/a/b/d"
  },
  {
    "op": "copy",
    "from": "/a/b/d",
    "path": "/a/b/e"
  },
  {
    "op": "add",
    "path": "/a/b/c",
    "value": null
  }
]
```

**Response**

```json
{
  "subscriptionId": "SubRef7654",
  "processingTerminalId": "1234001",
  "paymentPlan": {
    "paymentPlanId": "PlanRef8765",
    "name": "Monthly Premium Club subscription",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/payment-plans/PlanRef8765"
    }
  },
  "secureToken": {
    "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
    "customerName": "Sarah Hazel Hopper",
    "token": "296753123456",
    "status": "notValidated",
    "link": {
      "rel": "self",
      "method": "GET",
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
    }
  },
  "name": "Premium Club",
  "currency": "USD",
  "currentState": {
    "status": "active",
    "paidInvoices": 0,
    "nextDueDate": "2024-08-02",
    "outstandingInvoices": 3
  },
  "startDate": "2024-07-02",
  "type": "automatic",
  "frequency": "monthly",
  "description": "Premium Club subscription",
  "setupOrder": {
    "orderId": "OrderRef6543",
    "amount": 4999,
    "description": "Initial setup fee for Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "recurringOrder": {
    "amount": 4999,
    "description": "Premium Club subscription",
    "breakdown": {
      "subtotal": 4347,
      "surcharge": {
        "amount": 217,
        "percentage": 5
      },
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    }
  },
  "endDate": "2025-07-01",
  "length": 12,
  "pauseCollectionFor": 0,
  "customFields": [
    {
      "name": "yourCustomField",
      "value": "abc123"
    }
  ]
}
```

**SDK Code**

```typescript Example patch operations that apply the RFC 6902 standard
import { PayrocClient } from "payroc";

async function main() {
    const client = new PayrocClient();
    await client.repeatPayments.subscriptions.partiallyUpdate("1234001", "SubRef7654", {
        idempotencyKey: "8e03978e-40d5-43e8-bc93-6894a57f9324",
        body: [
            {
                op: "add",
                path: "/a/b/c",
            },
            {
                op: "remove",
                path: "/a/b/c",
            },
            {
                op: "add",
                path: "/a/b/c",
            },
            {
                op: "move",
                from: "/a/b/c",
                path: "/a/b/d",
            },
            {
                op: "copy",
                from: "/a/b/d",
                path: "/a/b/e",
            },
            {
                op: "add",
                path: "/a/b/c",
            },
        ],
    });
}
main();

```

```python Example patch operations that apply the RFC 6902 standard
from payroc import Payroc, PatchDocument_Add, PatchDocument_Remove, PatchDocument_Move, PatchDocument_Copy

client = Payroc()

client.repeat_payments.subscriptions.partially_update(
    processing_terminal_id="1234001",
    subscription_id="SubRef7654",
    idempotency_key="8e03978e-40d5-43e8-bc93-6894a57f9324",
    request=[
        PatchDocument_Add(
            path="/a/b/c",
        ),
        PatchDocument_Remove(
            path="/a/b/c",
        ),
        PatchDocument_Add(
            path="/a/b/c",
        ),
        PatchDocument_Move(
            from_="/a/b/c",
            path="/a/b/d",
        ),
        PatchDocument_Copy(
            from_="/a/b/d",
            path="/a/b/e",
        ),
        PatchDocument_Add(
            path="/a/b/c",
        )
    ],
)

```

```java Example patch operations that apply the RFC 6902 standard
package com.example.usage;

import com.payroc.api.PayrocApiClient;
import com.payroc.api.resources.repeatpayments.subscriptions.requests.PartiallyUpdateSubscriptionsRequest;
import com.payroc.api.types.PatchAdd;
import com.payroc.api.types.PatchCopy;
import com.payroc.api.types.PatchDocument;
import com.payroc.api.types.PatchMove;
import com.payroc.api.types.PatchRemove;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        PayrocApiClient client = PayrocApiClient
            .builder()
            .build();

        client.repeatPayments().subscriptions().partiallyUpdate(
            "1234001",
            "SubRef7654",
            PartiallyUpdateSubscriptionsRequest
                .builder()
                .idempotencyKey("8e03978e-40d5-43e8-bc93-6894a57f9324")
                .body(
                    Arrays.asList(
                        PatchDocument.add(
                            PatchAdd
                                .builder()
                                .path("/a/b/c")
                                .build()
                        ),
                        PatchDocument.remove(
                            PatchRemove
                                .builder()
                                .path("/a/b/c")
                                .build()
                        ),
                        PatchDocument.add(
                            PatchAdd
                                .builder()
                                .path("/a/b/c")
                                .build()
                        ),
                        PatchDocument.move(
                            PatchMove
                                .builder()
                                .from("/a/b/c")
                                .path("/a/b/d")
                                .build()
                        ),
                        PatchDocument.copy(
                            PatchCopy
                                .builder()
                                .from("/a/b/d")
                                .path("/a/b/e")
                                .build()
                        ),
                        PatchDocument.add(
                            PatchAdd
                                .builder()
                                .path("/a/b/c")
                                .build()
                        )
                    )
                )
                .build()
        );
    }
}
```

```ruby Example patch operations that apply the RFC 6902 standard
require "payroc"

client = Payroc::Client.new

client.repeat_payments.subscriptions.partially_update(
  processing_terminal_id: "1234001",
  subscription_id: "SubRef7654",
  idempotency_key: "8e03978e-40d5-43e8-bc93-6894a57f9324",
  request: []
)

```

```csharp Example patch operations that apply the RFC 6902 standard
using Payroc;
using System.Threading.Tasks;
using Payroc.RepeatPayments.Subscriptions;
using System.Collections.Generic;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayrocClient();

        await client.RepeatPayments.Subscriptions.PartiallyUpdateAsync(
            new PartiallyUpdateSubscriptionsRequest {
                ProcessingTerminalId = "1234001",
                SubscriptionId = "SubRef7654",
                IdempotencyKey = "8e03978e-40d5-43e8-bc93-6894a57f9324",
                Body = new List<PatchDocument>(){
                    new PatchDocument(
                        new PatchAdd {
                            Path = "/a/b/c"
                        }
                    ),
                    new PatchDocument(
                        new PatchRemove {
                            Path = "/a/b/c"
                        }
                    ),
                    new PatchDocument(
                        new PatchAdd {
                            Path = "/a/b/c"
                        }
                    ),
                    new PatchDocument(
                        new PatchMove {
                            From = "/a/b/c",
                            Path = "/a/b/d"
                        }
                    ),
                    new PatchDocument(
                        new PatchCopy {
                            From = "/a/b/d",
                            Path = "/a/b/e"
                        }
                    ),
                    new PatchDocument(
                        new PatchAdd {
                            Path = "/a/b/c"
                        }
                    ),
                }

            }
        );
    }

}

```

```go Example patch operations that apply the RFC 6902 standard
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654"

	payload := strings.NewReader("[\n  {\n    \"op\": \"add\",\n    \"path\": \"/a/b/c\",\n    \"value\": null\n  },\n  {\n    \"op\": \"remove\",\n    \"path\": \"/a/b/c\"\n  },\n  {\n    \"op\": \"add\",\n    \"path\": \"/a/b/c\",\n    \"value\": null\n  },\n  {\n    \"op\": \"move\",\n    \"from\": \"/a/b/c\",\n    \"path\": \"/a/b/d\"\n  },\n  {\n    \"op\": \"copy\",\n    \"from\": \"/a/b/d\",\n    \"path\": \"/a/b/e\"\n  },\n  {\n    \"op\": \"add\",\n    \"path\": \"/a/b/c\",\n    \"value\": null\n  }\n]")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Example patch operations that apply the RFC 6902 standard
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654', [
  'body' => '[
  {
    "op": "add",
    "path": "/a/b/c",
    "value": null
  },
  {
    "op": "remove",
    "path": "/a/b/c"
  },
  {
    "op": "add",
    "path": "/a/b/c",
    "value": null
  },
  {
    "op": "move",
    "from": "/a/b/c",
    "path": "/a/b/d"
  },
  {
    "op": "copy",
    "from": "/a/b/d",
    "path": "/a/b/e"
  },
  {
    "op": "add",
    "path": "/a/b/c",
    "value": null
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

echo $response->getBody();
```

```swift Example patch operations that apply the RFC 6902 standard
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "op": "add",
    "path": "/a/b/c",
    "value": 
  ],
  [
    "op": "remove",
    "path": "/a/b/c"
  ],
  [
    "op": "add",
    "path": "/a/b/c",
    "value": 
  ],
  [
    "op": "move",
    "from": "/a/b/c",
    "path": "/a/b/d"
  ],
  [
    "op": "copy",
    "from": "/a/b/d",
    "path": "/a/b/e"
  ],
  [
    "op": "add",
    "path": "/a/b/c",
    "value": 
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/processing-terminals/1234001/subscriptions/SubRef7654")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```