Skip to main content
POST
/
products
/
{productId}
/
membership_method
/
options
Create membership method option
curl --request POST \
  --url https://app.supercycle.com/api/v1/products/{productId}/membership_method/options \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "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/options"

payload = {
"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({
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', 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/options",
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([
'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/options"

payload := strings.NewReader("{\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}")

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/options")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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}")
.asString();
require 'uri'
require 'net/http'

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

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 \"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}"

response = http.request(request)
puts response.read_body
{
  "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"
}
{
"message": "<string>"
}
{
"errors": [
"Invalid request body"
]
}
{
"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
id
integer<int64>
name
string
checkoutPriceCents
integer
creditCost
integer
variantApplicationType
string
marketApplicationType
string
conditionApplicationType
string
variantApplicationShopifyIds
integer<int64>[]
marketApplicationShopifyIds
integer<int64>[]
conditionApplicationIds
integer<int64>[]
_destroy
boolean

Response

The created membership method option

id
integer<int64>
required
name
string
required
checkoutPriceCents
integer
required
creditCost
integer
required
variantApplicationType
string
marketApplicationType
string
conditionApplicationType
string
createdAt
string<date-time>
updatedAt
string<date-time>