Skip to Content
Docs
Invoices

Send your tax figures for a drafted invoice

POST/invoices/{invoice_id}/tax

For a subscription with tax_figures: per_invoice, Pay.com sends invoice.drafted for each renewal invoice and waits for its draft window (1 hour by default, never past the last day to cancel) before it issues it. Send that invoice's figures here. Once it's issued, this returns 422 with tax_window_closed.

Headers

AuthorizationstringRequired
HTTP Basic auth: your API key as the password, with an empty username. See Authentication.
idempotency-keystring

A unique key, such as a UUID, that makes a POST safe to retry. Pay.com keeps each key for 24 hours, separately for each workspace. A retry with the same key, endpoint and body gets the first response. Another endpoint or body gets 400 idempotency_error, and a retry while the first is running gets 409.

Path parameters

invoice_idstringRequired

The invoice's ID (inv_).

Parameters

tax_breakdownarray of objectsRequired

The same entries tax_options.tax_quote_data.tax_breakdown takes: amount, inclusive, taxable_amount and tax_rate_details.

Returns

The invoice, with your figures.

idstring
resourcestring
numberstring

The number in the seller's invoice series.

statusstring

An order's invoice is issued paid. A renewal invoice is draft until issued, then open until paid. void for one replaced before it reached the customer.

One of draft, open, paid or void.

orderstring or null

The order it bills. null for a renewal invoice.

subscriptionstring or null
period_startstring or null
period_endstring or null

The period runs up to this instant.

Show 22 more attributesShow fewer attributes
amount_dueinteger

What's left to pay.

tax_window_ends_atstring or null

With tax_figures: per_invoice, when the window for your figures closes.

sellerobject
Show 4 child attributesHide child attributes
namestring
emailstring or null
addressobject or null
Show 2 child attributesHide child attributes
Option 1object
Show 6 child attributesHide child attributes
line1string
line2string or null
citystring
statestring or null
postal_codestring
countrystring

Two-letter country code (ISO 3166-1 alpha-2).

Option 2null
tax_idsarray of objects
Show 2 child attributesHide child attributes
typestring
valuestring
customerstring
customer_reference_idstring
bill_toobject
Show 4 child attributesHide child attributes
namestring
emailstring or null
addressobject or null
Show 2 child attributesHide child attributes
Option 1object
Show 6 child attributesHide child attributes
line1string
line2string or null
citystring
statestring or null
postal_codestring
countrystring

Two-letter country code (ISO 3166-1 alpha-2).

Option 2null
tax_idsarray of objects
Show 2 child attributesHide child attributes
typestring
valuestring
currencystring

Three-letter ISO currency code, in lowercase.

amount_subtotalinteger
amount_shippinginteger
amount_taxinteger
amount_totalinteger
amount_paidinteger
amount_creditedinteger
linesarray of objects
Show 9 child attributesHide child attributes
idstring
descriptionstring
pricestring or null
price_versioninteger or null
quantityinteger
unit_amountinteger
amountinteger
amount_taxinteger
kindstring

One of item or shipping.

taxobject
Show 5 child attributesHide child attributes
sourcestring

merchant for your own figures, pay_com for Pay.com's calculation (on your tax setup when you sell, and Pay.com's own when it sells), or none.

One of merchant, pay_com or none.

amountinteger
breakdownarray of objects

By jurisdiction, in the shape tax quotes return.

merchant_amountinteger or null

When Pay.com sells and you sent your own figures with this order or invoice: what they came to. Kept beside Pay.com's figures and never charged. Otherwise null.

merchant_breakdownarray of objects or null

The breakdown you sent, kept beside Pay.com's. Set with merchant_amount.

credit_notesarray of strings
hosted_invoice_urlstring or null

null until the invoice is rendered.

invoice_pdfstring or null

null until the PDF is rendered.

issued_atstring
sent_atstring or null

When Pay.com emailed it to the customer, or null if it hasn't.

createdstring
test_modeboolean

Errors

400
The request is invalid.
401
The API key is missing or wrong.
403
The key's permissions don't allow this route.
404
No such object in this workspace and environment.
422
The request is valid but can't be done. Codes include: - amount_mismatch: amount doesn't equal the line items' total. - price_inactive, product_inactive: an item can't be sold. - currency_mismatch: the items or rates use different currencies. - no_shipping_rate: an item ships and no active rate covers the session's currency. - checkout_not_open: the session is completed or expired. - order_not_refundable: the order is fully refunded, or under a dispute. - amount_exceeds_refundable: more than what's left to refund. - quantity_exceeds_refundable: more of an item than was sold and not yet refunded. - order_not_shippable: shipped_at was sent for an order with nothing that ships. - shipping_rate_inactive: a rate in shipping_options is archived. - tax_exceeds_amount: inclusive tax figures are more than an item's amount. - refund_failed: the payment method refused the refund. Nothing was refunded. - custom_css_not_approved: the draft's changed custom CSS isn't approved yet. - default_profile: your default design profile can't be archived. - profile_not_published: the design profile has nothing published yet, so sessions and links can't use it and it can't be your default. - profile_archived: the design profile is archived, so new sessions and links can't use it and it can't be your default. - display_name_required: the draft to publish has no display_name. - low_contrast: white text on colors.accent, or colors.text on colors.background, is under 4.5:1. - number_in_use: the next number is one the series has already used. - tax_rate_required: a subscription sent with your own tax figures has a tax_breakdown entry without a percentage_decimal or a flat_amount, so it can't be applied to renewals. - seller_engine_conflict: the request names an external engine for a sale that can resolve to Pay.com as seller. - engine_not_allowed_for_seller: the engine can't run a subscription this seller sells. - processor_not_allowed_for_seller: Pay.com sells only on accounts it controls, and the processor isn't one of them. - engine_capability_missing: the engine or its connection can't do what the request needs. - connection_not_ready: the engine's connection isn't connected, or needs action. - product_refused: a product failed review for merchant of record, and you can't sell it yourself in this request. Subscription and seller refusals come at creation, never at renewal.
Was this page helpful?