Create payment schedule
curl --request POST \
--url https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/paymentschedules \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"frequency": "MONTHLY",
"currency_code": "USD",
"amount_category": "FIXED"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/paymentschedules"
payload = {
"frequency": "MONTHLY",
"currency_code": "USD",
"amount_category": "FIXED"
}
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({frequency: 'MONTHLY', currency_code: 'USD', amount_category: 'FIXED'})
};
fetch('https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/paymentschedules', 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}/paymentschedules",
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([
'frequency' => 'MONTHLY',
'currency_code' => 'USD',
'amount_category' => 'FIXED'
]),
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}/paymentschedules"
payload := strings.NewReader("{\n \"frequency\": \"MONTHLY\",\n \"currency_code\": \"USD\",\n \"amount_category\": \"FIXED\"\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}/paymentschedules")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"frequency\": \"MONTHLY\",\n \"currency_code\": \"USD\",\n \"amount_category\": \"FIXED\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/paymentschedules")
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 \"frequency\": \"MONTHLY\",\n \"currency_code\": \"USD\",\n \"amount_category\": \"FIXED\"\n}"
response = http.request(request)
puts response.read_body{
"token": "4749ab00-fec1-471c-ac5b-b8d31d06d7e4",
"amount": 2500,
"status": "COMPLETED",
"frequency": "ONCE",
"description": "Scheduled account payment",
"created_time": "2024-01-12T15:03:09.717Z",
"account_token": "12f10563-d5f2-11ec-889b-bd3a73e55331",
"currency_code": "USD",
"amount_category": "FIXED",
"payment_source_token": "7d68f45b-1232-4283-a0ea-6b0418d37692",
"next_payment_impact_date": "2024-01-31"
}{
"code": 123,
"message": "<string>"
}Payment Schedules
Create payment schedule
Create a new payment schedule, either one-time or recurring.
POST
/
credit
/
accounts
/
{account_token}
/
paymentschedules
Create payment schedule
curl --request POST \
--url https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/paymentschedules \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"frequency": "MONTHLY",
"currency_code": "USD",
"amount_category": "FIXED"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/paymentschedules"
payload = {
"frequency": "MONTHLY",
"currency_code": "USD",
"amount_category": "FIXED"
}
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({frequency: 'MONTHLY', currency_code: 'USD', amount_category: 'FIXED'})
};
fetch('https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/paymentschedules', 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}/paymentschedules",
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([
'frequency' => 'MONTHLY',
'currency_code' => 'USD',
'amount_category' => 'FIXED'
]),
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}/paymentschedules"
payload := strings.NewReader("{\n \"frequency\": \"MONTHLY\",\n \"currency_code\": \"USD\",\n \"amount_category\": \"FIXED\"\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}/paymentschedules")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"frequency\": \"MONTHLY\",\n \"currency_code\": \"USD\",\n \"amount_category\": \"FIXED\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/paymentschedules")
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 \"frequency\": \"MONTHLY\",\n \"currency_code\": \"USD\",\n \"amount_category\": \"FIXED\"\n}"
response = http.request(request)
puts response.read_body{
"token": "4749ab00-fec1-471c-ac5b-b8d31d06d7e4",
"amount": 2500,
"status": "COMPLETED",
"frequency": "ONCE",
"description": "Scheduled account payment",
"created_time": "2024-01-12T15:03:09.717Z",
"account_token": "12f10563-d5f2-11ec-889b-bd3a73e55331",
"currency_code": "USD",
"amount_category": "FIXED",
"payment_source_token": "7d68f45b-1232-4283-a0ea-6b0418d37692",
"next_payment_impact_date": "2024-01-31"
}{
"code": 123,
"message": "<string>"
}POST////
Create a new payment schedule, either one-time or recurring.
URL path parameters
| Fields | Description |
|---|---|
| account_token string Required | Unique identifier of the credit account for which you want to create a payment schedule. 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 payment schedule. Allowable Values: 36 char max |
| payment_source_token string Required | Unique identifier of the payment source. Allowable Values: 36 char max Existing payment source token |
| amount_category string Required | A category used to determine the actual payment amount. Allowable Values: FIXED, MINIMUM_PAYMENT, REMAINING_STATEMENT_BALANCE, CURRENT_BALANCE |
| amount decimal Optional | Amount of the payment. Required if amount_category is FIXED.Allowable Values: Format: 0.00 |
| frequency string Required | Defines how often to make a scheduled payment. Allowable Values: ONCE, MONTHLY |
| payment_day string Optional | Day on which monthly payments are made. Required if frequency is MONTHLY.Allowable Values: PAYMENT_DUE_DAY |
| next_payment_impact_date date Optional | Date to make a one-time payment. Required if frequency is ONCE.Allowable Values: Format: yyyy-MM-dd |
| currency_code string Required | Valid three-digit ISO 4217 currency code. Allowable Values: USD |
| description string Optional | Description of the payment schedule. Allowable Values: 255 char max |
Sample request body
JSON
{
"token": "payment_schedule_token_1239",
"payment_source_token": "payment_source_token_1112",
"amount_category": "FIXED",
"amount": 100,
"frequency": "MONTHLY",
"payment_day": "PAYMENT_DUE_DAY",
"currency_code": "USD",
"description": "Account statement payment"
}
Response body
| Fields | Description |
|---|---|
| token string Returned | Unique identifier of the payment schedule. Allowable Values: 36 char max |
| payment_source_token string Returned | Unique identifier of a payment source. Allowable Values: Existing payment source token |
| account_token string Returned | Unique identifier of the credit account on which the payment schedule is made. Allowable Values: Existing account token |
| amount_category string Returned | A category used to determine the actual payment amount. Allowable Values: FIXED, MINIMUM_PAYMENT, REMAINING_STATEMENT_BALANCE, CURRENT_BALANCE |
| status string Returned | Status of the payment schedule. Allowable Values: ACTIVE, COMPLETED, TERMINATED |
| amount decimal Conditionally returned | Amount of the payment. Returned if the amount_category is FIXED.Allowable Values: Format: 0.00 |
| frequency string Returned | Defines how often to make a scheduled payment. Allowable Values: ONCE, MONTHLY |
| payment_day string Conditionally returned | Day on which monthly payments are made. Returned if the frequency is MONTHLY.Allowable Values: PAYMENT_DUE_DAY |
| next_payment_impact_date date Conditionally returned | Date to make a one-time payment. Returned if frequency is ONCE.Allowable Values: Format: yyyy-MM-dd |
| currency_code string Returned | Valid three-digit ISO 4217 currency code. Allowable Values: USD |
| description string Conditionally returned | Description of the payment schedule. Allowable Values: 255 char max |
| created_time datetime Conditionally returned | Date and time when the payment schedule was created on Marqeta’s credit platform, in UTC. Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
| updated_time datetime Conditionally returned | Date and time when the payment schedule was last updated on Marqeta’s credit platform, in UTC. Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
Sample response body
JSON
{
"token": "4749ab00-fec1-471c-ac5b-b8d31d06d7e4",
"account_token": "12f10563-d5f2-11ec-889b-bd3a73e55331",
"payment_source_token": "7d68f45b-1232-4283-a0ea-6b0418d37692",
"amount_category": "FIXED",
"status": "COMPLETED",
"amount": 2500,
"frequency": "ONCE",
"next_payment_impact_date": "2024-01-31",
"currency_code": "USD",
"description": "Scheduled account payment",
"created_time": "2024-01-12T15:03:09.717Z"
}
Authorizations
Path Parameters
Body
application/json
Information to create a payment schedule.
Valid three-digit link:https://www.iso.org/iso-4217-currency-codes.html[ISO 4217 currency code, window="_blank"].
Available options:
USD Response
Newly created payment schedule.
A future one-time or recurring payment schedule.
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?