# Patch subscription

## Patch subscription

> Patch subscription

```json
{"openapi":"3.1.1","info":{"title":"convergegate.com API","version":"1.0.76"},"tags":[{"name":"Subscriptions","description":"Subscriptions API"}],"servers":[{"url":"https://engine-sandbox.convergegate.com","description":"Sandbox"},{"url":"https://engine.convergegate.com","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","description":"The client sends HTTP requests with the Authorization header that contains the word Bearer followed by a space and the Shop Api Key.","scheme":"bearer"}},"schemas":{"SubscriptionPatchRequest":{"type":"object","properties":{"state":{"type":"string","description":"New subscription state","enum":["CANCELLED"]}}},"SubscriptionResponse":{"type":"object","properties":{"timestamp":{"type":"string","format":"ISO 8601"},"status":{"type":"integer","description":"HTTP status code"},"result":{"$ref":"#/components/schemas/Subscription"}}},"Subscription":{"type":"object","properties":{"id":{"maxLength":32,"type":"string","description":"Subscription Id"},"customerReferenceId":{"maxLength":128,"type":"string","description":"Id of the customer from initial payment"},"description":{"maxLength":512,"type":"string","description":"Description for subsequent recurring payments"},"amount":{"type":"number","description":"The amount to be used for subsequent payments"},"currency":{"type":"string","description":"Payment currency","format":"ISO 4217 code for FIAT currencies or cryptocurrency symbol"},"createTime":{"type":"string","format":"ISO 8601 (YYYY-MM-DD'T'HH24:MI:SS)","description":"Date and time the subscription was created"},"startTime":{"type":"string","format":"ISO 8601 (YYYY-MM-DD'T'HH24:MI:SS)","description":"Date and time of the 1st cycle"},"frequency":{"type":"integer","minimum":1,"description":"The number of intervals after which a subscriber is billed. For example, if the frequencyUnit is DAY with an frequency of 2, the subscription is billed once every two days."},"frequencyUnit":{"type":"string","description":"The interval at which the subscription is billed. Use 'MINUTE' for testing purposes only.","enum":["MINUTE","DAY","WEEK","MONTH"]},"requestedNumberOfCycles":{"type":"integer","minimum":1,"description":"Required number of subsequent recurring payments. Unlimited if value is not specified."},"state":{"type":"string","description":"Subscription state","enum":["ACTIVE","CANCELLED","COMPLETED"]},"recurringToken":{"type":"string","description":"Token that is used to continue the recurring chain"},"retryStrategy":{"$ref":"#/components/schemas/SubscriptionRetryStrategy"},"cycles":{"type":"array","description":"List of payments automatically generated for this subscription","items":{"$ref":"#/components/schemas/SubscriptionCycle"}}}},"SubscriptionRetryStrategy":{"required":["frequency","numberOfCycles"],"type":"object","properties":{"frequency":{"type":"integer","minimum":1,"description":"The number of intervals after which the system will retry the payment after an unsuccessful attempt"},"frequencyUnit":{"type":"string","description":"The interval at which the subscription is retried. Use 'MINUTE' for testing purposes only.","enum":["MINUTE","DAY","WEEK","MONTH"]},"numberOfCycles":{"type":"integer","minimum":1,"description":"Required number of retries"},"amountAdjustments":{"type":"array","description":"If specified, the nth element contains the percentage of the initial amount that will be charged for the nth retry","items":{"type":"integer","minimum":1}}},"description":"Retry strategy for subscription. If not specified, the subscription is canceled after the first failed payment attempt."},"SubscriptionCycle":{"type":"object","properties":{"sequence":{"type":"integer","description":"Sequence number of the cycle"},"type":{"type":"string","description":"Cycle type","enum":["REGULAR","RETRY"]},"startTime":{"type":"string","format":"ISO 8601 (YYYY-MM-DD'T'HH24:MI:SS)","description":"Date and time when this cycle was supposed to be created according to the schedule"},"paymentId":{"type":"string","description":"Payment Id"},"paymentState":{"$ref":"#/components/schemas/PaymentState"},"amount":{"type":"number","description":"Payment amount"}}},"PaymentState":{"type":"string","description":"Payment State","enum":["CHECKOUT","PENDING","AUTHORIZED","CANCELLED","DECLINED","COMPLETED"]},"BadRequestError":{"type":"object","properties":{"timestamp":{"type":"string","format":"ISO 8601"},"status":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"codes":{"type":"array","items":{"type":"string"}},"arguments":{"type":"array","items":{"type":"object","properties":{"codes":{"type":"array","items":{"type":"string"}},"defaultMessage":{"type":"string"}}}},"defaultMessage":{"type":"string"},"objectName":{"type":"string"},"field":{"type":"string"},"bindingFailure":{"type":"boolean"}}}},"path":{"type":"string"}}},"UnauthorizedError":{"type":"object","properties":{"status":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"},"timestamp":{"type":"string","format":"ISO 8601"},"path":{"type":"string"}}},"NotFoundError":{"type":"object","properties":{"status":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"},"timestamp":{"type":"string","format":"ISO 8601"},"path":{"type":"string"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"NotFound":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}}}},"paths":{"/api/v1/subscriptions/{id}":{"patch":{"tags":["Subscriptions"],"summary":"Patch subscription","description":"Patch subscription","operationId":"patchSubscription","parameters":[{"name":"id","in":"path","description":"Subscription Id","required":true,"schema":{"pattern":"/[a-zA-Z0-9]{32}/","type":"string"}}],"requestBody":{"description":"Subscription patch request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPatchRequest"}}},"required":true},"responses":{"200":{"description":"Subscription Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.convergegate.com/v1/subscriptions/patch-subscription.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
