{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recurly/json-schema/recurly-billing-attempt-dto-schema.json",
  "title": "BillingAttemptDto",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/recurly-commerce-openapi.yml#/components/schemas/BillingAttemptDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "createdAt": {
      "format": "date-time",
      "type": "string"
    },
    "updatedAt": {
      "format": "date-time",
      "type": "string"
    },
    "externalId": {
      "type": "string"
    },
    "subscriptionId": {
      "type": "string"
    },
    "relatedSubscriptionIds": {
      "description": "Every subscription this billing attempt covers. For a combined order, this includes the driver subscription (subscriptionId) plus every other subscription billed in the same attempt. For a solo billing attempt, this is just [subscriptionId].",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "orderId": {
      "type": [
        "string",
        "null"
      ]
    },
    "errorMsg": {
      "type": [
        "string",
        "null"
      ]
    },
    "errorCode": {
      "type": [
        "string",
        "null"
      ]
    },
    "ready": {
      "type": "boolean",
      "description": "Whether the billing attempt is still processing."
    },
    "trigger": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "RENEWAL_TASK",
        "ANCHOR_RENEWAL_TASK",
        "DUNNING_RETRY",
        "UPDATE_PAYMENT_METHOD",
        "PROCESS_NOW"
      ]
    },
    "paymentMethodExternalId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The shopify payment method card ID"
    },
    "paymentMethodType": {
      "type": [
        "string",
        "null"
      ],
      "description": "The payment method card type",
      "enum": [
        "CustomerCreditCard",
        "CustomerPaypalBillingAgreement",
        "CustomerShopPayAgreement"
      ]
    },
    "paymentMethodLast4Digits": {
      "type": [
        "string",
        "null"
      ],
      "description": "The payment method last 4 digits"
    },
    "paymentMethodExpiryMonth": {
      "type": [
        "string",
        "null"
      ],
      "description": "The payment method expiry month"
    },
    "paymentMethodExpiryYear": {
      "type": [
        "string",
        "null"
      ],
      "description": "The payment method expiry year"
    },
    "paymentMethodBrand": {
      "type": [
        "string",
        "null"
      ],
      "description": "The payment method card brand"
    },
    "paymentMethodEmail": {
      "type": [
        "string",
        "null"
      ],
      "description": "The payment method email (only shows for paypal payment type)"
    },
    "paymentMethodName": {
      "type": [
        "string",
        "null"
      ],
      "description": "The payment method name"
    },
    "baseOrderChargedAmount": {
      "type": "number",
      "description": "The charged amount of the based order associated with the billing attempt if exists"
    }
  },
  "required": [
    "id",
    "createdAt",
    "updatedAt",
    "externalId",
    "subscriptionId",
    "relatedSubscriptionIds",
    "orderId",
    "errorMsg",
    "errorCode",
    "ready",
    "trigger",
    "paymentMethodExternalId",
    "paymentMethodType",
    "paymentMethodLast4Digits",
    "paymentMethodExpiryMonth",
    "paymentMethodExpiryYear",
    "paymentMethodBrand",
    "paymentMethodEmail",
    "paymentMethodName"
  ]
}