Subscription Contracts
Replace contract variants in bulk (v2)
POST
/
subscriptions
/
cp
/
api
/
subscription-contract-details
/
replace-variants-v2
Replace contract variants in bulk (v2)
curl --request POST \
--url https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2import requests
url = "https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2';
const options = {method: 'POST'};
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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2"
req, _ := http.NewRequest("POST", url, nil)
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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"billingAttempts": {
"get__typename": "<string>",
"nodes": [
{
"completedAt": {},
"createdAt": {},
"get__typename": "<string>",
"id": "<string>",
"idempotencyKey": "<string>",
"ready": true
}
]
},
"billingPolicy": {
"anchors": [
{
"cutoffDay": 123,
"day": 123,
"get__typename": "<string>",
"month": 123
}
],
"get__typename": "<string>",
"intervalCount": 123,
"maxCycles": 123,
"minCycles": 123
},
"createdAt": {},
"customAttributes": [
{
"get__typename": "<string>",
"key": "<string>",
"value": "<string>"
}
],
"customer": {
"displayName": "<string>",
"email": "<string>",
"firstName": "<string>",
"get__typename": "<string>",
"id": "<string>",
"lastName": "<string>",
"phone": "<string>"
},
"customerPaymentMethod": {
"get__typename": "<string>",
"id": "<string>",
"instrument": {
"get__typename": "<string>"
},
"revokedAt": {}
},
"deliveryMethod": {
"get__typename": "<string>"
},
"deliveryPolicy": {
"anchors": [
{
"cutoffDay": 123,
"day": 123,
"get__typename": "<string>",
"month": 123
}
],
"get__typename": "<string>",
"intervalCount": 123
},
"deliveryPrice": {
"amount": {},
"get__typename": "<string>"
},
"discounts": {
"get__typename": "<string>",
"nodes": [
{
"get__typename": "<string>",
"id": "<string>",
"recurringCycleLimit": 123,
"title": "<string>",
"usageCount": 123,
"value": {
"get__typename": "<string>"
}
}
],
"pageInfo": {
"endCursor": "<string>",
"get__typename": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
},
"get__typename": "<string>",
"id": "<string>",
"lines": {
"get__typename": "<string>",
"nodes": [
{
"currentPrice": {
"amount": {},
"get__typename": "<string>"
},
"customAttributes": [
{
"get__typename": "<string>",
"key": "<string>",
"value": "<string>"
}
],
"discountAllocations": [
{
"amount": {
"amount": {},
"get__typename": "<string>"
},
"discount": {
"get__typename": "<string>"
},
"get__typename": "<string>"
}
],
"get__typename": "<string>",
"id": "<string>",
"lineDiscountedPrice": {
"amount": {},
"get__typename": "<string>"
},
"pricingPolicy": {
"basePrice": {
"amount": {},
"get__typename": "<string>"
},
"cycleDiscounts": [
{
"adjustmentValue": {
"get__typename": "<string>"
},
"afterCycle": 123,
"computedPrice": {
"amount": {},
"get__typename": "<string>"
},
"get__typename": "<string>"
}
],
"get__typename": "<string>"
},
"productId": "<string>",
"quantity": 123,
"sellingPlanId": "<string>",
"sellingPlanName": "<string>",
"sku": "<string>",
"taxable": true,
"title": "<string>",
"variantId": "<string>",
"variantImage": {
"get__typename": "<string>",
"url": {}
},
"variantTitle": "<string>"
}
],
"pageInfo": {
"endCursor": "<string>",
"get__typename": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
},
"nextBillingDate": {},
"note": "<string>",
"originOrder": {
"fulfillmentOrders": {
"get__typename": "<string>",
"nodes": [
{
"fulfillAt": {},
"get__typename": "<string>",
"id": "<string>"
}
],
"pageInfo": {
"endCursor": "<string>",
"get__typename": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
},
"get__typename": "<string>",
"id": "<string>",
"name": "<string>"
},
"updatedAt": {}
}Query Parameters
Response
200 - */*
OK
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
SUCCEEDED, FAILED, $UNKNOWN Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
ACTIVE, PAUSED, CANCELLED, EXPIRED, FAILED, $UNKNOWN Merge an existing contract into another
Previous
Get current customer's saved Shopify payment methods
Next
⌘I
Replace contract variants in bulk (v2)
curl --request POST \
--url https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2import requests
url = "https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2';
const options = {method: 'POST'};
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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2"
req, _ := http.NewRequest("POST", url, nil)
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://www.myshop.com/apps/subscriptions/cp/api/subscription-contract-details/replace-variants-v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"billingAttempts": {
"get__typename": "<string>",
"nodes": [
{
"completedAt": {},
"createdAt": {},
"get__typename": "<string>",
"id": "<string>",
"idempotencyKey": "<string>",
"ready": true
}
]
},
"billingPolicy": {
"anchors": [
{
"cutoffDay": 123,
"day": 123,
"get__typename": "<string>",
"month": 123
}
],
"get__typename": "<string>",
"intervalCount": 123,
"maxCycles": 123,
"minCycles": 123
},
"createdAt": {},
"customAttributes": [
{
"get__typename": "<string>",
"key": "<string>",
"value": "<string>"
}
],
"customer": {
"displayName": "<string>",
"email": "<string>",
"firstName": "<string>",
"get__typename": "<string>",
"id": "<string>",
"lastName": "<string>",
"phone": "<string>"
},
"customerPaymentMethod": {
"get__typename": "<string>",
"id": "<string>",
"instrument": {
"get__typename": "<string>"
},
"revokedAt": {}
},
"deliveryMethod": {
"get__typename": "<string>"
},
"deliveryPolicy": {
"anchors": [
{
"cutoffDay": 123,
"day": 123,
"get__typename": "<string>",
"month": 123
}
],
"get__typename": "<string>",
"intervalCount": 123
},
"deliveryPrice": {
"amount": {},
"get__typename": "<string>"
},
"discounts": {
"get__typename": "<string>",
"nodes": [
{
"get__typename": "<string>",
"id": "<string>",
"recurringCycleLimit": 123,
"title": "<string>",
"usageCount": 123,
"value": {
"get__typename": "<string>"
}
}
],
"pageInfo": {
"endCursor": "<string>",
"get__typename": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
},
"get__typename": "<string>",
"id": "<string>",
"lines": {
"get__typename": "<string>",
"nodes": [
{
"currentPrice": {
"amount": {},
"get__typename": "<string>"
},
"customAttributes": [
{
"get__typename": "<string>",
"key": "<string>",
"value": "<string>"
}
],
"discountAllocations": [
{
"amount": {
"amount": {},
"get__typename": "<string>"
},
"discount": {
"get__typename": "<string>"
},
"get__typename": "<string>"
}
],
"get__typename": "<string>",
"id": "<string>",
"lineDiscountedPrice": {
"amount": {},
"get__typename": "<string>"
},
"pricingPolicy": {
"basePrice": {
"amount": {},
"get__typename": "<string>"
},
"cycleDiscounts": [
{
"adjustmentValue": {
"get__typename": "<string>"
},
"afterCycle": 123,
"computedPrice": {
"amount": {},
"get__typename": "<string>"
},
"get__typename": "<string>"
}
],
"get__typename": "<string>"
},
"productId": "<string>",
"quantity": 123,
"sellingPlanId": "<string>",
"sellingPlanName": "<string>",
"sku": "<string>",
"taxable": true,
"title": "<string>",
"variantId": "<string>",
"variantImage": {
"get__typename": "<string>",
"url": {}
},
"variantTitle": "<string>"
}
],
"pageInfo": {
"endCursor": "<string>",
"get__typename": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
},
"nextBillingDate": {},
"note": "<string>",
"originOrder": {
"fulfillmentOrders": {
"get__typename": "<string>",
"nodes": [
{
"fulfillAt": {},
"get__typename": "<string>",
"id": "<string>"
}
],
"pageInfo": {
"endCursor": "<string>",
"get__typename": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
},
"get__typename": "<string>",
"id": "<string>",
"name": "<string>"
},
"updatedAt": {}
}