Update product
curl --request PUT \
--url https://rcur.app/api/v2/products/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Premium Plan",
"amount": 29.99,
"vat": 21,
"interval": "month",
"interval_value": 1,
"times": 12,
"woocommerce_product_id": 1234
}
'import requests
url = "https://rcur.app/api/v2/products/{id}"
payload = {
"name": "Premium Plan",
"amount": 29.99,
"vat": 21,
"interval": "month",
"interval_value": 1,
"times": 12,
"woocommerce_product_id": 1234
}
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({
name: 'Premium Plan',
amount: 29.99,
vat: 21,
interval: 'month',
interval_value: 1,
times: 12,
woocommerce_product_id: 1234
})
};
fetch('https://rcur.app/api/v2/products/{id}', 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://rcur.app/api/v2/products/{id}",
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([
'name' => 'Premium Plan',
'amount' => 29.99,
'vat' => 21,
'interval' => 'month',
'interval_value' => 1,
'times' => 12,
'woocommerce_product_id' => 1234
]),
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://rcur.app/api/v2/products/{id}"
payload := strings.NewReader("{\n \"name\": \"Premium Plan\",\n \"amount\": 29.99,\n \"vat\": 21,\n \"interval\": \"month\",\n \"interval_value\": 1,\n \"times\": 12,\n \"woocommerce_product_id\": 1234\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))
}HttpResponse<String> response = Unirest.put("https://rcur.app/api/v2/products/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Premium Plan\",\n \"amount\": 29.99,\n \"vat\": 21,\n \"interval\": \"month\",\n \"interval_value\": 1,\n \"times\": 12,\n \"woocommerce_product_id\": 1234\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rcur.app/api/v2/products/{id}")
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 \"name\": \"Premium Plan\",\n \"amount\": 29.99,\n \"vat\": 21,\n \"interval\": \"month\",\n \"interval_value\": 1,\n \"times\": 12,\n \"woocommerce_product_id\": 1234\n}"
response = http.request(request)
puts response.read_body{
"id": "prod_abc123",
"name": "Premium Plan",
"type": "subscription",
"amount": "29.99",
"currency": "EUR",
"interval": "month",
"times": 12,
"wc_product_id": 1234
}{
"status": 404,
"error": "Resource not found"
}{
"status": 422,
"error": "Could not process request. Some fields contain invalid data",
"fields": {
"email": [
"The email field is required."
]
}
}Products
Update product
PUT
/
api
/
v2
/
products
/
{id}
Update product
curl --request PUT \
--url https://rcur.app/api/v2/products/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Premium Plan",
"amount": 29.99,
"vat": 21,
"interval": "month",
"interval_value": 1,
"times": 12,
"woocommerce_product_id": 1234
}
'import requests
url = "https://rcur.app/api/v2/products/{id}"
payload = {
"name": "Premium Plan",
"amount": 29.99,
"vat": 21,
"interval": "month",
"interval_value": 1,
"times": 12,
"woocommerce_product_id": 1234
}
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({
name: 'Premium Plan',
amount: 29.99,
vat: 21,
interval: 'month',
interval_value: 1,
times: 12,
woocommerce_product_id: 1234
})
};
fetch('https://rcur.app/api/v2/products/{id}', 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://rcur.app/api/v2/products/{id}",
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([
'name' => 'Premium Plan',
'amount' => 29.99,
'vat' => 21,
'interval' => 'month',
'interval_value' => 1,
'times' => 12,
'woocommerce_product_id' => 1234
]),
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://rcur.app/api/v2/products/{id}"
payload := strings.NewReader("{\n \"name\": \"Premium Plan\",\n \"amount\": 29.99,\n \"vat\": 21,\n \"interval\": \"month\",\n \"interval_value\": 1,\n \"times\": 12,\n \"woocommerce_product_id\": 1234\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))
}HttpResponse<String> response = Unirest.put("https://rcur.app/api/v2/products/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Premium Plan\",\n \"amount\": 29.99,\n \"vat\": 21,\n \"interval\": \"month\",\n \"interval_value\": 1,\n \"times\": 12,\n \"woocommerce_product_id\": 1234\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rcur.app/api/v2/products/{id}")
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 \"name\": \"Premium Plan\",\n \"amount\": 29.99,\n \"vat\": 21,\n \"interval\": \"month\",\n \"interval_value\": 1,\n \"times\": 12,\n \"woocommerce_product_id\": 1234\n}"
response = http.request(request)
puts response.read_body{
"id": "prod_abc123",
"name": "Premium Plan",
"type": "subscription",
"amount": "29.99",
"currency": "EUR",
"interval": "month",
"times": 12,
"wc_product_id": 1234
}{
"status": 404,
"error": "Resource not found"
}{
"status": 422,
"error": "Could not process request. Some fields contain invalid data",
"fields": {
"email": [
"The email field is required."
]
}
}Body
application/json
Product data to update
Product name
Example:
"Premium Plan"
Product amount
Example:
29.99
VAT percentage
Example:
21
Interval (required for subscription type)
Available options:
day, week, month, year Example:
"month"
Interval value (required for subscription type)
Example:
1
Number of payments (null = infinite)
Example:
12
WooCommerce product ID
Example:
1234
Response
Product details
Example:
"prod_abc123"
Example:
"Premium Plan"
Available options:
once,subscription,shipping_costs Example:
"subscription"
Example:
"29.99"
Example:
"EUR"
Example:
"month"
Example:
12
Example:
1234
⌘I