Unenroll Payment Method
curl --request POST \
--url https://api-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'public-api-key': '<api-key>', 'private-secret-key': '<api-key>'}
};
fetch('https://api-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll', 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-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"private-secret-key: <api-key>",
"public-api-key: <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-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "77ee4a02-da3e-4a11-ac15-ba69e1813475",
"idempotency_key": null,
"account_id": "493e9374-510a-4201-9e09-de669d75f256",
"name": "VISA ****1111",
"description": "VISA ****1111",
"type": "CARD",
"category": "CARD",
"country": "US",
"status": "UNENROLLED",
"created_at": "2024-06-06T13:28:57.149530Z",
"updated_at": "2024-06-06T13:31:13.945554Z",
"enrollment": {
"session": "0685f1d6-11ff-4992-abc3-9eea1842205c",
"sdk_required_action": true
},
"provider": {
"id": "YUNO",
"type": "YUNO",
"provider_status": null
},
"verify": {
"vault_on_success": false,
"payment": null
},
"preferred": null
}{
"code": "INVALID_REQUEST",
"messages": [
"Invalid request"
]
}{
"code": "INVALID_CREDENTIALS",
"messages": [
"Invalid credentials"
]
}{
"code": "AUTHORIZATION_REQUIRED",
"messages": [
"The merchant has no authorization to use this API."
]
}Unenroll Payment Method
POST
/
customers
/
payment-methods
/
{payment_method_id}
/
unenroll
Unenroll Payment Method
curl --request POST \
--url https://api-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'public-api-key': '<api-key>', 'private-secret-key': '<api-key>'}
};
fetch('https://api-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll', 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-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"private-secret-key: <api-key>",
"public-api-key: <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-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/customers/payment-methods/{payment_method_id}/unenroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "77ee4a02-da3e-4a11-ac15-ba69e1813475",
"idempotency_key": null,
"account_id": "493e9374-510a-4201-9e09-de669d75f256",
"name": "VISA ****1111",
"description": "VISA ****1111",
"type": "CARD",
"category": "CARD",
"country": "US",
"status": "UNENROLLED",
"created_at": "2024-06-06T13:28:57.149530Z",
"updated_at": "2024-06-06T13:31:13.945554Z",
"enrollment": {
"session": "0685f1d6-11ff-4992-abc3-9eea1842205c",
"sdk_required_action": true
},
"provider": {
"id": "YUNO",
"type": "YUNO",
"provider_status": null
},
"verify": {
"vault_on_success": false,
"payment": null
},
"preferred": null
}{
"code": "INVALID_REQUEST",
"messages": [
"Invalid request"
]
}{
"code": "INVALID_CREDENTIALS",
"messages": [
"Invalid credentials"
]
}{
"code": "AUTHORIZATION_REQUIRED",
"messages": [
"The merchant has no authorization to use this API."
]
}Unenroll a previously saved payment method for a customer.
To perform this action, provide the
payment_method_id in the request path. Once the request is successful, the payment method’s status will be updated to UNENROLLED, making it inactive and no longer available for use in future transactions.Authorizations
Path Parameters
The payment method id to unenroll (UUID, 36 chars).
Response
200
Example:
"77ee4a02-da3e-4a11-ac15-ba69e1813475"
Example:
"493e9374-510a-4201-9e09-de669d75f256"
Example:
"VISA ****1111"
Example:
"VISA ****1111"
Example:
"CARD"
Example:
"CARD"
Example:
"US"
Example:
"UNENROLLED"
Example:
"2024-06-06T13:28:57.149530Z"
Example:
"2024-06-06T13:31:13.945554Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?