---
updatedAt: 2026-06-05T22:10:56.000Z
agentTools:
  projectIndex: https://docs.astra.finance/llms.txt
---

# Routine Preview

> 📘
>
> You can place the bearer `access_token` for a specific user into the Authentication section of this documentation 👉.

This endpoint returns a fee structure payload as a response, which provides a preview of what the fee structure will be upon submitting a routine with the same parameters.

> 🚧
>
> This endpoint can only be used for previewing routines of a `debit` `payment_type`.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Astra Developer API",
    "description": "Astra's public API endpoints available to our customers.",
    "version": "1.0.0"
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "headers": {
      "request-id": {
        "description": "Unique ID returned with each API response",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "generic_error": {
        "type": "object",
        "properties": {
          "code": {
            "description": "Response code",
            "type": "integer"
          },
          "name": {
            "description": "Name of response code",
            "type": "string"
          },
          "description": {
            "description": "Error message",
            "type": "string"
          }
        }
      },
      "generic_error_with_note": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "developer_note": {
                "description": "Field for developer notes",
                "type": "string"
              }
            }
          },
          {
            "$ref": "#/components/schemas/generic_error"
          }
        ]
      }
    },
    "examples": {
      "routine_error_source_card_errors": {
        "summary": "Source Card Errors List",
        "value": {
          "DEVELOPER_NOTE": "DEVELOPER_NOTE field not included in the actual response.  description field is of type string, and will produce only one of the following error messages.",
          "code": 400,
          "name": "Bad Request",
          "description": [
            "Source card address could not be verified.",
            "Source card is not enabled for pull-from-card transactions.",
            "Source card is not a debit card.",
            "Source card is pending approval.",
            "Source card is expired.",
            "Source card is not authorized for use."
          ]
        }
      },
      "routine_error_destination_card_errors": {
        "summary": "Destination Card Errors List",
        "value": {
          "DEVELOPER_NOTE": "DEVELOPER_NOTE field not included in the actual response.  description field is of type string, and will produce only one of the following error messages.",
          "code": 400,
          "name": "Bad Request",
          "description": [
            "Destination card address could not be verified.",
            "Destination card is not enabled for push-to-card transactions.",
            "Destination card is not a debit card.",
            "Destination card is pending approval.",
            "Destination card is expired.",
            "Destination card is not authorized for use."
          ]
        }
      },
      "routine_error_same_card": {
        "summary": "Same card",
        "value": {
          "code": 400,
          "name": "Bad Request",
          "description": "Source card and destination card may not be the same card."
        }
      },
      "routine_error_velocity_limit": {
        "summary": "Velocity limit",
        "value": {
          "code": 400,
          "name": "Bad Request",
          "description": "User has reached the velocity limit for debit transfers."
        }
      },
      "routine_error_card_type": {
        "summary": "Card type",
        "value": {
          "code": 400,
          "name": "Bad Request",
          "description": "Both source and destination must be debit cards."
        }
      },
      "routine_error_source_card_not_authorized": {
        "summary": "Source card is blacklisted",
        "value": {
          "code": 403,
          "name": "Forbidden",
          "description": "Source card is not authorized for use."
        }
      },
      "routine_error_destination_card_not_authorized": {
        "summary": "Destination card is blacklisted",
        "value": {
          "code": 403,
          "name": "Forbidden",
          "description": "Destination card is not authorized for use."
        }
      },
      "generic_error_unauthorized": {
        "summary": "Invalid or Expired Access Token",
        "value": {
          "code": 401,
          "name": "Unauthorized",
          "description": null
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api-sandbox.astra.finance",
      "description": "Sandbox Environment"
    },
    {
      "url": "https://secure.api-sandbox.astra.finance",
      "description": "Secure Sandbox URL"
    }
  ],
  "tags": [
    {
      "name": "Routines"
    }
  ],
  "paths": {
    "/v1/routines/preview": {
      "post": {
        "tags": [
          "Routines"
        ],
        "summary": "Routine Preview",
        "description": "> 📘\n>\n> You can place the bearer `access_token` for a specific user into the Authentication section of this documentation 👉.\n\nThis endpoint returns a fee structure payload as a response, which provides a preview of what the fee structure will be upon submitting a routine with the same parameters.\n\n> 🚧\n>\n> This endpoint can only be used for previewing routines of a `debit` `payment_type`.\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "The type of Routine",
                    "enum": [
                      "one-time",
                      "recurring"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "description": "The name given for the Routine"
                  },
                  "payment_type": {
                    "type": "string",
                    "description": "The type of payment",
                    "enum": [
                      "debit"
                    ]
                  },
                  "source_id": {
                    "type": "string",
                    "description": "The ID of the Source Account"
                  },
                  "destination_id": {
                    "type": "string",
                    "description": "The ID of the Destination Account"
                  },
                  "destination_user_id": {
                    "type": "string",
                    "description": "The User ID associated with the Destination Account (required if the destination_id does not belong to the authenticating User)"
                  },
                  "amount": {
                    "type": "number",
                    "format": "float",
                    "description": "The amount of the transfer (when explicitly defined like one-time)"
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Optional. The date the Routine should start processing (Pacific Timezone). If not supplied, the start_date will default to the current day (in the Pacific Timezone). Debit start dates cannot be in the future."
                  },
                  "customer_debit_fee_percent_override": {
                    "type": "number",
                    "format": "float",
                    "description": "Optional parameter for applying a fee to a debit transfer through either an addition on the pull or a subtraction on the push. Contact your Astra admin to configure your clients to have this percentage fee be either additive or subtractive. For debit transfers only. Example amount: 1.25 = 1.25%"
                  }
                },
                "required": [
                  "type",
                  "name",
                  "payment_type",
                  "source_id",
                  "destination_id",
                  "amount"
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Successful response",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The unique ID of the Routine"
                    },
                    "astra_fee": {
                      "type": "number",
                      "format": "float",
                      "description": "Astra's fee for the transfer"
                    },
                    "created": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Date and time of routine preview creation"
                    },
                    "customer_fee": {
                      "type": "number",
                      "format": "float",
                      "description": "Customer fee for the transfer"
                    },
                    "destination": {
                      "type": "string",
                      "description": "The ID of the Destination Account"
                    },
                    "destination_user_id": {
                      "type": "string",
                      "description": "The User ID associated with the Destination Account (required if the destination_id does not belong to the authenticating User)"
                    },
                    "estimated_settlement": {
                      "type": "string",
                      "description": "Estimated settlement speed"
                    },
                    "payment_type": {
                      "type": "string",
                      "description": "Type of payment",
                      "enum": [
                        "debit"
                      ]
                    },
                    "pull_amount": {
                      "type": "number",
                      "format": "float",
                      "description": "Pull amount for the transfer"
                    },
                    "push_amount": {
                      "type": "number",
                      "format": "float",
                      "description": "Push amount for the transfer"
                    },
                    "routine_type": {
                      "type": "string",
                      "description": "The type of Routine",
                      "enum": [
                        "one-time",
                        "recurring"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "description": "The ID of the Source Account"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/generic_error"
                    },
                    {
                      "$ref": "#/components/schemas/generic_error_with_note"
                    }
                  ]
                },
                "examples": {
                  "routine_error_source_card_errors": {
                    "$ref": "#/components/examples/routine_error_source_card_errors"
                  },
                  "routine_error_destination_card_errors": {
                    "$ref": "#/components/examples/routine_error_destination_card_errors"
                  },
                  "card_type": {
                    "$ref": "#/components/examples/routine_error_card_type"
                  },
                  "same_card": {
                    "$ref": "#/components/examples/routine_error_same_card"
                  },
                  "velocity_limit": {
                    "$ref": "#/components/examples/routine_error_velocity_limit"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/generic_error"
                },
                "examples": {
                  "generic_error_unauthorized": {
                    "$ref": "#/components/examples/generic_error_unauthorized"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/generic_error"
                    }
                  ]
                },
                "examples": {
                  "source_card_not_authorized": {
                    "$ref": "#/components/examples/routine_error_source_card_not_authorized"
                  },
                  "dest_card_not_authorized": {
                    "$ref": "#/components/examples/routine_error_destination_card_not_authorized"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  }
}
```