Unenroll Payment Method
curl --request POST \
--url https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll \
--header 'X-Idempotency-Key: <api-key>' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"X-Idempotency-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>',
'X-Idempotency-Key': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/customers/{customer_id}/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/{customer_id}/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 => [
"X-Idempotency-Key: <api-key>",
"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/{customer_id}/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>")
req.Header.Add("X-Idempotency-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/{customer_id}/payment-methods/{payment_method_id}/unenroll")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("X-Idempotency-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/customers/{customer_id}/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>'
request["X-Idempotency-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "cbdcc878-ceb4-4dd8-b0f0-49d444855de0",
"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:32:49.715656Z",
"updated_at": "2024-06-06T13:37:38.891106Z",
"enrollment": {
"session": "",
"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
/
{customer_id}
/
payment-methods
/
{payment_method_id}
/
unenroll
Unenroll Payment Method
curl --request POST \
--url https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll \
--header 'X-Idempotency-Key: <api-key>' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"X-Idempotency-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>',
'X-Idempotency-Key': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/customers/{customer_id}/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/{customer_id}/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 => [
"X-Idempotency-Key: <api-key>",
"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/{customer_id}/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>")
req.Header.Add("X-Idempotency-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/{customer_id}/payment-methods/{payment_method_id}/unenroll")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("X-Idempotency-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/customers/{customer_id}/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>'
request["X-Idempotency-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "cbdcc878-ceb4-4dd8-b0f0-49d444855de0",
"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:32:49.715656Z",
"updated_at": "2024-06-06T13:37:38.891106Z",
"enrollment": {
"session": "",
"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 saved payment method for the user. Once you’ve done the POST to the unenrollment endpoint, the payment method status will be changed to UNENROLLED.
Unenrollment InformationTo unenroll the payment method, you need to provide the
payment_method_id, which is the vaulted_token received when using the Enroll Payment Method endpoint.Authorizations
Path Parameters
The unique identifier of the customer (UUID, 36 chars).
The unique identifier of the payment method. This is the vaulted_token received when enrolling a payment method using Enroll Payment Method (UUID, 36 chars).
Response
200
Example:
"cbdcc878-ceb4-4dd8-b0f0-49d444855de0"
Example:
"493e9374-510a-4201-9e09-de669d75f256"
Example:
"VISA ****1111"
Example:
"VISA ****1111"
Example:
"CARD"
Example:
"CARD"
Example:
"US"
Example:
"UNENROLLED"
Example:
"2024-06-06T13:32:49.715656Z"
Example:
"2024-06-06T13:37:38.891106Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?