Skip to content

Instantly share code, notes, and snippets.

@lionelbarrow
Created December 2, 2013 16:07
Show Gist options
  • Save lionelbarrow/7751833 to your computer and use it in GitHub Desktop.
Save lionelbarrow/7751833 to your computer and use it in GitHub Desktop.
Braintree subscription create XML with add-ons and discounts
The type="array" is necessary
<subscription>
<payment-method-token>the_payment_method_token</payment-method-token>
<plan-id>the_plan_id</plan-id>
<add-ons>
<add type="array">
<item>
<inherited-from-id>add_on_id_1</inherited-from-id>
<amount>20.00</amount>
</item>
</add>
<update type="array">
<item>
<existing-id>add_on_id_2</existing-id>
<quantity type="integer">2</quantity>
</item>
</update>
<remove type="array">
<item>add_on_id_3</item>
</remove>
</add-ons>
<discounts>
<add type="array">
<item>
<inherited-from-id>discount_id_1</inherited-from-id>
<amount>15.00</amount>
</item>
</add>
<update type="array">
<item>
<existing-id>discount_id_2</existing-id>
<quantity type="integer">3</quantity>
</item>
</update>
<remove type="array">
<item>discount_id_3</item>
</remove>
</discounts>
</subscription>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment