Skip to main content
DELETE
/
v1
/
subscription_items
/
{id}
Delete a subscription item
curl --request DELETE \
  --url https://api.yorlet.com/v1/subscription_items/{id} \
  --header 'Authorization: <api-key>'
import requests

url = "https://api.yorlet.com/v1/subscription_items/{id}"

headers = {"Authorization": "<api-key>"}

response = requests.delete(url, headers=headers)

print(response.text)
const options = {method: 'DELETE', headers: {Authorization: '<api-key>'}};

fetch('https://api.yorlet.com/v1/subscription_items/{id}', 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.yorlet.com/v1/subscription_items/{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: <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.yorlet.com/v1/subscription_items/{id}"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://api.yorlet.com/v1/subscription_items/{id}")
  .header("Authorization", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.yorlet.com/v1/subscription_items/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "created": 123,
  "object": "subscription_item",
  "description": "<string>",
  "price": "<string>",
  "price_data": {
    "amount": 123,
    "currency": "gbp",
    "recurring": {
      "interval": "<string>",
      "interval_count": 123
    },
    "tax_percent": 123
  },
  "schedule": [
    {
      "amount": 123,
      "effective_at": 123
    }
  ],
  "subscription": "<string>",
  "tax_rate": "<string>",
  "transfer_destination": "<string>",
  "unit": "<string>",
  "account": "<string>",
  "deleted": false,
  "metadata": {}
}

Authorizations

Authorization
string
header
required

API Key authentication. Use "Bearer YOUR_API_KEY".

Path Parameters

id
string
required

The id identifier.

Response

200 - application/json

Delete a subscription item

id
string
required

Unique identifier for the object.

created
number
required

Time at which the object was created. Measured in seconds since the Unix epoch.

object
enum<string>
required
Available options:
subscription_item
description
string | null
required

The description of the subscription item.

price
string | null
required

The identifier of the price for the subscription item.

Pattern: ^[a-zA-Z0-9_]+$
price_data
object
required

The price data for the subscription item.

schedule
object[] | null
required

The schedule for the subscription item.

subscription
string
required

The identifier of the subscription the item belongs to.

Pattern: ^[a-zA-Z0-9_]+$
tax_rate
string | null
required

The identifier of the tax rate for the subscription item.

Pattern: ^[a-zA-Z0-9_]+$
transfer_behavior
enum<string> | null
required

The transfer behavior for the subscription item.

Available options:
automatic,
owner,
none,
null
transfer_destination
string | null
required

The identifier of the connected account to transfer funds to.

Pattern: ^[a-zA-Z0-9_]+$
type
enum<string>
required

The type of the subscription item.

Available options:
charge,
rent,
product
unit
string | null
required

The identifier of the unit associated with the subscription item.

Pattern: ^[a-zA-Z0-9_]+$
account
string

The account that the object belongs to. Only returned if the request is made with a valid Yorlet-Context header.

deleted
boolean
default:false

Only returned if the object has been deleted.

metadata
object | null

Set of key-value pairs attached to the subscription item.