Stripe

Create Stripe Draft Invoice

Creates an empty draft invoice for an existing customer, to be emailed for payment.

Unverified

What the model is told

Create a draft Stripe invoice for an existing customer (customer ID starts with cus_). Confirm with the customer first. The invoice is set to be emailed to the customer with payment instructions. It stays a draft and is empty, so next call Add Stripe Invoice Line with the returned invoice id, then Finalise Stripe Invoice and Send Stripe Invoice.

Request

POSThttps://api.stripe.com/v1/invoices

Headers

  • AuthorizationBearer YOUR_STRIPE_SECRET_KEY
  • Content-Typeapplication/x-www-form-urlencoded

Body

customer={{customerId}}&collection_method=send_invoice&days_until_due={{daysUntilDue}}&description={{description}}

Parameters

  • customerId stringThe Stripe customer ID.
  • daysUntilDue numberDays from now until the invoice is due.
  • description stringA memo shown on the invoice.

Engage payload

{
  "source": "VOICE_AI",
  "tool": {
    "id": "e2bb8f55-a838-4c2c-ac89-dae2cb20ac96",
    "type": "HTTP_REQUEST",
    "label": "Create Stripe Draft Invoice",
    "name": "create_stripe_draft_invoice",
    "customName": false,
    "description": "Create a draft Stripe invoice for an existing customer (customer ID starts with cus_). Confirm with the customer first. The invoice is set to be emailed to the customer with payment instructions. It stays a draft and is empty, so next call Add Stripe Invoice Line with the returned invoice id, then Finalise Stripe Invoice and Send Stripe Invoice.",
    "parameters": [
      {
        "name": "customerId",
        "type": "string",
        "description": "The Stripe customer ID."
      },
      {
        "name": "daysUntilDue",
        "type": "number",
        "description": "Days from now until the invoice is due."
      },
      {
        "name": "description",
        "type": "string",
        "description": "A memo shown on the invoice."
      }
    ],
    "config": {
      "endpoint": {
        "method": "POST",
        "url": "https://api.stripe.com/v1/invoices"
      },
      "headers": [
        {
          "name": "Authorization",
          "value": "Bearer YOUR_STRIPE_SECRET_KEY"
        },
        {
          "name": "Content-Type",
          "value": "application/x-www-form-urlencoded"
        }
      ],
      "body": "customer={{customerId}}&collection_method=send_invoice&days_until_due={{daysUntilDue}}&description={{description}}",
      "timeout": null
    }
  }
}

IDs are regenerated on every copy.