pay_invoices

Settle invoices

Billing.pay_invoices(selector=None, **kwargs) → ApiResponse

Collects the outstanding balance for one or more countries.

This does not name invoices. The body carries no invoice ids: it names the countries whose debt is collected, and the service settles whatever is open there through a payment agreement. To read which invoices exist, use Invoices.list_invoices.

Warning

Written from the contract. No live call was possible: the account held no ISSUED invoice, and EXECUTE moves money.

Request Body (required)

  • idempotenceId (string): required, and the only required member. Two requests carrying the same id are treated as one, so a retry after a timeout does not charge twice.

  • mode (string): EXECUTE charges, PREVIEW simulates and moves nothing. Use PREVIEW to check a body before committing to it.

  • paymentAgreementId (string): the agreement to charge, whose payment profile decides the method. Omit it and the advertiser’s latest agreement is used.

  • reasonLocale (string): the locale of the reason text, such as es_ES.

  • targetCountryCodes (array): the countries whose balance is collected. This is what selects the debt.

Returns

ApiResponse carrying success and failure, both always present. An empty failure means every collection went through. A 200 does not by itself mean the money moved: read failure.