Cancelling a payin
curl --request POST \
--url https://service-sandbox.tazapay.com/v3/payin/{id}/cancel \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://service-sandbox.tazapay.com/v3/payin/{id}/cancel"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://service-sandbox.tazapay.com/v3/payin/{id}/cancel', 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://service-sandbox.tazapay.com/v3/payin/{id}/cancel",
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: Basic <encoded-value>"
],
]);
$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://service-sandbox.tazapay.com/v3/payin/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://service-sandbox.tazapay.com/v3/payin/{id}/cancel")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://service-sandbox.tazapay.com/v3/payin/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "",
"data": {
"amount": 100,
"amount_paid": 0,
"billing_details": {
"address": {
"city": "Singapore",
"country": "SG",
"line1": "1st Street",
"line2": "2nd Avenue",
"postal_code": "43004",
"state": "Singapore"
},
"label": "Home",
"name": "Andrea Lark",
"phone": {
"calling_code": "65",
"number": "87654321"
}
},
"cancel_url": "https://mystore.com/try_again",
"cancelled_at": "2024-10-07T07:25:36.425619061Z",
"client_token": "JsU19R_Li9cwVksJGUfAajZ3r2A9ArU7Qk3j5r0cpVg=",
"confirm": false,
"created_at": "2024-10-07T07:10:21.894488Z",
"customer": "cus_crtqrhth90j0121gpt50",
"customer_details": {
"country": "SG",
"email": "andrea@example.com",
"name": "Andrea Lark",
"phone": {
"calling_code": "65",
"number": "87654321"
}
},
"holding_currency": "INR",
"id": "pay_cs1oina7a5ng2a3ng12g",
"invoice_currency": "INR",
"items": [],
"latest_payment_attempt": "",
"latest_payment_attempt_data": null,
"metadata": {
"key1": "value1",
"key2": "value2",
"key3": "value3"
},
"object": "payin",
"paid_in_excess": false,
"partially_paid": false,
"payment_attempts": [],
"payment_method_details": {
"paynow_sgd": {},
"type": "paynow_sgd"
},
"reference_id": "string",
"shipping_details": {
"address": {
"city": "Singapore",
"country": "SG",
"line1": "1st Street",
"line2": "2nd Avenue",
"postal_code": "43004",
"state": "Singapore"
},
"label": "Home",
"name": "Andrea Lark",
"phone": {
"calling_code": "65",
"number": "87654321"
}
},
"statement_descriptor": "tzp*string",
"status": "cancelled",
"status_description": "",
"success_url": "https://mystore.com/success_page",
"transaction_data": [],
"transaction_description": "test",
"transaction_documents": [],
"webhook_url": "https://mystore.com/internal/webhook"
}
}Payin
Cancel Payin
POST
/
v3
/
payin
/
{id}
/
cancel
Cancelling a payin
curl --request POST \
--url https://service-sandbox.tazapay.com/v3/payin/{id}/cancel \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://service-sandbox.tazapay.com/v3/payin/{id}/cancel"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://service-sandbox.tazapay.com/v3/payin/{id}/cancel', 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://service-sandbox.tazapay.com/v3/payin/{id}/cancel",
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: Basic <encoded-value>"
],
]);
$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://service-sandbox.tazapay.com/v3/payin/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://service-sandbox.tazapay.com/v3/payin/{id}/cancel")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://service-sandbox.tazapay.com/v3/payin/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "",
"data": {
"amount": 100,
"amount_paid": 0,
"billing_details": {
"address": {
"city": "Singapore",
"country": "SG",
"line1": "1st Street",
"line2": "2nd Avenue",
"postal_code": "43004",
"state": "Singapore"
},
"label": "Home",
"name": "Andrea Lark",
"phone": {
"calling_code": "65",
"number": "87654321"
}
},
"cancel_url": "https://mystore.com/try_again",
"cancelled_at": "2024-10-07T07:25:36.425619061Z",
"client_token": "JsU19R_Li9cwVksJGUfAajZ3r2A9ArU7Qk3j5r0cpVg=",
"confirm": false,
"created_at": "2024-10-07T07:10:21.894488Z",
"customer": "cus_crtqrhth90j0121gpt50",
"customer_details": {
"country": "SG",
"email": "andrea@example.com",
"name": "Andrea Lark",
"phone": {
"calling_code": "65",
"number": "87654321"
}
},
"holding_currency": "INR",
"id": "pay_cs1oina7a5ng2a3ng12g",
"invoice_currency": "INR",
"items": [],
"latest_payment_attempt": "",
"latest_payment_attempt_data": null,
"metadata": {
"key1": "value1",
"key2": "value2",
"key3": "value3"
},
"object": "payin",
"paid_in_excess": false,
"partially_paid": false,
"payment_attempts": [],
"payment_method_details": {
"paynow_sgd": {},
"type": "paynow_sgd"
},
"reference_id": "string",
"shipping_details": {
"address": {
"city": "Singapore",
"country": "SG",
"line1": "1st Street",
"line2": "2nd Avenue",
"postal_code": "43004",
"state": "Singapore"
},
"label": "Home",
"name": "Andrea Lark",
"phone": {
"calling_code": "65",
"number": "87654321"
}
},
"statement_descriptor": "tzp*string",
"status": "cancelled",
"status_description": "",
"success_url": "https://mystore.com/success_page",
"transaction_data": [],
"transaction_description": "test",
"transaction_documents": [],
"webhook_url": "https://mystore.com/internal/webhook"
}
}You can cancel a payin when it’s in one of the following statuses -
requires_payment_method or requires_action. Upon cancellation, the status changes to cancelled.Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
ID of the already created payin
Was this page helpful?
⌘I