Skip to main content
POST
/
api
/
v1
/
subscription
/
create
Create Subscription
curl --request POST \
  --url https://www.waffo.com/api/v1/subscription/create \
  --header 'Content-Type: application/json' \
  --data '
{
  "subscriptionRequest": "<string>",
  "merchantSubscriptionId": "PLAN_001",
  "currency": "USD",
  "amount": 100,
  "productInfo": {
    "description": "Premium Monthly Subscription",
    "periodType": "MONTHLY",
    "periodInterval": 1,
    "numberOfPeriod": 12,
    "trialPeriodAmount": 0,
    "numberOfTrialPeriod": 1,
    "trialPeriodType": "MONTHLY",
    "trialPeriodInterval": 1
  },
  "merchantInfo": {
    "merchantId": 1000000201,
    "subMerchantId": "<string>"
  },
  "userInfo": {
    "userId": "USER001",
    "userEmail": "user@example.com",
    "userTerminal": "<string>",
    "userPhone": "+62-08990013157",
    "userFirstName": "<string>",
    "userLastName": "<string>",
    "userCreatedAt": "2023-11-07T05:31:56Z"
  },
  "requestedAt": "2023-11-07T05:31:56Z",
  "notifyUrl": "https://merchant-notify-url.com",
  "userCurrency": "<string>",
  "addressInfo": {
    "address": "<string>",
    "city": "<string>",
    "region": "<string>",
    "postcode": "<string>",
    "addressCountryCode": "<string>"
  },
  "brandInfo": {
    "cashierLogoUrl": "<string>",
    "cashierDisplayName": "<string>",
    "cashierProductImageUrl": "<string>"
  },
  "successRedirectUrl": "https://merchant-success-redirecturl.com",
  "failedRedirectUrl": "https://merchant-failed-redirecturl.com",
  "cancelRedirectUrl": "https://merchant-cancel-url.com",
  "riskData": {
    "userType": "Individual",
    "userCategory": "Member",
    "userLegalName": "John Doe",
    "userDisplayName": "John",
    "userRegistrationIp": "192.168.1.1",
    "userLastSeenIp": "192.168.1.1",
    "userIsNew": "No",
    "userIsFirstPurchase": "No"
  },
  "subscriptionManagementUrl": "https://merchant.com/subscription/manage",
  "extendInfo": "<string>",
  "orderExpiredAt": "2023-11-07T05:31:56Z"
}
'
{
  "code": "<string>",
  "msg": "<string>",
  "data": {
    "subscriptionRequest": "<string>",
    "merchantSubscriptionId": "<string>",
    "subscriptionId": "<string>",
    "payMethodSubscriptionId": "<string>",
    "subscriptionStatus": "<string>",
    "subscriptionAction": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://waffo.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Body

application/json
subscriptionRequest
string
required

Subscription request id sent from Merchant. It will also be used for idempotent check.

Maximum string length: 32
merchantSubscriptionId
string
required

Merchant subscription plan ID assigned to this user

Maximum string length: 64
Example:

"PLAN_001"

currency
string
required

Merchant subscription currency, for example USD

Maximum string length: 12
Example:

"USD"

amount
string
required

Merchant subscription amount, for example 100

Maximum string length: 24
Example:

100

productInfo
object
required

Subscription product info

merchantInfo
object
required

Merchant info

userInfo
object
required

User info

requestedAt
string<date-time>
required

Merchant-side request time

notifyUrl
string
required

The callback address to notify the merchant after the subscription is completed / failed

Maximum string length: 256
Example:

"https://merchant-notify-url.com"

userCurrency
string

User payment currency. This is needed when merchant order currency is NOT the same as user payment currency

Maximum string length: 12
goodsInfo
object

Merchant goods information

addressInfo
object

Address Information

brandInfo
object

Brand display information for cashier

paymentInfo
object

Payment information

successRedirectUrl
string

The address of the merchant page to redirect to after successful subscription payment. If no value is provided, it will stay on the cashier page after successful payment.

Maximum string length: 512
Example:

"https://merchant-success-redirecturl.com"

failedRedirectUrl
string

The address of the merchant page to which the payment pre-verification fails, or the redirection after the payment fails. If no value is provided, it will stay on the cashier page after the payment fails

Maximum string length: 512
Example:

"https://merchant-failed-redirecturl.com"

cancelRedirectUrl
string

User will be redirected to this page if user choose to cancel and not continue the payment

Maximum string length: 512
Example:

"https://merchant-cancel-url.com"

riskData
object

Risk data for compliance

subscriptionManagementUrl
string

It refers to the subscription management page for users on the merchant side.

Maximum string length: 256
Example:

"https://merchant.com/subscription/manage"

extendInfo
string

Reserved. Json format e.g. {"key1":"value1", "key2":"value2"}

Maximum string length: 256
orderExpiredAt
string<date-time>

The order expiry time set by merchant. User is required to input payment data on Waffo cashier page prior to merchant's order expiry time. If not provided, the default is 4 hours

Response

200 - */*

OK

response data

code
string
msg
string
data
object