curl --request PUT \
--url https://sandbox-api.marqeta.com/v3/exception-file/{cardToken} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'X-Marqeta-Program-Short-Code: <x-marqeta-program-short-code>' \
--data '
{
"action_code": "EXPC"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/exception-file/{cardToken}"
payload = { "action_code": "EXPC" }
headers = {
"X-Marqeta-Program-Short-Code": "<x-marqeta-program-short-code>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Marqeta-Program-Short-Code': '<x-marqeta-program-short-code>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({action_code: 'EXPC'})
};
fetch('https://sandbox-api.marqeta.com/v3/exception-file/{cardToken}', 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://sandbox-api.marqeta.com/v3/exception-file/{cardToken}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'action_code' => 'EXPC'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"X-Marqeta-Program-Short-Code: <x-marqeta-program-short-code>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.marqeta.com/v3/exception-file/{cardToken}"
payload := strings.NewReader("{\n \"action_code\": \"EXPC\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Marqeta-Program-Short-Code", "<x-marqeta-program-short-code>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox-api.marqeta.com/v3/exception-file/{cardToken}")
.header("X-Marqeta-Program-Short-Code", "<x-marqeta-program-short-code>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"action_code\": \"EXPC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/exception-file/{cardToken}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Marqeta-Program-Short-Code"] = '<x-marqeta-program-short-code>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action_code\": \"EXPC\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Request accepted for processing"
}{
"message": "Program is not onboarded for the Exception File Management feature"
}{
"message": "Card token is not found"
}{
"message": "No exception file entry exists for the specified card token. Use POST to create a new entry."
}{
"message": "Unable to process the request. Please retry later"
}Update Card on Exception File
Updates an existing card record on the exception file
curl --request PUT \
--url https://sandbox-api.marqeta.com/v3/exception-file/{cardToken} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'X-Marqeta-Program-Short-Code: <x-marqeta-program-short-code>' \
--data '
{
"action_code": "EXPC"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/exception-file/{cardToken}"
payload = { "action_code": "EXPC" }
headers = {
"X-Marqeta-Program-Short-Code": "<x-marqeta-program-short-code>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Marqeta-Program-Short-Code': '<x-marqeta-program-short-code>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({action_code: 'EXPC'})
};
fetch('https://sandbox-api.marqeta.com/v3/exception-file/{cardToken}', 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://sandbox-api.marqeta.com/v3/exception-file/{cardToken}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'action_code' => 'EXPC'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"X-Marqeta-Program-Short-Code: <x-marqeta-program-short-code>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.marqeta.com/v3/exception-file/{cardToken}"
payload := strings.NewReader("{\n \"action_code\": \"EXPC\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Marqeta-Program-Short-Code", "<x-marqeta-program-short-code>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox-api.marqeta.com/v3/exception-file/{cardToken}")
.header("X-Marqeta-Program-Short-Code", "<x-marqeta-program-short-code>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"action_code\": \"EXPC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/exception-file/{cardToken}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Marqeta-Program-Short-Code"] = '<x-marqeta-program-short-code>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action_code\": \"EXPC\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Request accepted for processing"
}{
"message": "Program is not onboarded for the Exception File Management feature"
}{
"message": "Card token is not found"
}{
"message": "No exception file entry exists for the specified card token. Use POST to create a new entry."
}{
"message": "Unable to process the request. Please retry later"
}POST request.
The Marqeta platform processes this request asynchronously.
Subscribe to the pan.exception_file.updated webhook event to confirm when the card network completes the action.Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Headers
Program short code of the program managing the card.
Path Parameters
Card token to be updated on the exception file.
Body
Request to add or update a card on the exception file.
Code representing the action to be taken on the card.
CLOS- Card terminated / closed accountLCPU- Lost cardSCPU- Stolen cardINVA- Invalid / not found accountPUWF- Fraud pickup (non-specific)PUNF- Pickup (no fraud)EXPC- Expired card (authorization only; declines with response code 54)DNTH- General block (authorization only; declines with response code 05)
CLOS, LCPU, SCPU, INVA, PUWF, PUNF, EXPC, DNTH Purge date of the record in exception file, in YYYY-MM-DD format. Evaluated in UTC. Must be between 30 days and 24 months from the current date. Defaults to 90 days from the current date if not provided.
^\d{4}-\d{2}-\d{2}$Response
Request accepted for processing. The card is updated on the exception file asynchronously.
Human-readable message describing the result of the request.
Was this page helpful?