curl --request POST \
--url https://coreapi.io/api/offers/{id}/withdraw \
--header 'Authorization: Bearer <token>'import requests
url = "https://coreapi.io/api/offers/{id}/withdraw"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/api/offers/{id}/withdraw', 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://coreapi.io/api/offers/{id}/withdraw",
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;
}Withdraw an offer
(Beta, unstable, may change) Takes the offer back. The offer then has the end state withdrawn and no longer counts in the pipeline. Allowed while the offer is open or in signing, and also after the customer signed (status awaiting_invoice_details or signed). For a signed offer the request first ends what the signature created: an open order of the offer is cancelled; a subscription of the offer that has not started (draft, offer, awaiting_payment_method) is voided and its draft invoices are closed only when no step of it was executed and nothing of it was billed; otherwise it is cancelled with today as its end and stays in the statistics; an active or paused subscription is cancelled with immediate effect, without a credit and without an e-mail to the customer. Invoices written before stay as they are: an issued invoice can be corrected with POST /api/invoices/{id}/correct, an invoice still awaiting approval stays in the approval queue. A subscription that is already cancelled, terminated or voided is left as it is. An offer that changed an existing subscription never ends that subscription: its order is cancelled while nothing of it has been applied, afterwards the request is refused. Withdrawing a signed offer additionally requires subscription:write. The steps do not run in one transaction: when the request fails after the subscription was cancelled, the subscription stays cancelled and the offer keeps its status, and sending the request again finishes the withdrawal.
Required permission: offer:write.
curl --request POST \
--url https://coreapi.io/api/offers/{id}/withdraw \
--header 'Authorization: Bearer <token>'import requests
url = "https://coreapi.io/api/offers/{id}/withdraw"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/api/offers/{id}/withdraw', 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://coreapi.io/api/offers/{id}/withdraw",
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;
}Autorisierungen
Pfadparameter
Antwort
The closed offer
The end state of an offer closed by the seller.
War diese Seite hilfreich?