Saltar para o conteúdo

Create a one-off cycle on a subscription

Pedido

Triggers an extra capture against an active subscription's saved payment method — useful for billing ad-hoc items like setup fees, add-ons, or upgrades without touching the recurring schedule. The regular cycles keep running unchanged.

Send capture_at to schedule the capture for later, or omit it to capture right away. The subscription must be active; a one-off cycle on an inactive subscription is rejected with a 409 Conflict.

Required scope: subscription:create

Segurança
accountId and apiKey
Caminho
idstring, (uuid)obrigatório

UUID of the subscription to add the cycle to.

Corpoapplication/jsonobrigatório

Details of the one-off cycle to capture on an active subscription.

valuenumber, (double), >= 0.5obrigatório

Must have at most two decimal places.

Exemplo:10.5
capture_atstring, (Y-m-d H:i)

When to schedule the charge, in UTC. Must not be in the past. Omit to capture immediately.

Exemplo:"2037-12-12 09:00"
descriptionstring, <= 255 characters

Free-form text shown on the bank statement or in the MB WAY app.

Exemplo:"extra subscription charge"
keystring, <= 50 characters

Your internal identifier for this charge. Useful for reconciliation on your side.

Exemplo:"one-time-charge-key"
curl -i -X POST \
  'https://api.test.easypay.pt/2.0/subscription/{id}/cycle' \
  -H 'AccountId: 2b0f63e2-9fb5-4e52-aca0-b4bf0339bbe6' \
  -H 'ApiKey: eae4aa59-8e5b-4ec2-887d-b02768481a92' \
  -H 'Content-Type: application/json' \
  -d '{
    "value": 10.5,
    "description": "extra subscription charge",
    "key": "one-time-charge-key"
  }'

Respostas

Created

Corpoapplication/json
statusstringobrigatório
Exemplo:"ok"
messageArray of stringsobrigatório
Exemplo:
[ "Your request was successfully created" ]
idstring, (uuid)obrigatório

The UUID of the newly created cycle.

Exemplo:"550e8400-e29b-41d4-a716-446655440000"
Resposta
{ "status": "ok", "message": [ "Your request was successfully created" ], "id": "550e8400-e29b-41d4-a716-446655440000" }