Delete a saved payment method
curl --request DELETE \
--url https://api.sandbox.primer.io/payment-instruments/{token} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.sandbox.primer.io/payment-instruments/{token}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.sandbox.primer.io/payment-instruments/{token}', 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.primer.io/payment-instruments/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"X-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.primer.io/payment-instruments/{token}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-API-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.delete("https://api.sandbox.primer.io/payment-instruments/{token}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.primer.io/payment-instruments/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"createdAt": "2021-03-01T12:00:00.123456",
"token": "_xlXlmBcTnuFxc2N3HAI73wxNjE1NTU5ODY5",
"tokenType": "MULTI_USE",
"analyticsId": "vuXhpZouWxaZpRZ-x_brZmtT",
"paymentMethodType": "PAYMENT_CARD",
"paymentMethodData": {
"last4Digits": "1111",
"expirationMonth": "12",
"expirationYear": "2030",
"cardholderName": "John Biggins",
"network": "Visa",
"networkTransactionId": "020210628190752",
"accountFundingType": "DEBIT"
},
"customerId": "customer-123",
"deleted": false,
"default": true
}{
"error": {
"errorId": "InvalidPaymentInstrumentToken",
"description": "Invalid payment instrument.",
"diagnosticsId": "1234567898"
}
}Delete a saved payment method
Delete a saved payment method.
DELETE
/
payment-instruments
/
{token}
Delete a saved payment method
curl --request DELETE \
--url https://api.sandbox.primer.io/payment-instruments/{token} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.sandbox.primer.io/payment-instruments/{token}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.sandbox.primer.io/payment-instruments/{token}', 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.primer.io/payment-instruments/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"X-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.primer.io/payment-instruments/{token}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-API-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.delete("https://api.sandbox.primer.io/payment-instruments/{token}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.primer.io/payment-instruments/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"createdAt": "2021-03-01T12:00:00.123456",
"token": "_xlXlmBcTnuFxc2N3HAI73wxNjE1NTU5ODY5",
"tokenType": "MULTI_USE",
"analyticsId": "vuXhpZouWxaZpRZ-x_brZmtT",
"paymentMethodType": "PAYMENT_CARD",
"paymentMethodData": {
"last4Digits": "1111",
"expirationMonth": "12",
"expirationYear": "2030",
"cardholderName": "John Biggins",
"network": "Visa",
"networkTransactionId": "020210628190752",
"accountFundingType": "DEBIT"
},
"customerId": "customer-123",
"deleted": false,
"default": true
}{
"error": {
"errorId": "InvalidPaymentInstrumentToken",
"description": "Invalid payment instrument.",
"diagnosticsId": "1234567898"
}
}Authorizations
Path Parameters
Saved payment method token to delete. Payment method token
Response
Successful Response
Creation date & time of the object (UTC)
Date & time when this object was revoked. (UTC)
Whether or not this object has been revoked.
The vaulted payment method token.
MULTI_USEa vaulted token that can be re-used with subsequent payments
Unique analytics identifier corresponding to a payment method
Payment method type associated with a token.
Available options:
PAYMENT_CARD, PAYPAL_ORDER, PAYPAL_BILLING_AGREEMENT, KLARNA_AUTHORIZATION_TOKEN, KLARNA_CUSTOMER_TOKEN, PAY_NL_IDEAL, APAYA, OFF_SESSION_PAYMENT, CARD_OFF_SESSION_PAYMENT, APPLE_PAY, APPLE_PAY_ENCRYPTED_TOKEN, GOOGLE_PAY, AUTOMATED_CLEARING_HOUSE Used exclusively by the Payment Methods API
- PaymentCardTokenAPISchemaPaymentMethodsAPI
- PayPalBillingAgreementAPISchema
- GoCardlessMandateAPISchema
- KlarnaCustomerTokenAPISchema
- ApayaCustomerTokenAPISchema
Show child attributes
Show child attributes
The ID representing the customer
Whether or not this payment method is the default