Organization API: Customer Portal: Invoices
The 15 Organization API operations for invoices.
Part of Customer Portal.
Operations
Section titled OperationsNewest first, ties by id
Section titled Newest first, ties by idGET /api/v1/orgs/{org_slug}/portal/invoices
Newest first, ties by id. with_total wraps the page as
{items, total, limit, offset, counts}; counts are per status for the
same search, whatever the status filter.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path | string | yes | |
status_filter |
query | string | no | |
q |
query | string | no | |
limit |
query | integer | no | Default: 50. |
offset |
query | integer | no | Default: 0. |
with_total |
query | boolean | no | Default: False. |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Get my invoice
Section titled Get my invoiceGET /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Apply the customer's credit balance toward an unpaid invoice
Section titled Apply the customer's credit balance toward an unpaid invoicePOST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/apply-credit
Apply the customer's credit balance toward an unpaid invoice.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Pay an invoice using a saved payment method (merchant-initiated charge)
Section titled Pay an invoice using a saved payment method (merchant-initiated charge)POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/charge
Pay an invoice using a saved payment method (merchant-initiated charge). If no payment_method_id specified, uses the default method.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
payment_method_id |
query | integer | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Canonical hosted checkout for an org-customer invoice (alias of /pay)
Section titled Canonical hosted checkout for an org-customer invoice (alias of /pay)POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/checkout
Canonical hosted checkout for an org-customer invoice (alias of /pay).
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
return_url |
query | string | no |
cancel_url |
query | string | no |
currency |
query | string | no |
gateway_name |
query | string | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Resume an in-flight checkout after a new tab, login, or API restart
Section titled Resume an in-flight checkout after a new tab, login, or API restartGET /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/checkout-session
Resume an in-flight checkout after a new tab, login, or API restart.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Finalize a charge after customer completes SCA (3-D Secure)
Section titled Finalize a charge after customer completes SCA (3-D Secure)POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/confirm-payment
Finalize a charge after customer completes SCA (3-D Secure). Retrieves the PaymentIntent from Stripe and settles the org invoice on success.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
gateway_name |
query | string | yes |
payment_intent_id |
query | string | yes |
currency |
query | string | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Gateway accounts that can checkout this invoice's pay currency
Section titled Gateway accounts that can checkout this invoice's pay currencyGET /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/gateways
Gateway accounts that can checkout this invoice's pay currency.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
currency |
query | string | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Hosted checkout for an invoice (legacy path; prefer /checkout)
Section titled Hosted checkout for an invoice (legacy path; prefer /checkout)POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/pay
Hosted checkout for an invoice (legacy path; prefer /checkout).
Creates a hosted checkout session and returns an approval URL.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
return_url |
query | string | no |
cancel_url |
query | string | no |
currency |
query | string | no |
gateway_name |
query | string | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Create an in-page Stripe Payment Element intent for an org invoice
Section titled Create an in-page Stripe Payment Element intent for an org invoicePOST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/pay-intent
Create an in-page Stripe Payment Element intent for an org invoice.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
currency |
query | string | no |
country |
query | string | no |
gateway_name |
query | string | no |
save_method |
query | boolean | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Capture paypal order
Section titled Capture paypal orderPOST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/paypal-capture
Finalize an embedded PayPal Buttons one-off payment: capture the buyer-approved order server-side and apply it to the org invoice (USD ledger). Idempotent via the gateway_reference uniqueness in settle_org_invoice_payment.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
order_id |
query | string | yes |
gateway_name |
query | string | yes |
currency |
query | string | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Persist a PayPal order id so a redirect or reboot can still capture it
Section titled Persist a PayPal order id so a redirect or reboot can still capture itPOST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/paypal-stash
Persist a PayPal order id so a redirect or reboot can still capture it.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
order_id |
query | string | yes |
gateway_name |
query | string | yes |
currency |
query | string | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
The invoice as a document to keep
Section titled The invoice as a document to keepGET /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/pdf
The invoice as a document to keep. Statements are staff-facing; this is the copy a customer files with their own accounts.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
My invoice refund eligibility
Section titled My invoice refund eligibilityGET /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/refund-eligibility
What the Refund Policy says about this invoice, so the page can offer the request, or say plainly why it cannot, before the customer types.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Request my invoice refund
Section titled Request my invoice refundPOST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/refund-request
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
Type: Body.
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |