Create account dispute
curl --request POST \
--url https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/disputes \
--header 'Content-Type: application/json' \
--data '
{
"amount": 500,
"category": "FRAUD",
"ledger_entry_token": "journal_entry_token1222"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/disputes"
payload = {
"amount": 500,
"category": "FRAUD",
"ledger_entry_token": "journal_entry_token1222"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({amount: 500, category: 'FRAUD', ledger_entry_token: 'journal_entry_token1222'})
};
fetch('https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/disputes', 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/credit/accounts/{account_token}/disputes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 500,
'category' => 'FRAUD',
'ledger_entry_token' => 'journal_entry_token1222'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/credit/accounts/{account_token}/disputes"
payload := strings.NewReader("{\n \"amount\": 500,\n \"category\": \"FRAUD\",\n \"ledger_entry_token\": \"journal_entry_token1222\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/disputes")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 500,\n \"category\": \"FRAUD\",\n \"ledger_entry_token\": \"journal_entry_token1222\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/disputes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 500,\n \"category\": \"FRAUD\",\n \"ledger_entry_token\": \"journal_entry_token1222\"\n}"
response = http.request(request)
puts response.read_body{
"notes": "fraudulent purchase",
"token": "dispute_token_1234",
"amount": 500,
"status": "ACTIVE",
"category": "FRAUD",
"resolved_at": "2023-07-01T00:27:09Z",
"created_time": "2023-07-01T00:27:09Z",
"updated_time": "2023-07-01T00:27:09Z",
"account_token": "account_token_12",
"ledger_entry_token": "journal_entry_token1222"
}{
"code": 123,
"message": "<string>"
}Credit Account Disputes
Create account dispute
Create a dispute of a journal entry on a credit account.
POST
/
credit
/
accounts
/
{account_token}
/
disputes
Create account dispute
curl --request POST \
--url https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/disputes \
--header 'Content-Type: application/json' \
--data '
{
"amount": 500,
"category": "FRAUD",
"ledger_entry_token": "journal_entry_token1222"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/disputes"
payload = {
"amount": 500,
"category": "FRAUD",
"ledger_entry_token": "journal_entry_token1222"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({amount: 500, category: 'FRAUD', ledger_entry_token: 'journal_entry_token1222'})
};
fetch('https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/disputes', 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/credit/accounts/{account_token}/disputes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 500,
'category' => 'FRAUD',
'ledger_entry_token' => 'journal_entry_token1222'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/credit/accounts/{account_token}/disputes"
payload := strings.NewReader("{\n \"amount\": 500,\n \"category\": \"FRAUD\",\n \"ledger_entry_token\": \"journal_entry_token1222\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/disputes")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 500,\n \"category\": \"FRAUD\",\n \"ledger_entry_token\": \"journal_entry_token1222\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/disputes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 500,\n \"category\": \"FRAUD\",\n \"ledger_entry_token\": \"journal_entry_token1222\"\n}"
response = http.request(request)
puts response.read_body{
"notes": "fraudulent purchase",
"token": "dispute_token_1234",
"amount": 500,
"status": "ACTIVE",
"category": "FRAUD",
"resolved_at": "2023-07-01T00:27:09Z",
"created_time": "2023-07-01T00:27:09Z",
"updated_time": "2023-07-01T00:27:09Z",
"account_token": "account_token_12",
"ledger_entry_token": "journal_entry_token1222"
}{
"code": 123,
"message": "<string>"
}POST////
Create a dispute of a journal entry on a credit account.
URL path parameters
| Fields | Description |
|---|---|
| account_token string Required | Unique identifier of the credit account for which to create a dispute. Send a GET request to /credit/accounts to retrieve existing credit account tokens.Allowable Values: Existing account token |
Request body
| Fields | Description |
|---|---|
| token string Optional | Unique identifier of the dispute. Allowable Values: 36 char max |
| ledger_entry_token string Required | Unique identifier of the journal entry (authorization.clearing type only) in dispute.Allowable Values: 36 char max Existing authorization.clearing type journal entry token |
| amount decimal Required | Amount of the dispute. Max value is equal to the value of the original transaction. Allowable Values: 0.01 min |
| category string Required | Category to which the dispute belongs. Allowable Values: FRAUD, AUTH, PROCESSING_ERROR, CONSUMER_DISPUTE |
| notes string Optional | Additional information on the dispute (for example, a reason for the dispute). Allowable Values: 750 char max |
Sample request body
JSON
{
"token": "dispute_token_1234",
"ledger_entry_token": "journal_entry_token1222",
"amount": 500,
"category": "FRAUD"
}
Response body
| Fields | Description |
|---|---|
| token string Returned | Unique identifier of the dispute. Allowable Values: 36 char max |
| ledger_entry_token string Returned | Unique identifier of the journal entry (authorization.clearing type only) in dispute.Allowable Values: Existing journal entry token |
| account_token string Returned | Unique identifier of the credit account on which the dispute was created. Allowable Values: 36 char max Existing account token |
| amount decimal Returned | Amount of the dispute. Allowable Values: Format: 0.00 |
| status string Returned | Status of the dispute. - ACTIVE - The dispute is active and awaiting resolution.- REVERSED - The dispute has been reversed and is no longer active.- AH_WON - The account holder won the dispute.- AH_LOST - The account holder lost the dispute.Allowable Values: ACTIVE, REVERSED, AH_WON, AH_LOST, REFUNDED |
| category string Returned | Category to which the dispute belongs. Allowable Values: FRAUD, AUTH, PROCESSING_ERROR, CONSUMER_DISPUTE |
| notes string Conditionally returned | Additional information on the dispute (for example, a reason for the dispute). Allowable Values: 750 char max |
| resolved_at datetime Conditionally returned | Date and time when the dispute was resolved and no longer in ACTIVE status.Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
| updated_time datetime Returned | Date and time when the dispute was last updated on Marqeta’s credit platform, in UTC. Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
| created_time datetime Returned | Date and time when the dispute was created on Marqeta’s credit platform, in UTC. Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
Sample response body
JSON
{
"token": "dispute_token_1234",
"ledger_entry_token": "journal_entry_token1222",
"account_token": "account_token_12",
"amount": 500,
"status": "ACTIVE",
"category": "FRAUD",
"notes": "fraudulent purchase",
"resolved_at": "2023-07-01T00:27:09Z",
"updated_time": "2023-07-01T00:27:09Z",
"created_time": "2023-07-01T00:27:09Z"
}
Path Parameters
Body
application/json
Information about a transaction dispute creation request.
Response
Expected response
Information about a transaction dispute response.
Status of the dispute.
ACTIVE- The dispute is active and awaiting resolution.REVERSED- The dispute has been reversed and is no longer active.AH_WON- The account holder won the dispute.AH_LOST- The account holder lost the dispute.WRITE_OFF- The dispute was written off.
Available options:
ACTIVE, REVERSED, AH_WON, AH_LOST, REFUNDED, WRITE_OFF Was this page helpful?