Skip to content

konfig-sdks/pay-pal-invoicing-python-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Visit Paypal

Paypal

Use the Invoicing API to create, send, and manage invoices. You can also use the API or webhooks to track invoice payments. When you send an invoice to a customer, the invoice moves from draft to payable state. PayPal then emails the customer a link to the invoice on the PayPal website. Customers with a PayPal account can log in and pay the invoice with PayPal. Alternatively, customers can pay as a guest with a debit card or credit card. For more information, see the <a href="/docs/invoicing/">Invoicing Overview and the <a href="/docs/invoicing/basic-integration/">Invoicing Integration Guide.

Table of Contents

Requirements

Python >=3.7

Installation

Getting Started

from pprint import pprint
from pay_pal_invoicing_python_sdk import PayPalInvoicing, ApiException

paypalinvoicing = PayPalInvoicing(

    client_id = 'YOUR_CLIENT_ID',
    client_secret = 'YOUR_CLIENT_SECRET',
)

try:
    # Cancel sent invoice
    paypalinvoicing.invoices.cancel_sent_invoice(
        invoice_id="invoice_id_example",
        subject="string_example",
        note="string_example",
        send_to_invoicer=False,
        send_to_recipient=True,
        additional_recipients=[
        "j@Z,rZ#UM/?R,Fp^l6$ARjbhJk C>i H'qT\\{<?'es#)#iK.YM{Rag2/!KB!k@5oXh.:Ts\";mG"
    ],
    )
except ApiException as e:
    print("Exception when calling InvoicesApi.cancel_sent_invoice: %s\n" % e)
    pprint(e.body)
    pprint(e.headers)
    pprint(e.status)
    pprint(e.reason)
    pprint(e.round_trip_time)

Async

async support is available by prepending a to any method.

import asyncio
from pprint import pprint
from pay_pal_invoicing_python_sdk import PayPalInvoicing, ApiException

paypalinvoicing = PayPalInvoicing(

    client_id = 'YOUR_CLIENT_ID',
    client_secret = 'YOUR_CLIENT_SECRET',
)

async def main():
    try:
        # Cancel sent invoice
        await paypalinvoicing.invoices.acancel_sent_invoice(
            invoice_id="invoice_id_example",
            subject="string_example",
            note="string_example",
            send_to_invoicer=False,
            send_to_recipient=True,
            additional_recipients=[
        "j@Z,rZ#UM/?R,Fp^l6$ARjbhJk C>i H'qT\\{<?'es#)#iK.YM{Rag2/!KB!k@5oXh.:Ts\";mG"
    ],
        )
    except ApiException as e:
        print("Exception when calling InvoicesApi.cancel_sent_invoice: %s\n" % e)
        pprint(e.body)
        pprint(e.headers)
        pprint(e.status)
        pprint(e.reason)
        pprint(e.round_trip_time)

asyncio.run(main())

Raw HTTP Response

To access raw HTTP response values, use the .raw namespace.

from pprint import pprint
from pay_pal_invoicing_python_sdk import PayPalInvoicing, ApiException

paypalinvoicing = PayPalInvoicing(

    client_id = 'YOUR_CLIENT_ID',
    client_secret = 'YOUR_CLIENT_SECRET',
)

try:
    # Cancel sent invoice
    cancel_sent_invoice_response = paypalinvoicing.invoices.raw.cancel_sent_invoice(
        invoice_id="invoice_id_example",
        subject="string_example",
        note="string_example",
        send_to_invoicer=False,
        send_to_recipient=True,
        additional_recipients=[
        "j@Z,rZ#UM/?R,Fp^l6$ARjbhJk C>i H'qT\\{<?'es#)#iK.YM{Rag2/!KB!k@5oXh.:Ts\";mG"
    ],
    )
    pprint(cancel_sent_invoice_response.headers)
    pprint(cancel_sent_invoice_response.status)
    pprint(cancel_sent_invoice_response.round_trip_time)
except ApiException as e:
    print("Exception when calling InvoicesApi.cancel_sent_invoice: %s\n" % e)
    pprint(e.body)
    pprint(e.headers)
    pprint(e.status)
    pprint(e.reason)
    pprint(e.round_trip_time)

