Transition account refund status
curl --request POST \
--url https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/refunds/{refund_token}/transitions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "SUBMITTED"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/refunds/{refund_token}/transitions"
payload = { "status": "SUBMITTED" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'SUBMITTED'})
};
fetch('https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/refunds/{refund_token}/transitions', 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}/refunds/{refund_token}/transitions",
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([
'status' => 'SUBMITTED'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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}/refunds/{refund_token}/transitions"
payload := strings.NewReader("{\n \"status\": \"SUBMITTED\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/refunds/{refund_token}/transitions")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"SUBMITTED\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/refunds/{refund_token}/transitions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"SUBMITTED\"\n}"
response = http.request(request)
puts response.read_body{
"type": "PAYMENT_REFUND",
"token": "<string>",
"amount": 123,
"method": "ACH",
"status": "INITIATED",
"created_time": "2023-11-07T05:31:56Z",
"updated_time": "2023-11-07T05:31:56Z",
"account_token": "<string>",
"currency_code": "USD",
"description": "<string>",
"payment_source_token": "<string>"
}{
"code": 123,
"message": "<string>"
}Account Refunds
Transition account refund status
Use this endpoint to transition the status of a credit account refund.
POST
/
credit
/
accounts
/
{account_token}
/
refunds
/
{refund_token}
/
transitions
Transition account refund status
curl --request POST \
--url https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/refunds/{refund_token}/transitions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "SUBMITTED"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/refunds/{refund_token}/transitions"
payload = { "status": "SUBMITTED" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'SUBMITTED'})
};
fetch('https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/refunds/{refund_token}/transitions', 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}/refunds/{refund_token}/transitions",
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([
'status' => 'SUBMITTED'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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}/refunds/{refund_token}/transitions"
payload := strings.NewReader("{\n \"status\": \"SUBMITTED\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/refunds/{refund_token}/transitions")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"SUBMITTED\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/refunds/{refund_token}/transitions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"SUBMITTED\"\n}"
response = http.request(request)
puts response.read_body{
"type": "PAYMENT_REFUND",
"token": "<string>",
"amount": 123,
"method": "ACH",
"status": "INITIATED",
"created_time": "2023-11-07T05:31:56Z",
"updated_time": "2023-11-07T05:31:56Z",
"account_token": "<string>",
"currency_code": "USD",
"description": "<string>",
"payment_source_token": "<string>"
}{
"code": 123,
"message": "<string>"
}POST//////
Use the /accounts/{account_token}/refunds/{refund_token}/transitions endpoint to transition a credit account refund’s status to a new status.
URL path parameters
| Fields | Description |
|---|---|
| account_token string Required | Unique identifier of the credit account for which you want to transition a refund status. Send a GET request to /credit/accounts to retrieve existing credit account tokens.Allowable Values: Existing account token |
| refund_token string Required | Unique identifier of the refund whose status you want to transition. Send a GET request to /credit/accounts/{account_token}/refunds endpoint to retrieve existing refund tokens for a given account.Allowable Values: Existing refund token |
Request body
| Fields | Description |
|---|---|
| token string Optional | Unique identifier of the refund status transition. Allowable Values: 36 char max |
| status string Required | Current status of the refund. Allowable Values: INITIATED, PENDING, PROCESSING, SUBMITTED, CANCELLED, COMPLETED, RETURNED |
Sample request body
JSON
{
"status": "SUBMITTED"
}
Response body
| Fields | Description |
|---|---|
| token string Returned | Unique identifier of the refund. Allowable Values: 36 char max |
| account_token string Returned | Unique identifier of the account for which the refund is issued. Allowable Values: 36 char max Existing account token |
| status string Returned | Current status of the refund. Allowable Values: INITIATED, PENDING, PROCESSING, SUBMITTED, CANCELLED, COMPLETED, RETURNED |
| method string Returned | Payment instrument used to issue the refund. Allowable Values: ACH, CHECK |
| type string Returned | Type of refund. Allowable Values: PAYMENT_REFUND, CREDIT_BALANCE_REFUND |
| payment_source_token string Conditionally returned | Unique identifier of the payment source that receives the refunded amount. Allowable Values: 36 char max Existing payment source token |
| amount decimal Returned | Amount of the refund. The maximum refund amount is the amount that brings the account balance to $0. For example, $4000 is the maximum refund amount for a -$4000 account balance. Allowable Values: 0.01 min |
| currency_code string Returned | Valid three-digit ISO 4217 currency code. Allowable Values: USD |
| description string Conditionally returned | Description of the refund. Allowable Values: 255 char max |
| created_time datetime Returned | Date and time when the refund was created. Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
| updated_time datetime Returned | Date and time when the refund was last updated. Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
Authorizations
Path Parameters
Body
application/json
Response
Refund Response object.
Detailed refund response object.
Valid three-digit link:https://www.iso.org/iso-4217-currency-codes.html[ISO 4217 currency code, window="_blank"].
Available options:
USD Was this page helpful?