delete__subscription_pending-payment
DELETE /subscriptions/pending-payment
Cancel Pending Payment
Cancel a pending payment for the authenticated user's organization. This endpoint cancels any ongoing payment process and expires the associated Stripe checkout session.
Parameters
No parameters required.
TypeScript Client Library
public cancelPendingPayment = async (): Promise<CancelPendingPaymentResponse> => {
return this.makeRequest<CancelPendingPaymentResponse>('subscriptions/pending-payment', 'DELETE', null);
};Code Samples
curl -X DELETE https://backend.flashback.tech/subscriptions/pending-payment \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'DELETE https://backend.flashback.tech/subscriptions/pending-payment HTTP/1.1
Host: backend.flashback.tech
Accept: application/json
Authorization: Bearer {access-token}const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://backend.flashback.tech/subscriptions/pending-payment',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});require 'rest-client'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://backend.flashback.tech/subscriptions/pending-payment',
headers: headers
p JSON.parse(result)import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://backend.flashback.tech/subscriptions/pending-payment',
headers=headers)
print(r.json())<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
try {
$response = $client->request('DELETE','https://backend.flashback.tech/subscriptions/pending-payment', array(
'headers' => $headers,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...URL obj = new URL("https://backend.flashback.tech/subscriptions/pending-payment");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());package main
import (
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
req, err := http.NewRequest("DELETE", "https://backend.flashback.tech/subscriptions/pending-payment", nil)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}Example responses
200 Response
{
"success": true,
"message": "Pending payment cancelled successfully",
"data": {
"paymentId": "pay_1234567890abcdef",
"stripePaymentId": "cs_test_1234567890abcdef",
"cancelledAt": "2024-01-15T10:35:00Z"
}
}400 Response
{
"success": false,
"error_code": "NO_ORGANIZATION",
"message": "User must belong to an organization"
}404 Response (User Not Found)
{
"success": false,
"error_code": "USER_NOT_FOUND",
"message": "User not found"
}404 Response (No Pending Payment)
{
"success": false,
"error_code": "NO_PENDING_PAYMENT",
"message": "No pending payment found"
}500 Response
{
"success": false,
"error_code": "INTERNAL_ERROR",
"message": "Failed to cancel pending payment"
}Responses
Response Schema
Status Code 200
» success
boolean
false
none
Indicates if the request was successful
» message
string
false
none
Success message
» data
object
false
none
Cancellation details
»» paymentId
string
false
none
Unique payment identifier
»» stripePaymentId
string
false
none
Stripe checkout session identifier
»» cancelledAt
string
false
none
Cancellation timestamp (ISO 8601)
Status Code 400
» success
boolean
false
none
Will be false for error responses
» error_code
string
false
none
Machine-readable error code
» message
string
false
none
Human-readable error message
Status Code 404
» success
boolean
false
none
Will be false for error responses
» error_code
string
false
none
Machine-readable error code
» message
string
false
none
Human-readable error message
Status Code 500
» success
boolean
false
none
Will be false for error responses
» error_code
string
false
none
Machine-readable error code
» message
string
false
none
Human-readable error message
Last updated
Was this helpful?