Reference

paypalinvoicing.invoices.cancel_sent_invoice

Cancels a sent invoice, by ID, and, optionally, sends a notification about the cancellation to the payer, merchant, and CC: emails.

πŸ› οΈ Usage

paypalinvoicing.invoices.cancel_sent_invoice(
    invoice_id="invoice_id_example",
    subject="string_example",
    note="string_example",
    send_to_invoicer=False,
    send_to_recipient=True,
    additional_recipients=[
        "j@Z,rZ#UM/?R,Fp^l6$ARjbhJk C>i H'qT\\{<?'es#)#iK.YM{Rag2/!KB!k@5oXh.:Ts\";mG"
    ],
)

βš™οΈ Parameters

invoice_id: str

The ID of the draft invoice to delete.

subject: str

The subject of the email that is sent as a notification to the recipient.

note: str

A note to the payer.

send_to_invoicer: bool

Indicates whether to send a copy of the email to the merchant.

send_to_recipient: bool

Indicates whether to send a copy of the email to the recipient.

additional_recipients: List[EmailAddress]

An array of one or more CC: emails to which notifications are sent. If you omit this parameter, a notification is sent to all CC: email addresses that are part of the invoice.

Note: Valid values are email addresses in the additional_recipients value associated with the invoice.

βš™οΈ Request Body

Notification The email or SMS notification that will be sent to the payer on cancellation.

🌐 Endpoint

/v2/invoicing/invoices/{invoice_id}/cancel post

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.create_draft_invoice

Creates a draft invoice. To move the invoice from a draft to payable state, you must send the invoice.

In the JSON request body, include invoice details including merchant information. The invoice object must include an items array.

Note: The merchant that you specify in an invoice must have a PayPal account in good standing.
.

πŸ› οΈ Usage

create_draft_invoice_response = paypalinvoicing.invoices.create_draft_invoice(
    detail={},
    id="string_example",
    parent_id="string_example",
    items="DRAFT",
    invoicer={},
    primary_recipients=[
        {
        }
    ],
    additional_recipients=[
        "j@Z,rZ#UM/?R,Fp^l6$ARjbhJk C>i H'qT\\{<?'es#)#iK.YM{Rag2/!KB!k@5oXh.:Ts\";mG"
    ],
    items=[
        {
            "name": "name_example",
            "quantity": "quantity_example",
            "unit_amount": {
                "currency_code": "currency_code_example",
                "value": "-.2888001528021798096225500850",
            },
            "unit_of_measure": "QUANTITY",
        }
    ],
    configuration={},
    amount={
    },
    due_amount={
        "currency_code": "currency_code_example",
        "value": "-.2888001528021798096225500850",
    },
    gratuity={
        "currency_code": "currency_code_example",
        "value": "-.2888001528021798096225500850",
    },
    payments={
    },
    refunds={
    },
    links=[
        {
            "href": "href_example",
            "rel": "rel_example",
            "method": "GET",
        }
    ],
)

βš™οΈ Parameters

id: str

The ID of the invoice.

parent_id: str

The parent ID to an invoice that defines the group invoice to which the invoice is related.

invoicer: InvoicerInfo
primary_recipients: List[RecipientInfo]

The billing and shipping information. Includes name, email, address, phone and language.

additional_recipients: List[EmailAddress]

An array of one or more CC: emails to which notifications are sent. If you omit this parameter, a notification is sent to all CC: email addresses that are part of the invoice.

Note: Valid values are email addresses in the additional_recipients value associated with the invoice.

items: List[Item]

An array of invoice line item information.

configuration: Configuration
due_amount: Money
gratuity: Money
payments: Payments
refunds: Refunds
links: List[LinkDescription]

An array of request-related HATEOAS links.

βš™οΈ Request Body

Invoice The invoice details which includes all information of the invoice like items, billing information.

πŸ”„ Return

Invoice

🌐 Endpoint

/v2/invoicing/invoices post

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.delete_draft_or_scheduled_invoice

