Prerequisites
Enable the subscription management feature
Before using the Subscription Management API, ensure that you perform the following actions:- Connect with your Marqeta representative to enable the subscription management feature for your program.
- Confirm that a card exists that is in an
ACTIVE,SUSPENDED, orLIMITEDstate.
Note
Cards in a
Cards in a
TERMINATED state or cards that have reached their expiration date cannot have stop orders placed against them.- Confirm that a recurring transaction exists for the card. You can use the value in the
transaction_tokenfield in Retrieve recurring transactions to identify the recurring transaction. Use Retrieve recurring transactions to find recurring transactions associated with a card.
About merchant ID continuity
In order to effectively block future recurring transactions for a specific merchant, the merchant ID must match the value in themerchant_id field in the original Create a stop order response. Merchant IDs are not static and can change if, for example, a merchant starts using a different acquirer or changes the location of their business. As Marqeta does not generate or assign the values for merchant IDs, changes to merchant ID values are not within Marqeta’s control.
Stop order object
The following fields are returned for stop order resources across the Subscription Management API.| Fields | Description |
|---|---|
| stop_order_token string Returned | Marqeta-assigned unique identifier for the stop order. Allowable Values: Existing stop order token |
| card_token string Returned | Token of the card on which you have placed the stop order. Allowable Values: Existing card token |
| transaction_token string Returned | Marqeta-assigned token of the original recurring transaction used to create the stop order. Allowable Values: Existing transaction token |
| merchant_id string Returned | Merchant ID (MID) as defined by the card network, derived from the original recurring transaction. Allowable Values: Existing MID |
| merchant_name string Conditionally returned | Name of the merchant. Allowable Values: 255 char max |
| stop_reason string Returned | Reason the stop order was created. Allowable Values: CANCELLED_SUBSCRIPTION, TRIAL_ENDED, UNRECOGNIZED_CHARGE, BILLING_ISSUE, MERCHANT_UNRESPONSIVE, PRICE_CHANGE, SUSPECTED_FRAUD, CARD_LOST_OR_REPLACED, OTHER |
| update_reason string Conditionally returned | Reason for the most recent update. Allowable Values: DURATION_CHANGED, ISSUED_IN_ERROR, CARDHOLDER_REQUEST, MERCHANT_RESOLVED |
| reason_description string Conditionally returned | Free-text description of the reason for the stop order or update. Allowable Values: 255 char max |
| user_token string Returned | Token of the cardholder associated with the card. Allowable Values: Existing user token |
| duration integer Returned | Duration of the stop order. Defaults to 13 if a value is not specified when the stop order is created.Max: 60Allowable Values: Integer between 1 and 60 |
| duration_unit string Returned | Unit of the duration of the stop order. Currently the only values supported for this field are MONTH and YEAR. If no value is provided, duration_unit defaults to MONTH.If a value for duration_unit is provided without also providing a value for the duration field, the endpoint returns a validation error.Allowable Values: MONTH, YEAR |
| status string Returned | Current status of the stop order. The value for this field defaults to ACTIVE upon creation of the stop order.Allowable Values: ACTIVE, CANCELLED, EXPIRED |
| created_time datetime Returned | Date and time when the resource was created, in UTC. Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
| last_modified_time datetime Returned | Date and time when the resource was last updated, in UTC. Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
| expiry_time datetime Returned | Date and time when the stop order expires, in UTC. Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
Retrieve recurring transactions
The/v3/cards/{card_token}/transactions endpoint allows you to retrieve recurring transactions from the last six months using the is_recurring query parameter.
Action: GETEndpoint:
/v3/cards/{card_token}/transactions
Path parameters
| Fields | Description |
|---|---|
| card_token string Required | Token of the card for which to retrieve transactions. Allowable Values: Existing card token |
URL query parameters
| Fields | Description |
|---|---|
| is_recurring boolean Required | Set to true to filter only recurring transactions.Allowable Values: true, falseDefault: false |
| start_date string Optional | Start of the date range filter. If a value for this field is provided, a value for end_date must also be specified.If there are no values provided for both start_date and end_date, then the endpoint retrieves results for the six months prior to the current date.The maximum window allowed between start_date and end_date is six months. If the date range exceeds six months, the endpoint returns 400 Bad Request.Allowable Values: Date in yyyy-MM-dd or yyyy-MM-ddThh:mm:ssZ format |
| end_date string Optional | Ending date of the range provided for the filter. If a value for end_date is provided, then start_date must also be specified.If there are no values provided for both start_date and end_date, then the endpoint retrieves results for the six months prior to the current date.The maximum window allowed between start_date and end_date is six months. If the date range exceeds six months, then the endpoint returns 400 Bad Request.Allowable Values: Date in yyyy-MM-dd or yyyy-MM-ddThh:mm:ssZ format |
Response body
| Fields | Description |
|---|---|
| count integer Conditionally returned | Number of resources to retrieve. This field is returned if there are resources in your returned array. Allowable Values: 1-10 |
| data array of objects Conditionally returned | Valid array of transaction objects. For more information, see the description of the transaction object on the Transactions page. Objects are returned based on your query. Allowable Values: Valid array of one or more transaction objects |
| end_index integer Conditionally returned | Sort order index of the last resource in the returned array. This field is returned if there are resources in your returned array. Allowable Values: Any integer |
| is_more boolean Conditionally returned | A value of true indicates that more unreturned resources exist. A value of false indicates that all resources have been returned.This field is returned if there are resources in your returned array. Allowable Values: true, false |
| start_index integer Conditionally returned | Sort order index of the first resource in the returned array. This field is returned if there are resources in your returned array. Allowable Values: Any integer |
Sample response
JSON
Create a stop order
Places a new stop order to block future recurring transactions from a specific merchant for a given card.Note
If you reissue a card whose source card had a stop order on it, the stop order will not carry over to the reissued card. You must create a new stop order for the reissued card if you would like to continue blocking future recurring transactions.
If you reissue a card whose source card had a stop order on it, the stop order will not carry over to the reissued card. You must create a new stop order for the reissued card if you would like to continue blocking future recurring transactions.
POSTEndpoint:
/v3/cards/{card_token}/stoporders
Path parameters
| Fields | Description |
|---|---|
| card_token string Required | Token of the card on which to place the stop order. Allowable Values: Existing card token |
Request body
| Fields | Description |
|---|---|
| transaction_token string Required | Marqeta-assigned token identifying the recurring transaction series. Allowable Values: Existing transaction token |
| stop_reason string Required | Reason for the stop order. Allowable Values: CANCELLED_SUBSCRIPTION - Cardholder canceled the subscription.TRIAL_ENDED - Free trial period has ended.UNRECOGNIZED_CHARGE - Cardholder does not recognize the charge.BILLING_ISSUE - Billing dispute or problem.MERCHANT_UNRESPONSIVE - Merchant is not responding to cancellation requests.PRICE_CHANGE - Subscription price changed unexpectedly.SUSPECTED_FRAUD - Potential fraudulent activity.CARD_LOST_OR_REPLACED - Card was lost, stolen, or replaced.OTHER - Other reason. Use the reason_description field for details. |
| reason_description string Optional | Free-text description of the reason. Allowable Values: 255 char max |
| duration integer Optional | Duration of the stop order. Defaults to 13 if a value for this field is not provided.Max: 60.Allowable Values: Integer between 1 and 60 |
| duration_unit string Optional | Unit of the duration of the stop order. Currently the only values supported for this field are MONTH and YEAR. If no value is provided, duration_unit defaults to MONTH.If a value for duration_unit is provided without also providing a value for the duration field, then the endpoint returns a validation error.Allowable Values: MONTH, YEAR |
Response body
See Stop order object.Sample request
JSON
Sample response
JSON
List stop orders for a card
Returns a paginated list of all stop orders for the given card token, sorted by last modified time. For errors associated with listing a stop order for a card, see the Errors page. Action:GETEndpoint:
/v3/cards/{card_token}/stoporders
Path parameters
| Fields | Description |
|---|---|
| card_token string Required | Token of the card on which you have placed a stop order. Allowable Values: Existing card token |
Response body
| Fields | Description |
|---|---|
| count integer Conditionally returned | Number of resources to retrieve. This field is returned if there are resources in your returned array. Allowable Values: 1-10 |
| data array of objects Conditionally returned | Array of stop order objects. Allowable Values: Valid array of one or more stop order objects |
| end_index integer Conditionally returned | Sort order index of the last resource in the returned array. This field is returned if there are resources in your returned array. Allowable Values: Any integer |
| is_more boolean Conditionally returned | A value of true indicates that more unreturned resources exist. A value of false indicates that all resources have been returned.This field is returned if there are resources in your returned array. Allowable Values: true, false |
| start_index integer Conditionally returned | Sort order index of the first resource in the returned array. This field is returned if there are resources in your returned array. Allowable Values: Any integer |
| data[].* object Conditionally returned | See Stop order object. |
Sample response
JSON
Retrieve a specific stop order
Returns the details of a single stop order. Action:GETEndpoint:
/v3/cards/{card_token}/stoporders/{stop_order_token}
Path parameters
| Fields | Description |
|---|---|
| card_token string Required | Token of the card on which you have placed a stop order. Allowable Values: Existing card token |
| stop_order_token string Required | Marqeta-assigned unique identifier for the stop order. Allowable Values: Existing stop order token |
Response body
See Stop order object.Sample response
JSON
Update stop order
Updates an existing stop order. Use this endpoint to cancel a stop order or change its duration. Action:PUTEndpoint:
/v3/cards/{card_token}/stoporders/{stop_order_token}
Path parameters
| Fields | Description |
|---|---|
| card_token string Required | Token of the card on which you have placed a stop order. Allowable Values: Existing card token |
| stop_order_token string Required | Marqeta-assigned unique identifier for the stop order. Allowable Values: Existing stop order token |
Request body
| Fields | Description |
|---|---|
| status string Required | New status for the stop order. Allowable Values: ACTIVE, CANCELLED |
| update_reason string Required | Reason for the update. Allowable Values: DURATION_CHANGED - The stop order duration has been modified.ISSUED_IN_ERROR - The stop order was placed by mistake.CARDHOLDER_REQUEST - The cardholder requested the change.MERCHANT_RESOLVED - The issue with the merchant has been resolved. |
| reason_description string Optional | Free-text description of the update reason. Allowable Values: 255 char max |
| duration integer Optional | New duration of the stop order. Max: 60.Allowable Values: Integer between 1 and 60 |
| duration_unit string Optional | Unit for the new duration of the stop order. Currently the only values supported for this field are MONTH and YEAR. If no value is provided, duration_unit defaults to MONTH.If a value for duration_unit is provided without also providing a value for the duration field, then the endpoint returns a validation error.Allowable Values: MONTH, YEAR |
Response body
See Stop order object.Sample request
JSON
Sample response
JSON
Stop order declines
After placing a stop order on a recurring transaction for a specific merchant, Marqeta will automatically decline any subsequent occurrences of that transaction with the response code1949 (Decline recurring transaction by cardholder) during the authorization process.
This decline reason code is mapped to card networks with the following values:
| Network | Code |
|---|---|
| Visa | R1 |
| Mastercard | 05 |
| Pulse | ST |
| Discover | ST |
Note
If you are a JIT Gateway program, you can choose to perform authorization decisioning internally and decline JIT requests with the
If you are a JIT Gateway program, you can choose to perform authorization decisioning internally and decline JIT requests with the
REVOCATION_AUTHORIZATION_ORDER reason code. Marqeta will then translate this reason code to the associated card network decline reason code and send it to the card network.Stop order statuses
| Status | Description |
|---|---|
ACTIVE | Stop order is in effect. Matching recurring transactions will be declined. |
CANCELLED | Stop order has been manually canceled via the update endpoint. |
EXPIRED | Stop order has passed its expiry date. |
Status lifecycle
When you create a stop order, its default status isACTIVE. After creation, you can transition the stop order to CANCELLED via the Update stop order endpoint. If you do not cancel the stop order, it automatically transitions to EXPIRED when the expiry_time is reached.
Note
Only orders in an
Only orders in an
ACTIVE state transition to an EXPIRED state when the expiry date is reached.Canceled orders remain in CANCELLED state when the expiry date is reached.