Duplicate an offer
Create a new draft offer pre-filled from an existing one. The copy gets a “(Copy)” name, resets to draft status, omits the unique SKU, and strips known sample pricing entries.
curl --request POST \
--url https://api.offergrid.io/provider/offers/{id}/duplicate \
--header 'x-api-key: <api-key>'import requests
url = "https://api.offergrid.io/provider/offers/{id}/duplicate"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.offergrid.io/provider/offers/{id}/duplicate', 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.offergrid.io/provider/offers/{id}/duplicate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.offergrid.io/provider/offers/{id}/duplicate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.offergrid.io/provider/offers/{id}/duplicate")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.offergrid.io/provider/offers/{id}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"serviceType": "internet",
"electricity": {
"rate": {
"charges": [
{
"type": "perKwh",
"centsPerKwh": 1,
"label": "<string>",
"minUsageKwh": 1,
"maxUsageKwh": 1
}
],
"avgPriceAt1000Kwh": 1,
"estimatedMonthlyAt1000Kwh": 1
},
"term": {
"earlyTerminationFee": 1,
"earlyTerminationFeeNotes": "<string>"
},
"plan": {
"renewablePercentage": 50,
"freeNightsWeekends": true,
"noDeposit": true
},
"disclosures": {
"electricityFactsLabel": {
"url": "<string>",
"versionId": "<string>",
"avgPrice500kwh": 1,
"avgPrice1000kwh": 1,
"avgPrice2000kwh": 1,
"renewablePercent": 50
},
"puctCertNumber": "<string>",
"puctCertifiedName": "<string>",
"termsOfServiceUrl": "<string>",
"yourRightsUrl": "<string>"
}
},
"internet": {
"speed": {
"minBandwidthMbps": 1,
"maxBandwidthMbps": 1
},
"data": {
"capGb": 1
},
"term": {
"earlyTerminationFee": 1,
"earlyTerminationFeeNotes": "<string>"
},
"disclosures": {
"broadbandLabel": {
"url": "<string>",
"typicalDownload": 1,
"typicalUpload": 1,
"typicalLatency": 1,
"dataCapGb": 1
},
"networkManagementUrl": "<string>"
}
}
}Authorizations
Team API key for authentication. Your team role (provider/reseller/hybrid) determines which endpoints you can access.
Path Parameters
Response
Duplicated offer (new draft)
An offer. Always includes a top-level serviceType discriminator ("electricity", "internet", …); electricity offers additionally include a grouped electricity object and internet offers a grouped internet object. The underlying offer fields (name, status, markets, marketing, pricing, …) are also present.
Flat service-type discriminator derived from category. Check this instead of category directly.
"internet"
Present only on electricity offers.
Show child attributes
Show child attributes
Present only on internet offers.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.offergrid.io/provider/offers/{id}/duplicate \
--header 'x-api-key: <api-key>'import requests
url = "https://api.offergrid.io/provider/offers/{id}/duplicate"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.offergrid.io/provider/offers/{id}/duplicate', 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.offergrid.io/provider/offers/{id}/duplicate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.offergrid.io/provider/offers/{id}/duplicate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.offergrid.io/provider/offers/{id}/duplicate")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.offergrid.io/provider/offers/{id}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"serviceType": "internet",
"electricity": {
"rate": {
"charges": [
{
"type": "perKwh",
"centsPerKwh": 1,
"label": "<string>",
"minUsageKwh": 1,
"maxUsageKwh": 1
}
],
"avgPriceAt1000Kwh": 1,
"estimatedMonthlyAt1000Kwh": 1
},
"term": {
"earlyTerminationFee": 1,
"earlyTerminationFeeNotes": "<string>"
},
"plan": {
"renewablePercentage": 50,
"freeNightsWeekends": true,
"noDeposit": true
},
"disclosures": {
"electricityFactsLabel": {
"url": "<string>",
"versionId": "<string>",
"avgPrice500kwh": 1,
"avgPrice1000kwh": 1,
"avgPrice2000kwh": 1,
"renewablePercent": 50
},
"puctCertNumber": "<string>",
"puctCertifiedName": "<string>",
"termsOfServiceUrl": "<string>",
"yourRightsUrl": "<string>"
}
},
"internet": {
"speed": {
"minBandwidthMbps": 1,
"maxBandwidthMbps": 1
},
"data": {
"capGb": 1
},
"term": {
"earlyTerminationFee": 1,
"earlyTerminationFeeNotes": "<string>"
},
"disclosures": {
"broadbandLabel": {
"url": "<string>",
"typicalDownload": 1,
"typicalUpload": 1,
"typicalLatency": 1,
"dataCapGb": 1
},
"networkManagementUrl": "<string>"
}
}
}