Send an offer to its buyer
curl --request POST \
--url https://api.cope.com/v1/commerce/offers/{id}/send \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cope.com/v1/commerce/offers/{id}/send"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cope.com/v1/commerce/offers/{id}/send', 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.cope.com/v1/commerce/offers/{id}/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.cope.com/v1/commerce/offers/{id}/send"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.cope.com/v1/commerce/offers/{id}/send")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cope.com/v1/commerce/offers/{id}/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"buyer_profile": {
"address": {
"city": "<string>",
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>"
},
"company_name": "<string>",
"country": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"locale": "<string>",
"state": "<string>",
"type": "<string>",
"vat_id": "<string>",
"phone": "<string>"
},
"cancelled_at": "<string>",
"cancelled_reason": "<string>",
"created_at": "<string>",
"expires_at": "<string>",
"id": "of_A1b2C3d4E5f6",
"last_buyer_notification_at": "<string>",
"next_resend_available_at": "<string>",
"order": {
"id": "ord_A1b2C3d4E5f6"
},
"ordered_at": "<string>",
"payment_plan_snapshot": {
"currency": "<string>",
"custom_plan_name": "<string>",
"installment_count": 123,
"interval": "<string>",
"interval_count": 123,
"plan_type": "<string>",
"price_minor_units": 123,
"quantity": 123,
"recurring_amount_minor_units": 123,
"second_payment_in": 123,
"shipping_price_minor_units": 123,
"trial_days": 123,
"has_net_price": true
},
"product": {
"id": "prod_A1b2C3d4",
"name": "<string>"
},
"public_url": "<string>",
"regeneration_eligible": true,
"status": "<string>",
"embed_origin": "<string>",
"embed_url": "<string>",
"external_reference": "<string>",
"metadata": {}
}
}
Send an offer to its buyer
Delivers this offer’s private checkout link to its buyer for the first time, and returns
the offer. Only an active offer that has not lapsed and that carries a buyer email and
name can be sent.
This is the first delivery only. An offer that has already been sent is refused with 422
invalid_state; use resend for any further delivery.
Delivery is asynchronous. A 200 means the send was accepted and stamped on
last_buyer_notification_at — it does not confirm the message reached the buyer.
Requires the orders permission at write. An API key holds a permission at the lower of its own level (read for a read-only key) and its holder’s role; a key without it is refused with 403.
POST
/
v1
/
commerce
/
offers
/
{id}
/
send
Send an offer to its buyer
curl --request POST \
--url https://api.cope.com/v1/commerce/offers/{id}/send \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cope.com/v1/commerce/offers/{id}/send"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cope.com/v1/commerce/offers/{id}/send', 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.cope.com/v1/commerce/offers/{id}/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.cope.com/v1/commerce/offers/{id}/send"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.cope.com/v1/commerce/offers/{id}/send")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cope.com/v1/commerce/offers/{id}/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"buyer_profile": {
"address": {
"city": "<string>",
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>"
},
"company_name": "<string>",
"country": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"locale": "<string>",
"state": "<string>",
"type": "<string>",
"vat_id": "<string>",
"phone": "<string>"
},
"cancelled_at": "<string>",
"cancelled_reason": "<string>",
"created_at": "<string>",
"expires_at": "<string>",
"id": "of_A1b2C3d4E5f6",
"last_buyer_notification_at": "<string>",
"next_resend_available_at": "<string>",
"order": {
"id": "ord_A1b2C3d4E5f6"
},
"ordered_at": "<string>",
"payment_plan_snapshot": {
"currency": "<string>",
"custom_plan_name": "<string>",
"installment_count": 123,
"interval": "<string>",
"interval_count": 123,
"plan_type": "<string>",
"price_minor_units": 123,
"quantity": 123,
"recurring_amount_minor_units": 123,
"second_payment_in": 123,
"shipping_price_minor_units": 123,
"trial_days": 123,
"has_net_price": true
},
"product": {
"id": "prod_A1b2C3d4",
"name": "<string>"
},
"public_url": "<string>",
"regeneration_eligible": true,
"status": "<string>",
"embed_origin": "<string>",
"embed_url": "<string>",
"external_reference": "<string>",
"metadata": {}
}
}
Authorizations
Path Parameters
Was this page helpful?