CreateSubscriptionRequest
Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge 1.00 USD).
110
Three-letter ISO currency code, in uppercase. Must be a supported currency.
EUR
Subscription interval.
Enum Value | Description |
---|---|
day | Daily |
week | Weekly |
month | Monthly |
year | Yearly |
Possible values: [day
, week
, month
, year
]
month
Number of intervals between subscription payments.
1
An arbitrary string attached to the subscription. Often useful for displaying to users.
MoonMail Monthly Lite
customer object
The customer's email address.
john.doe@example.com
The customer's full name or business name.
John Doe
The customer's phone number in E.164 format.
null
billingDetails object
Billing information associated with the payment method at the time of the transaction.
The customer's billing full name.
John Doe
The customer's billing email address.
john.doe@example.com
The customer's billing phone number in E.164 format.
null
Billing company name.
null
Company tax ID.
null
address object
City, district, suburb, town, or village.
Málaga
Address line 1 (e.g., street, PO Box, or company name).
Fake Street 123
Address line 2 (e.g., apartment, suite, unit, or building).
null
ZIP or postal code.
1234
State, county, province, or region.
Málaga
shippingDetails object
Shipping information associated with the payment.
The shipping customer's full name.
John Doe
The shipping customer's email address.
john.doe@example.com
The shipping customer's phone number in E.164 format.
null
Name of the company where the shipment is going.
null
Company tax ID.
null
address object
City, district, suburb, town, or village.
Málaga
Address line 1 (e.g., street, PO Box, or company name).
Fake Street 123
Address line 2 (e.g., apartment, suite, unit, or building).
null
ZIP or postal code.
1234
State, county, province, or region.
Málaga
The end date of the trial period. Measured in seconds since the Unix epoch.
1636366897
Number of days the trial period lasts.
7
retrySchedule object[]
Defines a custom schedule for retrying failed subscription payments. Each entry in the array specifies how long to wait before attempting the next payment retry. If not specified, the system's default retry schedule will be used.
The unit of time to wait before the retry attempt.
Enum Value | Description |
---|---|
day | Daily |
week | Weekly |
month | Monthly |
year | Yearly |
Possible values: [day
, week
, month
, year
]
day
The number of intervals to wait before the retry attempt.
Possible values: >= 1
and <= 31
3
The URL will be called each time subscription status changes. You will receive a subscription object in the body of the request.
https://example.com/subscriptions/callback
The URL will be called each time subscription creates a new payments. You will receive the payment object in the body of the request.
https://example.com/payments/callback
A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.
{"systemId":"12345"}
{
"amount": 110,
"currency": "EUR",
"interval": "month",
"intervalCount": 1,
"description": "MoonMail Monthly Lite",
"customer": {
"email": "john.doe@example.com",
"name": "John Doe",
"phone": null
},
"billingDetails": {
"name": "John Doe",
"email": "john.doe@example.com",
"phone": null,
"company": null,
"taxId": null,
"address": {
"country": "ES",
"city": "Málaga",
"line1": "Fake Street 123",
"line2": null,
"zip": "1234",
"state": "Málaga"
}
},
"shippingDetails": {
"name": "John Doe",
"email": "john.doe@example.com",
"phone": null,
"company": null,
"taxId": null,
"address": {
"country": "ES",
"city": "Málaga",
"line1": "Fake Street 123",
"line2": null,
"zip": "1234",
"state": "Málaga"
}
},
"trialPeriodEnd": 1636366897,
"trialPeriodDays": 7,
"retrySchedule": [
{
"interval": "day",
"intervalCount": 1
},
{
"interval": "day",
"intervalCount": 3
},
{
"interval": "week",
"intervalCount": 1
}
],
"callbackUrl": "https://example.com/subscriptions/callback",
"paymentCallbackUrl": "https://example.com/payments/callback",
"metadata": {
"systemId": "12345"
}
}