Deletes a draft or scheduled invoice, by ID. Deletes invoices in the draft or scheduled state only. For invoices that have already been sent, you can cancel the invoice. After you delete a draft or scheduled invoice, you can no longer use it or show its details. However, you can reuse its invoice number.

πŸ› οΈ Usage

paypalinvoicing.invoices.delete_draft_or_scheduled_invoice(
    invoice_id="invoice_id_example",
)

βš™οΈ Parameters

invoice_id: str

The ID of the draft invoice to delete.

🌐 Endpoint

/v2/invoicing/invoices/{invoice_id} delete

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.delete_external_payment

Deletes an external payment, by invoice ID and transaction ID.

πŸ› οΈ Usage

paypalinvoicing.invoices.delete_external_payment(
    invoice_id="invoice_id_example",
    transaction_id="transaction_id_example",
)

βš™οΈ Parameters

invoice_id: str

The ID of the draft invoice to delete.

transaction_id: str

The ID of the external refund transaction to delete.

🌐 Endpoint

/v2/invoicing/invoices/{invoice_id}/payments/{transaction_id} delete

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.delete_external_refund

Deletes an external refund, by invoice ID and transaction ID.

πŸ› οΈ Usage

paypalinvoicing.invoices.delete_external_refund(
    invoice_id="invoice_id_example",
    transaction_id="transaction_id_example",
)

βš™οΈ Parameters

invoice_id: str

The ID of the draft invoice to delete.

transaction_id: str

The ID of the external refund transaction to delete.

🌐 Endpoint

/v2/invoicing/invoices/{invoice_id}/refunds/{transaction_id} delete

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.generate_next_invoice_number

Generates the next invoice number that is available to the merchant. The next invoice number uses the prefix and suffix from the last invoice number and increments the number by one. For example, the next invoice number after INVOICE-1234 is INVOICE-1235.

πŸ› οΈ Usage

generate_next_invoice_number_response = paypalinvoicing.invoices.generate_next_invoice_number()

πŸ”„ Return

InvoiceNumber

🌐 Endpoint

/v2/invoicing/generate-next-invoice-number post

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.generate_qr_code

Generates a QR code for an invoice, by ID. The QR code is a PNG image in Base64-encoded format that corresponds to the invoice ID. You can generate a QR code for an invoice and add it to a paper or PDF invoice. When customers use their mobile devices to scan the QR code, they are redirected to the PayPal mobile payment flow where they can view the invoice and pay online with PayPal or a credit card. Before you get a QR code, you must create an invoice and send an invoice to move the invoice from a draft to payable state. Do not include an email address if you do not want the invoice emailed.

πŸ› οΈ Usage

paypalinvoicing.invoices.generate_qr_code(
    invoice_id="invoice_id_example",
    width=500,
    height=500,
    action="pay",
)

βš™οΈ Parameters

invoice_id: str

The ID of the draft invoice to delete.

width: int

The width, in pixels, of the QR code image. Value is from 150 to 500.

height: int

The height, in pixels, of the QR code image. Value is from 150 to 500.

action: str

The type of URL for which to generate a QR code. Valid values are pay and details.

βš™οΈ Request Body

QrConfig Optional configuration parameters to adjust QR code width, height and the encoded URL.

🌐 Endpoint

/v2/invoicing/invoices/{invoice_id}/generate-qr-code post

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.get_details

Shows details for an invoice, by ID.

πŸ› οΈ Usage

get_details_response = paypalinvoicing.invoices.get_details(
    invoice_id="invoice_id_example",
)

βš™οΈ Parameters

invoice_id: str

The ID of the draft invoice to delete.

πŸ”„ Return

Invoice

🌐 Endpoint

/v2/invoicing/invoices/{invoice_id} get

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.get_invoices

Lists invoices. To filter the invoices that appear in the response, you can specify one or more optional query parameters.

πŸ› οΈ Usage

get_invoices_response = paypalinvoicing.invoices.get_invoices(
    page=1,
    page_size=20,
    total_required=False,
    fields="all",
)

βš™οΈ Parameters

page: int

