Welcome to Anyway! We are currently in Early Access, check out our website at Anyway for more info!
curl --location --request POST '/v1/subscriptions/v2/setup' \
--header 'x-org-id: {{orgId}}' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"productId": "8iq40gcl3285",
"setupSuccessUrl": "https://anyway.sh",
"setupCancelUrl": "https://failed.com",
"webhookUrl": "https://anyway.sh",
"customerEmail": "jbaker@gmail.com",
"customerFirstName": "Johnny",
"customerLastName": "Baker",
"customerCountry": "USA"
}'{
"success": true,
"message": "Subscription setup created successfully. Redirect customer to setup_url.",
"data": {
"paymentUrl": "https://payment.dev.anyway.sh/pay?token=eyJhbGciOiJIUzM4NCJ9.eyJvcmRlcklkIjoiUElfM2Y0MmJlMWZjOTEyNDZhYzg3ODc2M2M2NWM0ODJkYzMiLCJtZXJjaGFudElkIjoiT1JHMjVHMUw4VEI1RzAzTjEiLCJ0eXBlIjoic3Vic2NyaXB0aW9uX3NldHVwIiwic3Vic2NyaXB0aW9uSWQiOiJzdWJfZjZmZDZkNDRmZjJmNDk1ODhjMGEwNzEwZTc1ZjU2ZjYiLCJzdWIiOiJQSV8zZjQyYmUxZmM5MTI0NmFjODc4NzYzYzY1YzQ4MmRjMyIsImlhdCI6MTc2MDQxMDAyMCwiZXhwIjoxNzYwNDEzNjIwfQ.ZUU3FlKnylD7lBL0VEhhnzy6D8TLwZg8u9OT-TeMhJxhKqR0cUkRGxXywZVyfozz",
"orderId": "PI_3f42be1fc91246ac878763c65c482dc3",
"setupJwtToken": null,
"subscriptionId": "sub_f6fd6d44ff2f49588c0a0710e75f56f6",
"status": "PAYMENT_PENDING",
"expiresIn": 3600000
},
"error": null
}