'Paypal invoice status stays on "DRAFT"

i have got a problem recently trying to make a paypal invoice. well, check this code here.

paypal.invoice.create({
        merchant_info: {
            email: "EMAIL",
            first_name: "FIRST_NAME",
            last_name: "LAST_NAME",
            business_name: "NAME",
            phone: {
                country_code: "CODE",
                national_number: "NUMBER"
            },
            address: {
                line1: "STREET",
                city: "Riyadh",
                state: "Riyadh Province",
                postal_code: "0000",
                country_code: "SA"
            }
        },
        status: "UNPAID",
        billing_info: [{
            "email": "[email protected]"
        }],
        items: [],
        note: `Thank You For Buying`
    })

Ok, i got the invoice made and everything, but the status is "DRAFT", can someone explain please? btw i want the status to be "UNPAID"



Solution 1:[1]

PayPal-Node-SDK is deprecated, so don't use that. There is no supported SDK for the invoicing API; use direct API calls.

(Some of the HTTP call code in the newer Checkout-NodeJS-SDK could possibly be useful to you as a template)

Regarding the v2 invoicing API itself, invoices start in a DRAFT state on creation. There is an additional API call to send them, documented on that page.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Preston PHX