Saltar al contenido principal
POST
/
plans
/
{id}
/
charges
Create a charge (PlanItem + Price) atomically
curl --request POST \
  --url https://billing-api.sandbox.z2pay.com/plans/{id}/charges \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "item": {
    "key": "<string>",
    "name": "<string>",
    "kind": "recurring",
    "quantityDefault": 1,
    "quantityIncluded": 0,
    "optional": false,
    "displayOrder": 0,
    "description": "<string>",
    "metadata": {}
  },
  "price": {
    "money": {
      "amount": 1,
      "currency": "<string>"
    },
    "recurrence": {
      "interval": 1,
      "anchorDay": 16,
      "collectionTiming": "prepaid"
    },
    "billingScheme": "fixed",
    "tiers": [
      {
        "upTo": 1,
        "unitAmount": 1
      }
    ],
    "packageSize": 1,
    "meterId": "<string>"
  }
}
'

Autorizaciones

x-api-key
string
header
requerido

API Key da Credential (gerada no Backoffice)

Encabezados

Idempotency-Key
string

Unique key for request idempotency

Parámetros de ruta

id
string
requerido

Plan ID

Cuerpo

application/json
item
object
requerido
price
object
requerido

Respuesta

Both item and price created; returns { item, price }