Skip to main content
POST
/
products
/
{productId}
/
membership_method
Create or update membership method
curl --request POST \
  --url https://app.supercycle.com/api/v1/products/{productId}/membership_method \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "optionsAttributes": [
    {
      "id": 123,
      "name": "<string>",
      "checkoutPriceCents": 123,
      "creditCost": 123,
      "variantApplicationType": "<string>",
      "marketApplicationType": "<string>",
      "conditionApplicationType": "<string>",
      "variantApplicationShopifyIds": [
        123
      ],
      "marketApplicationShopifyIds": [
        123
      ],
      "conditionApplicationIds": [
        123
      ],
      "_destroy": true
    }
  ]
}
'
import requests

url = "https://app.supercycle.com/api/v1/products/{productId}/membership_method"

payload = { "optionsAttributes": [
{
"id": 123,
"name": "<string>",
"checkoutPriceCents": 123,
"creditCost": 123,
"variantApplicationType": "<string>",
"marketApplicationType": "<string>",
"conditionApplicationType": "<string>",
"variantApplicationShopifyIds": [123],
"marketApplicationShopifyIds": [123],
"conditionApplicationIds": [123],
"_destroy": True
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
optionsAttributes: [
{
id: 123,
name: '<string>',
checkoutPriceCents: 123,
creditCost: 123,
variantApplicationType: '<string>',
marketApplicationType: '<string>',
conditionApplicationType: '<string>',
variantApplicationShopifyIds: [123],
marketApplicationShopifyIds: [123],
conditionApplicationIds: [123],
_destroy: true
}
]
})
};

fetch('https://app.supercycle.com/api/v1/products/{productId}/membership_method', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://app.supercycle.com/api/v1/products/{productId}/membership_method",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'optionsAttributes' => [
[
'id' => 123,
'name' => '<string>',
'checkoutPriceCents' => 123,
'creditCost' => 123,
'variantApplicationType' => '<string>',
'marketApplicationType' => '<string>',
'conditionApplicationType' => '<string>',
'variantApplicationShopifyIds' => [
123
],
'marketApplicationShopifyIds' => [
123
],
'conditionApplicationIds' => [
123
],
'_destroy' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.supercycle.com/api/v1/products/{productId}/membership_method"

payload := strings.NewReader("{\n \"optionsAttributes\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"checkoutPriceCents\": 123,\n \"creditCost\": 123,\n \"variantApplicationType\": \"<string>\",\n \"marketApplicationType\": \"<string>\",\n \"conditionApplicationType\": \"<string>\",\n \"variantApplicationShopifyIds\": [\n 123\n ],\n \"marketApplicationShopifyIds\": [\n 123\n ],\n \"conditionApplicationIds\": [\n 123\n ],\n \"_destroy\": true\n }\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
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))

}
HttpResponse<String> response = Unirest.post("https://app.supercycle.com/api/v1/products/{productId}/membership_method")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"optionsAttributes\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"checkoutPriceCents\": 123,\n \"creditCost\": 123,\n \"variantApplicationType\": \"<string>\",\n \"marketApplicationType\": \"<string>\",\n \"conditionApplicationType\": \"<string>\",\n \"variantApplicationShopifyIds\": [\n 123\n ],\n \"marketApplicationShopifyIds\": [\n 123\n ],\n \"conditionApplicationIds\": [\n 123\n ],\n \"_destroy\": true\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.supercycle.com/api/v1/products/{productId}/membership_method")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"optionsAttributes\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"checkoutPriceCents\": 123,\n \"creditCost\": 123,\n \"variantApplicationType\": \"<string>\",\n \"marketApplicationType\": \"<string>\",\n \"conditionApplicationType\": \"<string>\",\n \"variantApplicationShopifyIds\": [\n 123\n ],\n \"marketApplicationShopifyIds\": [\n 123\n ],\n \"conditionApplicationIds\": [\n 123\n ],\n \"_destroy\": true\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "status": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "options": [
    {
      "id": 123,
      "name": "<string>",
      "checkoutPriceCents": 123,
      "creditCost": 123,
      "variantApplicationType": "<string>",
      "marketApplicationType": "<string>",
      "conditionApplicationType": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    }
  ]
}
{
"id": 123,
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"options": [
{
"id": 123,
"name": "<string>",
"checkoutPriceCents": 123,
"creditCost": 123,
"variantApplicationType": "<string>",
"marketApplicationType": "<string>",
"conditionApplicationType": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
{
"error": "Rate limit exceeded. Retry after 42 seconds."
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

productId
integer<int64>
required

The Shopify product ID

Body

application/json
status
enum<string>
Available options:
enabled,
disabled
optionsAttributes
object[]

Response

The updated membership method

id
integer<int64>
required
status
string
required
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
options
object[]
required