Membership Contracts
Update shipping address
Updates the shipping/delivery address for a membership contract from the customer portal.
PUT
/
memberships
/
cp
/
api
/
subscription-contracts-update-shipping-address
Update shipping address
curl --request PUT \
--url https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-update-shipping-address \
--header 'Content-Type: application/json' \
--data '
{
"address1": "123 Main St",
"address2": "Apt 4B",
"city": "New York",
"company": "Acme Inc",
"country": "United States",
"countryCode": "US",
"firstName": "John",
"lastName": "Doe",
"phone": "+1-555-123-4567",
"province": "New York",
"provinceCode": "NY",
"zip": "10001"
}
'import requests
url = "https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-update-shipping-address"
payload = {
"address1": "123 Main St",
"address2": "Apt 4B",
"city": "New York",
"company": "Acme Inc",
"country": "United States",
"countryCode": "US",
"firstName": "John",
"lastName": "Doe",
"phone": "+1-555-123-4567",
"province": "New York",
"provinceCode": "NY",
"zip": "10001"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
address1: '123 Main St',
address2: 'Apt 4B',
city: 'New York',
company: 'Acme Inc',
country: 'United States',
countryCode: 'US',
firstName: 'John',
lastName: 'Doe',
phone: '+1-555-123-4567',
province: 'New York',
provinceCode: 'NY',
zip: '10001'
})
};
fetch('https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-update-shipping-address', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-update-shipping-address';
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
address1: '123 Main St',
address2: 'Apt 4B',
city: 'New York',
company: 'Acme Inc',
country: 'United States',
countryCode: 'US',
firstName: 'John',
lastName: 'Doe',
phone: '+1-555-123-4567',
province: 'New York',
provinceCode: 'NY',
zip: '10001'
})
};
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/memberships/cp/api/subscription-contracts-update-shipping-address",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'address1' => '123 Main St',
'address2' => 'Apt 4B',
'city' => 'New York',
'company' => 'Acme Inc',
'country' => 'United States',
'countryCode' => 'US',
'firstName' => 'John',
'lastName' => 'Doe',
'phone' => '+1-555-123-4567',
'province' => 'New York',
'provinceCode' => 'NY',
'zip' => '10001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-update-shipping-address"
payload := strings.NewReader("{\n \"address1\": \"123 Main St\",\n \"address2\": \"Apt 4B\",\n \"city\": \"New York\",\n \"company\": \"Acme Inc\",\n \"country\": \"United States\",\n \"countryCode\": \"US\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"phone\": \"+1-555-123-4567\",\n \"province\": \"New York\",\n \"provinceCode\": \"NY\",\n \"zip\": \"10001\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
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/memberships/cp/api/subscription-contracts-update-shipping-address")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"address1\": \"123 Main St\",\n \"address2\": \"Apt 4B\",\n \"city\": \"New York\",\n \"company\": \"Acme Inc\",\n \"country\": \"United States\",\n \"countryCode\": \"US\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"phone\": \"+1-555-123-4567\",\n \"province\": \"New York\",\n \"provinceCode\": \"NY\",\n \"zip\": \"10001\"\n}"
response = http.request(request)
puts response.read_body{
"billingPolicy": {
"anchors": [
{
"cutoffDay": 123,
"day": 123,
"get__typename": "<string>",
"month": 123,
"type": "WEEKDAY"
}
],
"get__typename": "<string>",
"interval": "DAY",
"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": {},
"revokedReason": "AUTHORIZE_NET_GATEWAY_NOT_ENABLED"
},
"deliveryMethod": {
"get__typename": "<string>"
},
"deliveryPolicy": {
"anchors": [
{
"cutoffDay": 123,
"day": 123,
"get__typename": "<string>",
"month": 123,
"type": "WEEKDAY"
}
],
"get__typename": "<string>",
"interval": "DAY",
"intervalCount": 123
},
"deliveryPrice": {
"amount": {},
"currencyCode": "USD",
"get__typename": "<string>"
},
"discounts": {
"get__typename": "<string>",
"nodes": [
{
"get__typename": "<string>",
"id": "<string>",
"recurringCycleLimit": 123,
"rejectionReason": "NOT_FOUND",
"targetType": "LINE_ITEM",
"title": "<string>",
"type": "MANUAL",
"usageCount": 123,
"value": {
"get__typename": "<string>"
}
}
],
"pageInfo": {
"endCursor": "<string>",
"get__typename": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
},
"get__typename": "<string>",
"id": "<string>",
"lastPaymentStatus": "SUCCEEDED",
"lines": {
"get__typename": "<string>",
"nodes": [
{
"currentPrice": {
"amount": {},
"currencyCode": "USD",
"get__typename": "<string>"
},
"customAttributes": [
{
"get__typename": "<string>",
"key": "<string>",
"value": "<string>"
}
],
"discountAllocations": [
{
"amount": {
"amount": {},
"currencyCode": "USD",
"get__typename": "<string>"
},
"discount": {
"get__typename": "<string>"
},
"get__typename": "<string>"
}
],
"get__typename": "<string>",
"id": "<string>",
"lineDiscountedPrice": {
"amount": {},
"currencyCode": "USD",
"get__typename": "<string>"
},
"pricingPolicy": {
"basePrice": {
"amount": {},
"currencyCode": "USD",
"get__typename": "<string>"
},
"cycleDiscounts": [
{
"adjustmentType": "PERCENTAGE",
"adjustmentValue": {
"get__typename": "<string>"
},
"afterCycle": 123,
"computedPrice": {
"amount": {},
"currencyCode": "USD",
"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>",
"status": "OPEN"
}
],
"pageInfo": {
"endCursor": "<string>",
"get__typename": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
},
"get__typename": "<string>",
"id": "<string>",
"name": "<string>"
},
"revisionId": {},
"status": "ACTIVE",
"updatedAt": {}
}Body
application/json
Response
200 - */*
OK
⌘I
Update shipping address
curl --request PUT \
--url https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-update-shipping-address \
--header 'Content-Type: application/json' \
--data '
{
"address1": "123 Main St",
"address2": "Apt 4B",
"city": "New York",
"company": "Acme Inc",
"country": "United States",
"countryCode": "US",
"firstName": "John",
"lastName": "Doe",
"phone": "+1-555-123-4567",
"province": "New York",
"provinceCode": "NY",
"zip": "10001"
}
'import requests
url = "https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-update-shipping-address"
payload = {
"address1": "123 Main St",
"address2": "Apt 4B",
"city": "New York",
"company": "Acme Inc",
"country": "United States",
"countryCode": "US",
"firstName": "John",
"lastName": "Doe",
"phone": "+1-555-123-4567",
"province": "New York",
"provinceCode": "NY",
"zip": "10001"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
address1: '123 Main St',
address2: 'Apt 4B',
city: 'New York',
company: 'Acme Inc',
country: 'United States',
countryCode: 'US',
firstName: 'John',
lastName: 'Doe',
phone: '+1-555-123-4567',
province: 'New York',
provinceCode: 'NY',
zip: '10001'
})
};
fetch('https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-update-shipping-address', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-update-shipping-address';
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
address1: '123 Main St',
address2: 'Apt 4B',
city: 'New York',
company: 'Acme Inc',
country: 'United States',
countryCode: 'US',
firstName: 'John',
lastName: 'Doe',
phone: '+1-555-123-4567',
province: 'New York',
provinceCode: 'NY',
zip: '10001'
})
};
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/memberships/cp/api/subscription-contracts-update-shipping-address",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'address1' => '123 Main St',
'address2' => 'Apt 4B',
'city' => 'New York',
'company' => 'Acme Inc',
'country' => 'United States',
'countryCode' => 'US',
'firstName' => 'John',
'lastName' => 'Doe',
'phone' => '+1-555-123-4567',
'province' => 'New York',
'provinceCode' => 'NY',
'zip' => '10001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.myshop.com/apps/memberships/cp/api/subscription-contracts-update-shipping-address"
payload := strings.NewReader("{\n \"address1\": \"123 Main St\",\n \"address2\": \"Apt 4B\",\n \"city\": \"New York\",\n \"company\": \"Acme Inc\",\n \"country\": \"United States\",\n \"countryCode\": \"US\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"phone\": \"+1-555-123-4567\",\n \"province\": \"New York\",\n \"provinceCode\": \"NY\",\n \"zip\": \"10001\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
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/memberships/cp/api/subscription-contracts-update-shipping-address")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"address1\": \"123 Main St\",\n \"address2\": \"Apt 4B\",\n \"city\": \"New York\",\n \"company\": \"Acme Inc\",\n \"country\": \"United States\",\n \"countryCode\": \"US\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"phone\": \"+1-555-123-4567\",\n \"province\": \"New York\",\n \"provinceCode\": \"NY\",\n \"zip\": \"10001\"\n}"
response = http.request(request)
puts response.read_body{
"billingPolicy": {
"anchors": [
{
"cutoffDay": 123,
"day": 123,
"get__typename": "<string>",
"month": 123,
"type": "WEEKDAY"
}
],
"get__typename": "<string>",
"interval": "DAY",
"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": {},
"revokedReason": "AUTHORIZE_NET_GATEWAY_NOT_ENABLED"
},
"deliveryMethod": {
"get__typename": "<string>"
},
"deliveryPolicy": {
"anchors": [
{
"cutoffDay": 123,
"day": 123,
"get__typename": "<string>",
"month": 123,
"type": "WEEKDAY"
}
],
"get__typename": "<string>",
"interval": "DAY",
"intervalCount": 123
},
"deliveryPrice": {
"amount": {},
"currencyCode": "USD",
"get__typename": "<string>"
},
"discounts": {
"get__typename": "<string>",
"nodes": [
{
"get__typename": "<string>",
"id": "<string>",
"recurringCycleLimit": 123,
"rejectionReason": "NOT_FOUND",
"targetType": "LINE_ITEM",
"title": "<string>",
"type": "MANUAL",
"usageCount": 123,
"value": {
"get__typename": "<string>"
}
}
],
"pageInfo": {
"endCursor": "<string>",
"get__typename": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
},
"get__typename": "<string>",
"id": "<string>",
"lastPaymentStatus": "SUCCEEDED",
"lines": {
"get__typename": "<string>",
"nodes": [
{
"currentPrice": {
"amount": {},
"currencyCode": "USD",
"get__typename": "<string>"
},
"customAttributes": [
{
"get__typename": "<string>",
"key": "<string>",
"value": "<string>"
}
],
"discountAllocations": [
{
"amount": {
"amount": {},
"currencyCode": "USD",
"get__typename": "<string>"
},
"discount": {
"get__typename": "<string>"
},
"get__typename": "<string>"
}
],
"get__typename": "<string>",
"id": "<string>",
"lineDiscountedPrice": {
"amount": {},
"currencyCode": "USD",
"get__typename": "<string>"
},
"pricingPolicy": {
"basePrice": {
"amount": {},
"currencyCode": "USD",
"get__typename": "<string>"
},
"cycleDiscounts": [
{
"adjustmentType": "PERCENTAGE",
"adjustmentValue": {
"get__typename": "<string>"
},
"afterCycle": 123,
"computedPrice": {
"amount": {},
"currencyCode": "USD",
"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>",
"status": "OPEN"
}
],
"pageInfo": {
"endCursor": "<string>",
"get__typename": "<string>",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "<string>"
}
},
"get__typename": "<string>",
"id": "<string>",
"name": "<string>"
},
"revisionId": {},
"status": "ACTIVE",
"updatedAt": {}
}