Created
June 26, 2014 05:58
-
-
Save jcleblanc/b2abe0da1904b700c71f to your computer and use it in GitHub Desktop.
paypal_rest_subscriptions_billing_agreement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -v POST https://api.sandbox.paypal.com/v1/payments/billing-plans \ | |
-H 'Content-Type:application/json' \ | |
-H 'Authorization: Bearer {accessToken}' \ | |
-d '{ | |
"name": "Fruit of the Month", | |
"description": "10 Pound Box of Fruit", | |
"type": "fixed", | |
"payment_definitions": [ | |
{ | |
"name": "Standard Package", | |
"type": "REGULAR", | |
"frequency": "MONTH", | |
"frequency_interval": "2", | |
"amount": { | |
"value": "50", | |
"currency": "USD" | |
}, | |
"cycles": "12", | |
"charge_models": [ | |
{ | |
"type": "SHIPPING", | |
"amount": { | |
"value": "8", | |
"currency": "USD" | |
} | |
}, | |
{ | |
"type": "TAX", | |
"amount": { | |
"value": "4", | |
"currency": "USD" | |
} | |
} | |
] | |
}, | |
{ | |
"name":"First Month Free Trial", | |
"type":"TRIAL", | |
"frequency":"MONTH", | |
"frequency_interval":"1", | |
"amount": { | |
"value" : "50", | |
"currency" : "USD" | |
}, | |
"cycles":"1", | |
"charge_models": [ | |
{ | |
"type":"SHIPPING", | |
"amount": { | |
"value" :"8", | |
"currency" : "USD" | |
} | |
}, | |
{ | |
"type":"TAX", | |
"amount": { | |
"value" :"4", | |
"currency" : "USD" | |
} | |
} | |
] | |
}], | |
"merchant_preferences": { | |
"setup_fee": { | |
"value": "1", | |
"currency": "USD" | |
}, | |
"return_url": "http://www.fruitofthemonth.com/complete", | |
"cancel_url": "http://www.fruitofthemonth.com/cancel", | |
"autobill_amount": "YES", | |
"initial_amount_fail_action": "CONTINUE", | |
"max_fail_attempts": "0" | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The line 41 contains
"amount": {
and the line 44 contains closing bracket that should be lower in the JSON.The first month should a free trial but the snippet indicate that the first month is not really free.