# 2. Edit Repeatedly

## Edit Recurring Payment

<mark style="color:orange;">`PUT`</mark> `{{Base Adres}}/api/paywall/recurring`

{% hint style="info" %}
**Important**: In order to use the Edit Recurring Payment service, you need to send the '**apikeypublic**' and '**apiclientpublic**' parameters in the 'Header' field.

\
[<mark style="color:green;">**PaymentAPI Address**</mark>](https://developer.paywall.one/payment-orchestration-integration-document/environment)
{% endhint %}

<table><thead><tr><th width="162">Parameter</th><th width="79">Type</th><th width="127">Compulsory</th><th width="403"> Description</th></tr></thead><tbody><tr><td>apikeypublic</td><td>string</td><td>Yes</td><td>The Public Key obtained from the merchant panel.</td></tr><tr><td>apiclientpublic</td><td>string</td><td>Yes</td><td>The Public Client obtained from the merchant panel.</td></tr></tbody></table>

**The parameters that need to be sent to the service are as follows:**

<table><thead><tr><th width="270">Parameter</th><th width="112">Type</th><th width="144">Compulsory</th><th width="336">Description</th></tr></thead><tbody><tr><td>SubscriptionMerchantCode</td><td>string</td><td>Yes</td><td><p>The unique tracking number provided by you for the recurring payment.</p><p><br><mark style="color:blue;">It must be the same as the one used during creation</mark></p></td></tr><tr><td>SubscriptionType</td><td>int</td><td>Yes</td><td>Membership type. Currently, only 1 is supported.<br><br><a href="../system-data"><mark style="color:red;">You can track it from the system data</mark></a></td></tr><tr><td>CurrencyId</td><td>int</td><td>Yes</td><td>Currency</td></tr><tr><td>Amount</td><td>decimal</td><td>Yes</td><td>Recurring payment amount. The amount to be deducted from the card each time.</td></tr><tr><td>CallbackUrl</td><td>string</td><td>Yes</td><td>The address where payment results will be POSTed.<br><br>See. <a href="broken-reference"><strong>Post Body</strong></a></td></tr><tr><td>HasTrial</td><td>bool</td><td>Yes</td><td>Is there a trial period applied to the membership?</td></tr><tr><td>TrialDay</td><td>int</td><td>Yes</td><td>The number of days for the trial period applied to the membership. If the payment was created on 02/07 in a monthly period and there is a 10-day trial period, the first payment will be collected on 12/08.</td></tr><tr><td>RecurringPeriodType</td><td>int</td><td>Yes</td><td><p>The type of recurring period for the payment.</p><p><br><a href="../system-data"><mark style="color:red;">You can track it from the system data</mark></a></p></td></tr><tr><td>FailAttempt</td><td>int</td><td>Yes</td><td>The number of retries in case of payment failure. <mark style="color:red;">Max: 5</mark></td></tr><tr><td>FailAttemptPendingHour</td><td>int</td><td>Yes</td><td>The time zone Paywall will wait between retries for failed payments. <mark style="color:red;">Max: 24</mark></td></tr><tr><td><strong>Items</strong>:Type</td><td>int</td><td>Yes</td><td>The type of sale subject to payment.<br><br><a href="../system-data"><mark style="color:red;">Sistem verilerinden takip edebilirsiniz</mark></a></td></tr><tr><td><strong>Items</strong>:Name</td><td>string</td><td>Yes</td><td>The name of the sale subject to payment.</td></tr><tr><td><strong>Items</strong>:Amount</td><td>decimal</td><td>Yes</td><td><p>The amount of the sale subject to payment.</p><p><br><mark style="color:red;">Items The Itmes object is an array, and the amount information of the entered items should be equal to the total amount</mark></p></td></tr></tbody></table>

**Sample to be sent for service&#x20;**<mark style="color:green;">**JSON**</mark>**&#x20;and&#x20;**<mark style="color:green;">**example codes**</mark>**&#x20;Sample to be sent for service**

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json5
{
    "SubscriptionMerchantCode": "65FSDOMBNA59DA5ASGHD",
    "SubscriptionType": 1,
    "CurrencyId": 2,
    "Amount": 12,
    "CallbackUrl": "https://webhook.site/8d70cb8e-fe1b-478b-8ee3-823870549ef2",
    "HasTrial": true,
    "TrialDay": 1,
    "RecurringPeriodType": 4,
    "FailAttempt": 1,
    "FailAttemptPendingHour": 2,
    // If there is no change in the Items parameter, creation will proceed.
    // It must be the same as what you sent immediately.
    "Items": [
        {
            "Type": 1,
            "Name": "Gold Package",
            "Amount": 12
        }
    ]
}
```

{% endcode %}
{% endtab %}

{% tab title="C#" %}

```csharp
// Soon
```

{% endtab %}

{% tab title="GO" %}

```go
// Soon
```

{% endtab %}

{% tab title="Java" %}

```java
// Soon
```

{% endtab %}

{% tab title="PHP" %}

```php
// Soon
```

{% endtab %}

{% tab title="Python" %}

```python
// Soon
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
// Soon
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
// Soon
```

{% endtab %}

{% tab title="Curl" %}

```sh
// Soon
```

{% endtab %}
{% endtabs %}

**The parameters returned from the service are as follows:**

<table><thead><tr><th width="189">Parameter</th><th width="100.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>ErrorCode</td><td>int</td><td>Error code. Returns '0' if the operation is successful.</td></tr><tr><td>Result</td><td>bool</td><td>It returns a True or False value. If the operation is successful, it returns 'true'.</td></tr><tr><td>Message</td><td>string</td><td>If the operation fails, this is the specified error message.</td></tr><tr><td>Body</td><td>object</td><td>No details are returned.</td></tr></tbody></table>

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json
{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": null
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
