# Get a subscription's orders

> Retrieves the orders a subscription produced, newest first.

Source: https://help.boltapp.com/api-reference/subscriptions/subscriptions-v1/getsubscriptionorders

`GET /v1/subscriptions/{subscriptionId}/orders`

## OpenAPI definition

This endpoint as it appears in the OpenAPI document, with every schema it references included.

```json
{
  "openapi": "3.2.0",
  "info": {
    "title": "Subscriptions API",
    "version": "v1",
    "description": "API for managing subscriptions and products."
  },
  "servers": [
    {
      "url": "https://api.boltapp.com",
      "description": "The Production URL (Live Data)."
    },
    {
      "url": "https://api-sandbox.boltapp.com",
      "description": "The Sandbox URL (Test Data)."
    },
    {
      "url": "https://api-staging.boltapp.com",
      "description": "The Staging URL (Staged Data)."
    }
  ],
  "security": [
    {
      "X-API-Key": []
    },
    {
      "X-Publishable-Key": []
    }
  ],
  "paths": {
    "/v1/subscriptions/{subscriptionId}/orders": {
      "get": {
        "operationId": "getSubscriptionOrders",
        "summary": "Get a subscription's orders",
        "description": "Retrieves the orders a subscription produced, newest first.",
        "tags": [
          "Subscriptions v1"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the subscription whose orders to list.",
            "examples": {
              "default": {
                "value": "s_1234567890"
              }
            }
          }
        ],
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Publishable-Key": []
          }
        ],
        "responses": {
          "200": {
            "description": "List of subscription orders.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "orders": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SubscriptionOrder"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Subscription not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SubscriptionOrder": {
        "type": "object",
        "description": "A single billing cycle (order) generated by a subscription.",
        "required": [
          "id",
          "subscription_id",
          "transaction_reference",
          "placement_time",
          "status",
          "created_at",
          "updated_at",
          "sequence_number"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "unique identifier for the subscription order.",
            "examples": [
              "so_Vni2CsDCpT0r"
            ]
          },
          "subscription_id": {
            "type": "string",
            "description": "ID of the subscription associated with the order.",
            "examples": [
              "s_711BJEHgNnGB"
            ]
          },
          "order_id": {
            "type": "integer",
            "description": "The associated Bolt order ID, once the order has been placed.",
            "examples": [
              123456789
            ]
          },
          "placement_time": {
            "type": "string",
            "format": "date-time",
            "description": "The scheduled or actual placement time of this order."
          },
          "sequence_number": {
            "type": "integer",
            "description": "Sequential number of the order in the subscription. The 1-indexed position of this order within the subscription's billing history.",
            "examples": [
              3
            ]
          },
          "status": {
            "$ref": "#/components/schemas/SubscriptionOrderStatus",
            "description": "Status of the subscription order"
          },
          "cancel_reason": {
            "type": [
              "string",
              "null"
            ],
            "deprecated": true,
            "description": "Deprecated."
          },
          "total_amount": {
            "$ref": "#/components/schemas/AmountView"
          },
          "transaction_reference": {
            "type": "string",
            "description": "Reference ID for the transaction. The transaction reference for this order's payment attempt.",
            "examples": [
              "6CEA-ZME1-DACE"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SubscriptionOrderStatus": {
        "type": "string",
        "description": "The status of a subscription order.",
        "enum": [
          "done",
          "scheduled",
          "canceled",
          "paused",
          "payment_failed"
        ],
        "examples": [
          "done"
        ]
      },
      "AmountView": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "Amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "ISO4217 compatible currency code"
          },
          "currency_symbol": {
            "type": "string",
            "description": "Currency symbol"
          }
        }
      },
      "ApiErrorResponse": {
        "type": "object",
        "description": "Standard error envelope returned by every non-2xx response.",
        "required": [
          "result",
          "errors"
        ],
        "properties": {
          "result": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Always `false` on an error.",
                "examples": [
                  false
                ]
              }
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        },
        "examples": [
          {
            "result": {
              "success": false
            },
            "errors": [
              {
                "code": 15,
                "message": "A valid value must be provided.",
                "field": "frequency"
              }
            ]
          }
        ]
      },
      "ApiError": {
        "type": "object",
        "description": "One error of a failed request.",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "description": "Bolt error code.",
            "examples": [
              15
            ]
          },
          "message": {
            "type": "string",
            "description": "What went wrong.",
            "examples": [
              "A valid value must be provided."
            ]
          },
          "field": {
            "type": "string",
            "description": "Path of the request field the error is about, such as `product.taxable` or `plans[1].sku`. Absent when the error is not about one field.",
            "examples": [
              "frequency"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "X-API-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Admins and Developers can obtain their Bolt API key from the Bolt Merchant Dashboard. Send it together with `X-Publishable-Key`."
      },
      "X-Publishable-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Publishable-Key",
        "description": "The publicly viewable identifier used to identify a merchant division. This key is found in the Developer > API section of the Bolt Merchant Dashboard. Required. Send it together with `X-API-Key`."
      }
    }
  }
}
```