The page number to be retrieved, for the list of templates. So, a combination of page=1 and page_size=20 returns the first 20 templates. A combination of page=2 and page_size=20 returns the next 20 templates.

page_size: int

The maximum number of templates to return in the response.

total_required: bool

Indicates whether the to show total_pages and total_items in the response.

fields: str

The fields to return in the response. Value is all or none. To return only the template name, ID, and default attributes, specify none.

πŸ”„ Return

Invoices

🌐 Endpoint

/v2/invoicing/invoices get

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.record_payment

Records a payment for the invoice. If no payment is due, the invoice is marked as PAID. Otherwise, the invoice is marked as PARTIALLY PAID.

πŸ› οΈ Usage

record_payment_response = paypalinvoicing.invoices.record_payment(
    method="BANK_TRANSFER",
    invoice_id="invoice_id_example",
    type="PAYPAL",
    payment_id="string_example",
    payment_date="0480-08-03",
    note="string_example",
    amount={
        "currency_code": "currency_code_example",
        "value": "-.2888001528021798096225500850",
    },
    shipping_info={},
)

βš™οΈ Parameters

invoice_id: str

The ID of the draft invoice to delete.

payment_id: str

The ID for a PayPal payment transaction. Required for the PAYPAL payment type.

payment_date: DateNoTime
note: str

A note associated with an external cash or check payment.

amount: Money
shipping_info: ContactNameAddress

βš™οΈ Request Body

PaymentDetail The details of the payment to record against the invoice.

πŸ”„ Return

PaymentReference

🌐 Endpoint

/v2/invoicing/invoices/{invoice_id}/payments post

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.record_refund

Records a refund for the invoice. If all payments are refunded, the invoice is marked as REFUNDED. Otherwise, the invoice is marked as PARTIALLY REFUNDED.

πŸ› οΈ Usage

record_refund_response = paypalinvoicing.invoices.record_refund(
    method="BANK_TRANSFER",
    invoice_id="invoice_id_example",
    type="PAYPAL",
    refund_id="string_example",
    refund_date="0480-08-03",
    amount={
        "currency_code": "currency_code_example",
        "value": "-.2888001528021798096225500850",
    },
)

βš™οΈ Parameters

invoice_id: str

The ID of the draft invoice to delete.

refund_id: str

The ID for a PayPal payment transaction. Required for the PAYPAL payment type.

refund_date: DateNoTime
amount: Money

βš™οΈ Request Body

RefundDetail The details of the refund to record against the invoice.

πŸ”„ Return

RefundReference

🌐 Endpoint

/v2/invoicing/invoices/{invoice_id}/refunds post

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.send_invoice

Sends or schedules an invoice, by ID, to be sent to a customer. The action depends on the invoice issue date:

  • If the invoice issue date is current or in the past, sends the invoice immediately.
  • If the invoice issue date is in the future, schedules the invoice to be sent on that date.
To suppress the merchant's email notification, set the send_to_invoicer body parameter to false. To send the invoice through a share link and not through PayPal, set the send_to_recipient parameter to false in the notification object. The send_to_recipient parameter does not apply to a future issue date because the invoice is scheduled to be sent through PayPal on that date.
Notes:
  • After you send an invoice, resending it has no effect.
  • To send a notification for updates, update the invoice and set the send_to_recipient body parameter to true.

πŸ› οΈ Usage

send_invoice_response = paypalinvoicing.invoices.send_invoice(
    invoice_id="invoice_id_example",
    subject="string_example",
    note="string_example",
    send_to_invoicer=False,
    send_to_recipient=True,
    additional_recipients=[
        "j@Z,rZ#UM/?R,Fp^l6$ARjbhJk C>i H'qT\\{<?'es#)#iK.YM{Rag2/!KB!k@5oXh.:Ts\";mG"
    ],
)

βš™οΈ Parameters

invoice_id: str

The ID of the draft invoice to delete.

subject: str

The subject of the email that is sent as a notification to the recipient.

note: str

A note to the payer.

send_to_invoicer: bool

Indicates whether to send a copy of the email to the merchant.

send_to_recipient: bool

