Actions55
- Webhooks Actions
- Payments Actions
- Products Actions
- Plans Actions
- Partner Referrals Actions
- Reporting Actions
- Orders Actions
- Subscriptions Actions
- Invoicing Actions
- Disputes Actions
Invoicing → Create Draft Invoice
AI-generatedOverview
This node provides a comprehensive integration with PayPal's API, supporting over 70 operations across multiple resources such as Orders, Subscriptions, Invoicing, Disputes, Webhooks, Payments, Products, Plans, Partner Referrals, and Reporting. Specifically, for the Invoicing resource and the Create Draft Invoice operation, it allows users to create draft invoices in PayPal.
Typical use cases include automating invoice creation workflows where draft invoices are prepared programmatically before being finalized or sent. For example, an e-commerce platform can generate draft invoices automatically when an order is placed, allowing review or modification before sending them to customers.
Properties
| Name | Meaning |
|---|---|
| Request Body | JSON object representing the invoice details to be created as a draft. |
| Additional Options | Collection of optional parameters: - Environment: Choose between "Sandbox" or "Live" PayPal environment. - Page Size: Number of items per page for list operations (not applicable here). - Start Time: Start date filter in ISO 8601 format (not applicable here). - End Time: End date filter in ISO 8601 format (not applicable here). |
Output
The node outputs a JSON object containing:
resource: The resource name, here"invoicing".operation: The operation performed, here"createDraftInvoice".success: Boolean indicating if the operation was successful.- All fields returned by PayPal's
/v2/invoicing/invoicesPOST endpoint representing the created draft invoice details. creditsUsed: Number of API credits used for the request (from validation response).creditsRemaining: Remaining API credits after the request.timestamp: ISO string timestamp of when the operation was executed.
If the operation fails and "Continue On Fail" is enabled, the output will contain an error message and success set to false.
The node does not output binary data.
Dependencies
- Requires credentials for:
- An external API key credential for the "N8N Tools API" which validates operations and tracks usage.
- A PayPal OAuth2 API credential providing an access token and environment information.
- The node uses PayPal's REST API endpoints, switching URLs based on the selected environment (sandbox or live).
- No additional environment variables are required beyond these credentials.
Troubleshooting
- Invalid JSON in Request Body: If the provided JSON for the invoice details is malformed, the node throws an error indicating invalid JSON. Ensure the JSON syntax is correct.
- Validation Failure: If the external validation API rejects the operation, the node throws an error with the validation message. Check API key validity and that the requested operation is supported.
- Unknown Operation or Resource: If an unsupported operation or resource is specified, the node throws an error indicating the unknown operation/resource.
- API Authentication Errors: If PayPal OAuth2 credentials are invalid or expired, requests will fail. Refresh or reconfigure credentials accordingly.
- Rate Limits or Quotas: The node tracks API credit usage; exceeding limits may cause failures. Monitor usage and adjust workflows or API plans as needed.