Delete an applied coupon
curl --request DELETE \
--url https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}"
req, _ := http.NewRequest("DELETE", 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))
}require 'uri'
require 'net/http'
url = URI("https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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;
}HttpResponse<String> response = Unirest.delete("https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}")
.header("Authorization", "Bearer <token>")
.asString();{
"applied_coupon": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_coupon_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"coupon_code": "startup_deal",
"coupon_name": "Startup Deal",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"status": "active",
"frequency": "recurring",
"created_at": "2022-04-29T08:59:51Z",
"coupon_status": "active",
"coupon_deleted_at": "2022-04-29T08:59:51Z",
"amount_cents": 2000,
"amount_cents_remaining": 50,
"amount_currency": "EUR",
"percentage_rate": null,
"frequency_duration": 3,
"frequency_duration_remaining": 1,
"expiration_at": "2022-04-29T08:59:51Z",
"terminated_at": "2022-04-29T08:59:51Z"
}
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}Coupons
Delete an applied coupon
This endpoint is used to delete a specific coupon that has been applied to a customer.
DELETE
/
customers
/
{external_customer_id}
/
applied_coupons
/
{applied_coupon_id}
Delete an applied coupon
curl --request DELETE \
--url https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}"
req, _ := http.NewRequest("DELETE", 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))
}require 'uri'
require 'net/http'
url = URI("https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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;
}HttpResponse<String> response = Unirest.delete("https://core.nozle.app/api/v1/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}")
.header("Authorization", "Bearer <token>")
.asString();{
"applied_coupon": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_coupon_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"coupon_code": "startup_deal",
"coupon_name": "Startup Deal",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"status": "active",
"frequency": "recurring",
"created_at": "2022-04-29T08:59:51Z",
"coupon_status": "active",
"coupon_deleted_at": "2022-04-29T08:59:51Z",
"amount_cents": 2000,
"amount_cents_remaining": 50,
"amount_currency": "EUR",
"percentage_rate": null,
"frequency_duration": 3,
"frequency_duration_remaining": 1,
"expiration_at": "2022-04-29T08:59:51Z",
"terminated_at": "2022-04-29T08:59:51Z"
}
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The customer external unique identifier (provided by your own application)
Example:
"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
Unique identifier of the applied coupon, created by Nozle.
Example:
"1a901a90-1a90-1a90-1a90-1a901a901a90"
Response
Successful response
Show child attributes
Show child attributes