Indicates whether to send a copy of the email to the recipient.

additional_recipients: List[EmailAddress]

An array of one or more CC: emails to which notifications are sent. If you omit this parameter, a notification is sent to all CC: email addresses that are part of the invoice.

Note: Valid values are email addresses in the additional_recipients value associated with the invoice.

βš™οΈ Request Body

Notification The email or SMS notification to send to the payer when they send an invoice..

πŸ”„ Return

LinkDescription

🌐 Endpoint

/v2/invoicing/invoices/{invoice_id}/send post

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.send_reminder

Sends a reminder to the payer about an invoice, by ID. In the JSON request body, include a notification object that defines the subject of the reminder and other details.

πŸ› οΈ Usage

paypalinvoicing.invoices.send_reminder(
    invoice_id="invoice_id_example",
    subject="string_example",
    note="string_example",
    send_to_invoicer=False,
    send_to_recipient=True,
    additional_recipients=[
        "j@Z,rZ#UM/?R,Fp^l6$ARjbhJk C>i H'qT\\{<?'es#)#iK.YM{Rag2/!KB!k@5oXh.:Ts\";mG"
    ],
)

βš™οΈ Parameters

invoice_id: str

The ID of the draft invoice to delete.

subject: str

The subject of the email that is sent as a notification to the recipient.

note: str

A note to the payer.

send_to_invoicer: bool

Indicates whether to send a copy of the email to the merchant.

send_to_recipient: bool

Indicates whether to send a copy of the email to the recipient.

additional_recipients: List[EmailAddress]

An array of one or more CC: emails to which notifications are sent. If you omit this parameter, a notification is sent to all CC: email addresses that are part of the invoice.

Note: Valid values are email addresses in the additional_recipients value associated with the invoice.

βš™οΈ Request Body

Notification The email or SMS notification that will be sent to the payer for reminder.

🌐 Endpoint

/v2/invoicing/invoices/{invoice_id}/remind post

πŸ”™ Back to Table of Contents


paypalinvoicing.invoices.update_full_invoice

Fully updates an invoice, by ID. In the JSON request body, include a complete invoice object. This call does not support partial updates.

πŸ› οΈ Usage

update_full_invoice_response = paypalinvoicing.invoices.update_full_invoice(
    detail={},
    invoice_id="invoice_id_example",
    id="string_example",
    parent_id="string_example",
    items="DRAFT",
    invoicer={},
    primary_recipients=[
        {
        }
    ],
    additional_recipients=[
        "j@Z,rZ#UM/?R,Fp^l6$ARjbhJk C>i H'qT\\{<?'es#)#iK.YM{Rag2/!KB!k@5oXh.:Ts\";mG"
    ],
    items=[
        {
            "name": "name_example",
            "quantity": "quantity_example",
            "unit_amount": {
                "currency_code": "currency_code_example",
                "value": "-.2888001528021798096225500850",
            },
            "unit_of_measure": "QUANTITY",
        }
    ],
    configuration={},
    amount={
    },
    due_amount={
        "currency_code": "currency_code_example",
        "value": "-.2888001528021798096225500850",
    },
    gratuity={
        "currency_code": "currency_code_example",
        "value": "-.2888001528021798096225500850",
    },
    payments={
    },
    refunds={
    },
    links=[
        {
            "href": "href_example",
            "rel": "rel_example",
            "method": "GET",
        }
    ],
    send_to_recipient=True,
    send_to_invoicer=True,
)

βš™οΈ Parameters

invoice_id: str

The ID of the draft invoice to delete.

id: str

The ID of the invoice.

parent_id: str

The parent ID to an invoice that defines the group invoice to which the invoice is related.

invoicer: InvoicerInfo
primary_recipients: List[RecipientInfo]

The billing and shipping information. Includes name, email, address, phone and language.

additional_recipients: List[EmailAddress]

An array of one or more CC: emails to which notifications are sent. If you omit this parameter, a notification is sent to all CC: email addresses that are part of the invoice.

Note: Valid values are email addresses in the additional_recipients value associated with the invoice.

items: List[Item]

