Skip to main content
PUT
/
products
/
{uid}
Update a product
curl --request PUT \
  --url https://api.qonversion.io/v3/products/{uid} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": 1,
  "apple_product_id": "com.app.premium_monthly",
  "google_product_id": "com.app.premium_monthly",
  "duration": 1
}
'
import requests

url = "https://api.qonversion.io/v3/products/{uid}"

payload = {
    "type": 1,
    "apple_product_id": "com.app.premium_monthly",
    "google_product_id": "com.app.premium_monthly",
    "duration": 1
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    type: 1,
    apple_product_id: 'com.app.premium_monthly',
    google_product_id: 'com.app.premium_monthly',
    duration: 1
  })
};

fetch('https://api.qonversion.io/v3/products/{uid}', 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://api.qonversion.io/v3/products/{uid}",
  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([
    'type' => 1,
    'apple_product_id' => 'com.app.premium_monthly',
    'google_product_id' => 'com.app.premium_monthly',
    'duration' => 1
  ]),
  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;
}
require 'uri'
require 'net/http'

url = URI("https://api.qonversion.io/v3/products/{uid}")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": 1,\n  \"apple_product_id\": \"com.app.premium_monthly\",\n  \"google_product_id\": \"com.app.premium_monthly\",\n  \"duration\": 1\n}"

response = http.request(request)
puts response.read_body
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.qonversion.io/v3/products/{uid}"

	payload := strings.NewReader("{\n  \"type\": 1,\n  \"apple_product_id\": \"com.app.premium_monthly\",\n  \"google_product_id\": \"com.app.premium_monthly\",\n  \"duration\": 1\n}")

	req, _ := http.NewRequest("PUT", 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.put("https://api.qonversion.io/v3/products/{uid}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": 1,\n  \"apple_product_id\": \"com.app.premium_monthly\",\n  \"google_product_id\": \"com.app.premium_monthly\",\n  \"duration\": 1\n}")
  .asString();
{
  "uid": "premium_monthly",
  "project_id": 12345,
  "type": 1,
  "apple_product_id": "com.app.premium_monthly",
  "google_product_id": "com.app.premium_monthly",
  "google_base_plan_id": "monthly-base",
  "stripe_product_id": "prod_abc123",
  "duration": 1,
  "subscription_duration": "P1M",
  "created_at": 1665669916,
  "updated_at": 1665669916
}
{
  "error": {
    "code": "<string>",
    "message": "<string>"
  },
  "meta": {
    "reference": "https://documentation.qonversion.io/reference/handling-api-errors"
  }
}
{
  "error": {
    "code": "<string>",
    "message": "<string>"
  },
  "meta": {
    "reference": "https://documentation.qonversion.io/reference/handling-api-errors"
  }
}

Authorizations

Authorization
string
header
required

Use your Project Key from the Qonversion dashboard (Project Settings -> Project Keys -> Project Key).

Production keys have no prefix; keys prefixed with test_ target the sandbox environment.

Example (sandbox): Bearer test_PV77YHL7qnGvsdmpTs7gimsxUvY-Znl2 Example (production): Bearer JFPATc4VaaWYsfurml3qZ4zsmNw0VfWH

Path Parameters

uid
string
required

Qonversion product UID

Body

application/json
type
enum<integer>

Product type: 0 = Subscription With Promo Period, 1 = Regular Subscription, 2 = Non-Recurring (Consumable), 3 = Non-Consumable (Lifetime)

Available options:
0,
1,
2,
3
apple_product_id
string
google_product_id
string
google_base_plan_id
string
stripe_product_id
string
duration
enum<integer>
Available options:
0,
1,
2,
3,
4

Response

Product updated

uid
string

Unique identifier of the Qonversion product

Example:

"premium_monthly"

project_id
integer

Numeric ID of the Qonversion project owning this product

Example:

12345

type
enum<integer>

Product type:

  • 0 = Subscription With Promo Period
  • 1 = Regular Subscription
  • 2 = Non-Recurring (Consumable)
  • 3 = Non-Consumable (Lifetime)
Available options:
0,
1,
2,
3
Example:

1

apple_product_id
string

Product identifier in App Store Connect

Example:

"com.app.premium_monthly"

google_product_id
string

Product identifier in Google Play Console

Example:

"com.app.premium_monthly"

google_base_plan_id
string

Base plan identifier in Google Play Console

Example:

"monthly-base"

stripe_product_id
string

Product identifier in Stripe

Example:

"prod_abc123"

duration
enum<integer>

Duration: 0 = Weekly, 1 = Monthly, 2 = Three Monthly, 3 = Six Monthly, 4 = Annual

Available options:
0,
1,
2,
3,
4
Example:

1

subscription_duration
enum<string>

ISO 8601 subscription duration string derived from duration. Server-computed: P1W for Weekly, P1M for Monthly, P3M for Three Monthly, P6M for Six Monthly, P1Y for Annual. Present only for subscription products (type 0 or 1).

Available options:
P1W,
P1M,
P3M,
P6M,
P1Y
Example:

"P1M"

created_at
integer

Creation timestamp (Unix seconds)

Example:

1665669916

updated_at
integer

Last-update timestamp (Unix seconds)

Example:

1665669916