Create a plan
Create a new plan
Body·
required
application/json
Request Arguments for creating or updating a plan. The source declares no types for these fields; each type below is inferred from the example payload.
- Type: numberamountrequired
Transaction amount, in dollars, e.g. 10.99 = 10 dollars and 99 cents.
- Type: stringcurrencyrequired
Transaction currency, in currency type, e.g. USD, CAD.
- Type: stringenumfrequencyrequired
The cycle of how often the card will be charged on the subscription or plan. Choices are: DAILY, WEEKLY, MOTHLY, QUARTERLY, or ANNUALLY.
valuesDAILYWEEKLYMOTHLYQUARTERLYANNUALLY - Type: stringnamerequired
The title you give to each plan, which should be unique for each plan.
- Type: numbernumber
_of _payments The total number of payments within this plan.
- Type: booleansend
_receipt Sets whether receipt should be sent after transaction. Default is false.
Responses
- application/json
Request Example for post/plan-service/plan
curl https://apigateway.payfirma.com/plan-service/plan \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"name": "Sample Daily Plan",
"amount": 10.99,
"currency": "CAD",
"frequency": "DAILY",
"number_of_payments": 10,
"send_receipt": false
}'
{
"id": 2992429,
"lookup_id": "99ffb59876mnb",
"name": "Sample Daily Plan",
"amount": 10.99,
"currency": "CAD",
"frequency": "DAILY",
"number_of_payments": 10,
"send_receipt": false,
"total_subscriptions": 10,
"current_subscriptions": 2
}