An array of invoice line item information.

configuration: Configuration
due_amount: Money
gratuity: Money
payments: Payments
refunds: Refunds
links: List[LinkDescription]

An array of request-related HATEOAS links.

send_to_recipient: bool

Indicates whether to send the invoice update notification to the recipient.

send_to_invoicer: bool

Indicates whether to send the invoice update notification to the merchant.

βš™οΈ Request Body

Invoice A representation of changes to make in the invoice.

πŸ”„ Return

Invoice

🌐 Endpoint

/v2/invoicing/invoices/{invoice_id} put

πŸ”™ Back to Table of Contents


paypalinvoicing.search_invoices.list

Searches for and lists invoices that match search criteria. If you pass multiple criteria, the response lists invoices that match all criteria.

πŸ› οΈ Usage

list_response = paypalinvoicing.search_invoices.list(
    recipient_email="string_example",
    recipient_first_name="string_example",
    recipient_last_name="string_example",
    recipient_business_name="string_example",
    invoice_number="string_example",
    status=[
        "string_example"
    ],
    reference="string_example",
    currency_code="aaa",
    memo="string_example",
    total_amount_range={
        "lower_amount": {
            "currency_code": "currency_code_example",
            "value": "-.2888001528021798096225500850",
        },
,
    },
    invoice_date_range={
        "start": "0480-08-03",
        "end": "0480-08-03",
    },
    due_date_range={
        "start": "0480-08-03",
        "end": "0480-08-03",
    },
    payment_date_range={
        "start": "0480-08-03t01:32:60.79809622550085076206862933933397565068513910269129173272947860148202650912727550417577019298Z",
        "end": "0480-08-03t01:32:60.79809622550085076206862933933397565068513910269129173272947860148202650912727550417577019298Z",
    },
    creation_date_range={
        "start": "0480-08-03t01:32:60.79809622550085076206862933933397565068513910269129173272947860148202650912727550417577019298Z",
        "end": "0480-08-03t01:32:60.79809622550085076206862933933397565068513910269129173272947860148202650912727550417577019298Z",
    },
    archived=True,
    fields=[
        "string_example"
    ],
    page=1,
    page_size=20,
    total_required=False,
)

βš™οΈ Parameters

recipient_email: str

Filters the search by the email address.

recipient_first_name: str

Filters the search by the recipient first name.

recipient_last_name: str

Filters the search by the recipient last name.

recipient_business_name: str

Filters the search by the recipient business name.

invoice_number: str

Filters the search by the invoice number.

status: List[InvoiceStatus]

An array of status values.

reference: str

The reference data, such as a PO number.

currency_code: CurrencyCode
memo: str

A private bookkeeping memo for the user.

total_amount_range: AmountRange
invoice_date_range: DateRange
due_date_range: DateRange
payment_date_range: DateTimeRange
creation_date_range: DateTimeRange
archived: bool

Indicates whether to list merchant-archived invoices in the response. Value is:

  • true. Response lists only merchant-archived invoices.
  • false. Response lists only unarchived invoices.
  • null. Response lists all invoices.

page: int

The page number to be retrieved, for the list of templates. So, a combination of page=1 and page_size=20 returns the first 20 templates. A combination of page=2 and page_size=20 returns the next 20 templates.

page_size: int

The maximum number of templates to return in the response.

total_required: bool

Indicates whether the to show total_pages and total_items in the response.

βš™οΈ Request Body

SearchData The invoice search can be used to retrieve the invoices based on the search parameters.

πŸ”„ Return

Invoices

🌐 Endpoint

/v2/invoicing/search-invoices post

πŸ”™ Back to Table of Contents


paypalinvoicing.templates.create_template

Creates an invoice template. You can use details from this template to create an invoice. You can create up to 50 templates.

Note: Every merchant starts with three PayPal system templates that are optimized for the unit type billed. The template includes Quantity, Hours, and Amount.

πŸ› οΈ Usage

