Commet
  • Precios
Iniciar SesiónRegistrarse
Cancel a payment link POSTCharge a customer POSTCreate a payment link POSTGet payment GETList payments GET
DocumentaciónRecursosConstruir con AIAPI ReferenceWebhooks

Charge a customer

Charge a customer's vaulted payment method off-session. Calculates tax, generates an invoice, and sends a receipt. No subscription or plan required.

POST
/payments/charge

Charge a customer's vaulted payment method off-session. Calculates tax, generates an invoice, and sends a receipt. No subscription or plan required.

Authorization

ApiKeyAuth
x-api-key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

customerId*string
amount*integer
currency*string
description*string
metadata?

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/payments/charge" \  -H "Content-Type: application/json" \  -d '{    "customerId": "string",    "amount": 1,    "currency": "string",    "description": "string"  }'
{  "success": true,  "data": {    "id": "string",    "customerId": "string",    "kind": "link",    "status": "pending",    "provider": "stripe",    "amountSubtotal": -9007199254740991,    "taxAmount": -9007199254740991,    "amountTotal": -9007199254740991,    "currency": "string",    "description": "string",    "metadata": {      "property1": null,      "property2": null    },    "url": "string",    "expiresAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "object": "payment",    "livemode": true  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}

Cancel a payment link POST

Cancel a pending payment link so it can no longer be paid. Only a link that has not been paid or started processing can be canceled; canceling an already canceled link is a no-op. Charges cannot be canceled.

Create a payment link POST

Create a hosted payment link. Returns a url the customer opens to pay with any card. Calculates tax, generates an invoice, and vaults the payment method on confirmation. No subscription or plan required.