Pay invoice

Pay a standalone customer invoice with an existing source or a new card.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Overview

Pay a standalone invoice belonging to the authenticated customer. Pay with either an existing chargeable card (source_id) or a new card (payment_gateway + gateway_token). On success the response is the customer resource with a fresh JWT; when the charge needs 3D Secure, it includes a payment_intent (status requires_action) for your front end to complete.

Example:

curl --request POST \n  --url 'https://www.pelcro.com/api/v1/sdk/invoices/101/pay?site_id=1232' \n  --header 'Authorization: Bearer <JWT>' \n  --header 'Content-Type: application/json' \n  --data '{ "payment_gateway": "stripe", "gateway_token": "pm_card_visa" }'

Conditional Requirements

  • Provide either source_id (an existing chargeable source) or both payment_gateway and gateway_token.
  • The invoice must belong to the customer and not be paid, void, or uncollectible.
  • A declined card returns 404 with the gateway message; an unknown invoice also returns 404.
Path Params
int32
required

The unique identifier of the open invoice.

Query Params
int32
required

The unique identifier of the site associated with your account.

Body Params
int32

The unique identifier of an existing chargeable payment method already attached to the customer, which will be used to attempt payment for this invoice. Required when payment_gateway and gateway_token are not provided.

string
enum

The optional payment gateway, one of stripe, braintree, vantiv, tap or cybersource. Required with gateway_token if source_id is not set.

Allowed:
string

The single-use token that represents the payment method details. Typically generated using the payment gateway's tools and libraries. This payment method will be used to attempt paying for this invoice. Required with payment_gateway if source_id is not set.

Headers
string
required
Defaults to Bearer <token>

Required. Bearer authentication with the customer's JWT — Authorization: Bearer <token>. Obtained from the register, login, or passwordless-login response and renewed via the refresh endpoint.

Responses

Language
Credentials
Query
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json