Map a Polar product
PUT
/v1/admin/integrations/{id}/mappings/{polarProductId}
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Put, RequestUri = new Uri("https://api.sealcord.com/v1/admin/integrations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/mappings/example"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"product_id\": \"example\", \"limit_kind\": \"seats\", \"limit_count\": 1, \"key_valid_days\": null, \"on_refund\": \"revoke\", \"on_subscription_end\": \"expire\", \"renewal_url\": \"example\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.sealcord.com/v1/admin/integrations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/mappings/example"
payload := strings.NewReader("{ \"product_id\": \"example\", \"limit_kind\": \"seats\", \"limit_count\": 1, \"key_valid_days\": null, \"on_refund\": \"revoke\", \"on_subscription_end\": \"expire\", \"renewal_url\": \"example\" }")
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(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.sealcord.com/v1/admin/integrations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/mappings/example")) .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .method("PUT", HttpRequest.BodyPublishers.ofString("{ \"product_id\": \"example\", \"limit_kind\": \"seats\", \"limit_count\": 1, \"key_valid_days\": null, \"on_refund\": \"revoke\", \"on_subscription_end\": \"expire\", \"renewal_url\": \"example\" }")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());const url = 'https://api.sealcord.com/v1/admin/integrations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/mappings/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"product_id":"example","limit_kind":"seats","limit_count":1,"key_valid_days":null,"on_refund":"revoke","on_subscription_end":"expire","renewal_url":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use std::str::FromStr;use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.sealcord.com/v1/admin/integrations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/mappings/example";
let payload = json!({ "product_id": "example", "limit_kind": "seats", "limit_count": 1, "key_valid_days": json!(null), "on_refund": "revoke", "on_subscription_end": "expire", "renewal_url": "example" });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request PUT \ --url https://api.sealcord.com/v1/admin/integrations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/mappings/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "product_id": "example", "limit_kind": "seats", "limit_count": 1, "key_valid_days": null, "on_refund": "revoke", "on_subscription_end": "expire", "renewal_url": "example" }'Map a Polar product, or a Stripe price or product, of the integration to one of your products.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
polarProductId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
product_id
required
string
limit_kind
string
limit_count
integer
key_valid_days
integer
on_refund
string
on_subscription_end
string
renewal_url
string
Responses
Section titled “Responses”Missing or invalid API key.
Needs scope payments:write.