create_template_response = paypalinvoicing.templates.create_template(
    id="string_example",
    name="a",
    default_template=True,
    template_info={
    },
    settings={
    },
    unit_of_measure="QUANTITY",
    standard_template=True,
    links=[
        {
            "href": "href_example",
            "rel": "rel_example",
            "method": "GET",
        }
    ],
)

βš™οΈ Parameters

id: str

The ID of the template.

name: str

The template name.

Note: The template name must be unique.

default_template: bool

Indicates whether this template is the default template. A invoicer can have one default template.

template_info: TemplateInfo
unit_of_measure: UnitOfMeasure
standard_template: bool

Indicates whether this template is a invoicer-created custom template. The system generates non-custom templates.

links: List[LinkDescription]

An array of request-related HATEOAS links.

βš™οΈ Request Body

Template

πŸ”„ Return

Template

🌐 Endpoint

/v2/invoicing/templates post

πŸ”™ Back to Table of Contents


paypalinvoicing.templates.delete_by_id

Deletes a template, by ID.

πŸ› οΈ Usage

paypalinvoicing.templates.delete_by_id(
    template_id="template_id_example",
)

βš™οΈ Parameters

template_id: str

The ID of the template to delete.

🌐 Endpoint

/v2/invoicing/templates/{template_id} delete

πŸ”™ Back to Table of Contents


paypalinvoicing.templates.list_details

Lists merchant-created templates with associated details. The associated details include the emails, addresses, and phone numbers from the user's PayPal profile.
The user can select which values to show in the business information section of their template.

πŸ› οΈ Usage

list_details_response = paypalinvoicing.templates.list_details(
    fields="all",
    page=1,
    page_size=20,
)

βš™οΈ Parameters

fields: str

The fields to return in the response. Value is all or none. To return only the template name, ID, and default attributes, specify none.

page: int

The page number to be retrieved, for the list of templates. So, a combination of page=1 and page_size=20 returns the first 20 templates. A combination of page=2 and page_size=20 returns the next 20 templates.

page_size: int

The maximum number of templates to return in the response.

πŸ”„ Return

Templates

🌐 Endpoint

/v2/invoicing/templates get

πŸ”™ Back to Table of Contents


paypalinvoicing.templates.show_details_by_id

Shows details for a template, by ID.

πŸ› οΈ Usage

show_details_by_id_response = paypalinvoicing.templates.show_details_by_id(
    template_id="template_id_example",
)

βš™οΈ Parameters

template_id: str

The ID of the template to delete.

πŸ”„ Return

Template

🌐 Endpoint

/v2/invoicing/templates/{template_id} get

πŸ”™ Back to Table of Contents


paypalinvoicing.templates.update_full_template

Fully updates a template, by ID. In the JSON request body, include a complete template object. This call does not support partial updates.

πŸ› οΈ Usage

update_full_template_response = paypalinvoicing.templates.update_full_template(
    template_id="template_id_example",
    id="string_example",
    name="a",
    default_template=True,
    template_info={
    },
    settings={
    },
    unit_of_measure="QUANTITY",
    standard_template=True,
    links=[
        {
            "href": "href_example",
            "rel": "rel_example",
            "method": "GET",
        }
    ],
)

βš™οΈ Parameters

template_id: str

The ID of the template to delete.

id: str

The ID of the template.

name: str

The template name.

Note: The template name must be unique.

default_template: bool

Indicates whether this template is the default template. A invoicer can have one default template.

template_info: TemplateInfo
unit_of_measure: UnitOfMeasure
standard_template: bool

Indicates whether this template is a invoicer-created custom template. The system generates non-custom templates.

links: List[LinkDescription]

An array of request-related HATEOAS links.

βš™οΈ Request Body

Template A representation of changes to make in the template.

πŸ”„ Return

Template

🌐 Endpoint

/v2/invoicing/templates/{template_id} put

πŸ”™ Back to Table of Contents


Author

This Python package is automatically generated by Konfig

About

Making money fast, easy, and enjoyable. Unlocking opportunities for people and businesses worldwide. Visit PayPal Help Center for support. Equal opportunity employer with generous benefits. PayPal's Python SDK for Invoicing API generated by Konfig (https://konfigthis.com/).

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages