Skip to main content
PUT
/
api
/
external
/
v2
/
subscription-contracts-update-frequency-by-selling-plan
Update Subscription contract frequency by selling plan
curl --request PUT \
  --url https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-update-frequency-by-selling-plan \
  --header 'X-API-Key: <x-api-key>'
import requests

url = "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-update-frequency-by-selling-plan"

headers = {"X-API-Key": "<x-api-key>"}

response = requests.put(url, headers=headers)

print(response.text)
const options = {method: 'PUT', headers: {'X-API-Key': '<x-api-key>'}};

fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-update-frequency-by-selling-plan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-update-frequency-by-selling-plan';
const options = {method: 'PUT', headers: {'X-API-Key': '<x-api-key>'}};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-update-frequency-by-selling-plan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-update-frequency-by-selling-plan"

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

req.Header.Add("X-API-Key", "<x-api-key>")

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

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

fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-update-frequency-by-selling-plan")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<x-api-key>'

response = http.request(request)
puts response.read_body
{
  "billingPolicy": {
    "anchors": [],
    "interval": "DAY",
    "intervalCount": 5,
    "maxCycles": 6,
    "minCycles": 3
  },
  "customer": {
    "displayName": "abc xyz",
    "email": "abc@gmail.com",
    "firstName": "abc",
    "id": "gid://shopify/Customer/111111111111",
    "lastName": "xyz"
  },
  "customerPaymentMethod": {
    "id": "gid://shopify/CustomerPaymentMethod/1111111111111111111",
    "instrument": {
      "brand": "bogus",
      "expiryMonth": 12,
      "expiryYear": 2030,
      "lastDigits": "1",
      "name": "abc xyz"
    }
  },
  "deliveryMethod": {
    "address": {
      "address1": "test",
      "city": "Sunnyvale",
      "country": "United States",
      "province": "California",
      "zip": "94087"
    }
  },
  "deliveryPolicy": {
    "anchors": [],
    "interval": "DAY",
    "intervalCount": 5
  },
  "id": "gid://shopify/SubscriptionContract/123456789",
  "lines": {
    "edges": [
      {
        "node": {
          "currentPrice": {
            "amount": "154.0",
            "currencyCode": "USD"
          },
          "id": "gid://shopify/SubscriptionLine/49e73332-5dfc-4fba-9ee7-111111111",
          "lineDiscountedPrice": {
            "amount": "154.0",
            "currencyCode": "USD"
          },
          "productId": "gid://shopify/Product/1111111111",
          "quantity": 1,
          "sellingPlanId": "gid://shopify/SellingPlan/691881211111",
          "sellingPlanName": "4 Monthly Subscription",
          "taxable": true,
          "title": "Blub Indoor",
          "variantId": "gid://shopify/ProductVariant/111111111111",
          "variantImage": {
            "transformedSrc": "https://cdn.shopify.com/s/files/1/0933/4738/1543/files/shopping_41111111111111111111111111111111111"
          }
        }
      }
    ]
  },
  "nextBillingDate": "2025-08-08T13:00:00Z",
  "status": "ACTIVE"
}

Headers

X-API-Key
string
required

API Key for authentication

Query Parameters

contractId
integer<int64>
required

Subscription contract ID to update. Provide the numeric ID without the gid:// prefix

Required range: x >= 1
sellingPlanId
integer<int64>
required

The unique identifier of the new selling plan. Provide the numeric ID without gid:// prefix.

Required range: x >= 1

Response

Subscription contract frequency updated successfully

billingAttempts
object
billingPolicy
object
createdAt
object
customAttributes
object[]
customer
object
customerPaymentMethod
object
deliveryMethod
object
deliveryPolicy
object
deliveryPrice
object
discounts
object
get__typename
string
id
string
lastPaymentStatus
enum<string>
Available options:
SUCCEEDED,
FAILED,
$UNKNOWN
lines
object
nextBillingDate
object
note
string
originOrder
object
status
enum<string>
Available options:
ACTIVE,
PAUSED,
CANCELLED,
EXPIRED,
FAILED,
$UNKNOWN
updatedAt
object