{"_id":"572be2df73c5671700a7ab95","project":"55dd0853d2d97337001800e2","parentDoc":null,"githubsync":"","user":"55dd080d0efd5821000d53b3","__v":2,"category":{"_id":"572be252de40590e00026934","project":"55dd0853d2d97337001800e2","version":"55de36ec9067202b00de0015","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-05-06T00:16:18.383Z","from_sync":false,"order":5,"slug":"billing-portal","title":"Billing Portal"},"version":{"_id":"55de36ec9067202b00de0015","__v":33,"project":"55dd0853d2d97337001800e2","createdAt":"2015-08-26T22:00:12.384Z","releaseDate":"2015-08-26T22:00:12.383Z","categories":["55de36ed9067202b00de0016","55de36ed9067202b00de0017","55de36ed9067202b00de0018","55df7dcd437b3f0d004ba204","55e4e014177b6e0d00333141","55e4e01fe252ac0d00303a99","55e4e05240cda60d003bad67","55e4e070177b6e0d00333142","55e4e0753325e60d007fbee6","55e4e0803325e60d007fbee7","55e4e086177b6e0d00333143","55e4e0a1177b6e0d00333144","55e4e0aa3325e60d007fbee8","55e4e0b140cda60d003bad6b","55e4e0bae252ac0d00303a9d","55e4e0c5177b6e0d00333145","55e4e0ee3325e60d007fbeea","55e4e0fae252ac0d00303a9e","55e4e100177b6e0d00333147","55f85c8ba3271b0d00498d55","56092e1ac5cff70d007d0131","564b64a3ee12850d0095866e","564b64b5791099170071e9ea","565cd0bfd18ae50d007183d8","565f5f5d6bafd40d0030a063","565f790d6bafd40d0030a09f","56611c464851190d003f9f5d","56637d5b7988ab0d00d0522e","56637d687988ab0d00d0522f","567835df6928b40d009dd650","56e59c043c29b117008dae5b","5704013559c5190e000ab646","572be252de40590e00026934","58af1bf6ebd7370f0078ba09","5cdad81d912ece0039e9a939"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-06T00:18:39.633Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"payment.amount=10.00&currency=USD\",\n      \"language\": \"text\",\n      \"name\": \"Dot Notation Parameters\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://api.paystand.co/v3/plugins/paystand/checkout?k=0yqowfwfxb2vpnuv9ovpqvgt&t=classic&l=desktop&p.a=10.24&c=USD&b.s=41 Grandview St&b.c=Santa Cruz&b.p=95060&b.d=CA&b.u=USA&y.n=Christina Chan&y.e=demo%2Bcchan:::at:::paystand.com&z.foo.bar=quux&z.foo.baz=norf&m.0=echeck&m.1=card\",\n      \"language\": \"http\",\n      \"name\": \"Payment\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://api.paystand.co/v3/plugins/paystand/checkout?k=5xscm967dw77l5yhl641eqp9&c=USD&m.0=echeck&m.1=card&b.s=100 Bay St&b.c=Santa Cruz&b.p=95060&b.d=CA&b.u=USA&y.n=Christina Chan&y.e=demo%2Bcchan@paystand.com&z.foo.bar=quux&z.foo.baz=norf&r.n=One year lease&r.d=120 Swift St. 12 Month Lease&r.i.0.n=Monthly Rent&r.i.0.d=Rent of $1200 is due on the first of every month&r.i.0.s.n=Rent&r.i.0.s.d=Pay rent on the 1st of the month&r.i.0.s.i=month&r.i.0.s.c=1&r.i.0.s.a=start&r.i.0.s.s=2016-04-01T00:00&r.i.0.s.t=12&r.i.0.a=1200.00&r.i.1.n=Application Fee&r.i.1.d=One time application fee of $150.00&r.i.1.s.n=Application Fee&r.i.1.s.d=Pay a one time non-refundable application fee&r.i.1.a=150.00&r.i.2.n=Security Deposit&r.i.2.d=$2000 Refundable security deposit that can be used to cover damages&r.i.2.s.n=Deposit&r.i.2.s.d=Security deposit or the home&r.i.2.s.s=2016-04-01T00:00&r.i.2.a=2000.00\\n\",\n      \"language\": \"http\",\n      \"name\": \"Scheduled Payment\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\nFor use cases where the URL encoded, JSON formatted init parameter does not work well, the Billing Portal can alternatively be initialized by adding parameters to the URL. For each value in the init object that needs to be set, a URL parameter is added and named using the flattened dot-notation format.\n[flat\n\nThe Flattened Dot Notation Parameters is a concatenation of all the names for each level of the hierarchical object structure separated by a dot starting with the root all the way down to the targeted property.\n\nFor example, the payment amount of $100 can be specified by adding \"?payment.amount=100&currency=USD\" to the base url.\n\nWhen the init object includes an array, such as the array of scheduled items for a scheduled payment, each item in the array should be specified separately using the numerical index.  For example, r.i.0.n=Item One Name&r.i.0.d=Item One Description&r.i.1.n=Item Two Name&r.i.1.d=Item Two Description.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Shorthand using abbrevations\",\n  \"body\": \"Both Billing Portal initialization methods support the same parameter name abbreviations as checkout. This is especially important given that the total URL length is limited to 4 Kbyte and can get quickly inflated when metadata or a complex scheduled payment is added.\"\n}\n[/block]","excerpt":"","slug":"portal-flattened-dot-notation-parameters","type":"basic","title":"Flattened Dot Notation Parameters"}

Flattened Dot Notation Parameters


[block:code] { "codes": [ { "code": "payment.amount=10.00&currency=USD", "language": "text", "name": "Dot Notation Parameters" } ], "sidebar": true } [/block] [block:code] { "codes": [ { "code": "https://api.paystand.co/v3/plugins/paystand/checkout?k=0yqowfwfxb2vpnuv9ovpqvgt&t=classic&l=desktop&p.a=10.24&c=USD&b.s=41 Grandview St&b.c=Santa Cruz&b.p=95060&b.d=CA&b.u=USA&y.n=Christina Chan&y.e=demo%2Bcchan@paystand.com&z.foo.bar=quux&z.foo.baz=norf&m.0=echeck&m.1=card", "language": "http", "name": "Payment" } ], "sidebar": true } [/block] [block:code] { "codes": [ { "code": "https://api.paystand.co/v3/plugins/paystand/checkout?k=5xscm967dw77l5yhl641eqp9&c=USD&m.0=echeck&m.1=card&b.s=100 Bay St&b.c=Santa Cruz&b.p=95060&b.d=CA&b.u=USA&y.n=Christina Chan&y.e=demo%2Bcchan@paystand.com&z.foo.bar=quux&z.foo.baz=norf&r.n=One year lease&r.d=120 Swift St. 12 Month Lease&r.i.0.n=Monthly Rent&r.i.0.d=Rent of $1200 is due on the first of every month&r.i.0.s.n=Rent&r.i.0.s.d=Pay rent on the 1st of the month&r.i.0.s.i=month&r.i.0.s.c=1&r.i.0.s.a=start&r.i.0.s.s=2016-04-01T00:00&r.i.0.s.t=12&r.i.0.a=1200.00&r.i.1.n=Application Fee&r.i.1.d=One time application fee of $150.00&r.i.1.s.n=Application Fee&r.i.1.s.d=Pay a one time non-refundable application fee&r.i.1.a=150.00&r.i.2.n=Security Deposit&r.i.2.d=$2000 Refundable security deposit that can be used to cover damages&r.i.2.s.n=Deposit&r.i.2.s.d=Security deposit or the home&r.i.2.s.s=2016-04-01T00:00&r.i.2.a=2000.00\n", "language": "http", "name": "Scheduled Payment" } ], "sidebar": true } [/block] For use cases where the URL encoded, JSON formatted init parameter does not work well, the Billing Portal can alternatively be initialized by adding parameters to the URL. For each value in the init object that needs to be set, a URL parameter is added and named using the flattened dot-notation format. [flat The Flattened Dot Notation Parameters is a concatenation of all the names for each level of the hierarchical object structure separated by a dot starting with the root all the way down to the targeted property. For example, the payment amount of $100 can be specified by adding "?payment.amount=100&currency=USD" to the base url. When the init object includes an array, such as the array of scheduled items for a scheduled payment, each item in the array should be specified separately using the numerical index. For example, r.i.0.n=Item One Name&r.i.0.d=Item One Description&r.i.1.n=Item Two Name&r.i.1.d=Item Two Description. [block:callout] { "type": "info", "title": "Shorthand using abbrevations", "body": "Both Billing Portal initialization methods support the same parameter name abbreviations as checkout. This is especially important given that the total URL length is limited to 4 Kbyte and can get quickly inflated when metadata or a complex scheduled payment is added." } [/block]