-
Notifications
You must be signed in to change notification settings - Fork 4
[NCE-917] Update docs for prepaid cards #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c8761d4
1c4d1e9
a57b213
0a398ee
60fa1a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| node_modules | ||
| .pnpm-store |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| --- | ||
| title: "Card spend controls" | ||
| description: "Limit which merchants a Prepaid Visa Card can be used for" | ||
| icon: "shield-check" | ||
| --- | ||
|
|
||
| You can control where a prepaid Visa card can be spent by attaching a **Runa-authored spend rule template** to the card. A template bundles a set of restrictions — such as Merchant Category Code (MCC) allow/deny lists — that are applied to the issued card. | ||
|
|
||
| ## Attaching a template | ||
|
|
||
| To attach a template, add a `usage_config` object to the `SINGLE` product and set its `spend_rules_template_id` to the identifier of the template you want to apply. | ||
|
|
||
| ```http title="Example Prepaid Visa Card order with a spend rule template" icon="globe" expandable | ||
| POST https://api.runa.io/v2/order | ||
| Content-Type: application/json | ||
| X-Api-Key: <your API key> | ||
|
|
||
| { | ||
| "payment_method": { | ||
| "type": "ACCOUNT_BALANCE", | ||
| "currency": "USD" | ||
| }, | ||
| "items": [ | ||
| { | ||
| "face_value": 10, | ||
| "distribution_method": { | ||
| "type": "EMAIL", | ||
| "email_address": "<your recipient's email address>" | ||
| }, | ||
| "products": { | ||
| "type": "SINGLE", | ||
| "value": "VISASL-3M-USD", | ||
| "usage_config": { | ||
| "spend_rules_template_id": "PSR-01HW3CXZJD5K9PMNRTV0Y4QF7B" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| When you set `usage_config` on an order, it is returned in the [order details](/reference/2024-02-05/endpoint/orders/get) so you can confirm which template was applied. | ||
|
|
||
| <Info> | ||
| Spend rule templates are authored by Runa. A single template is applied per | ||
| card, with multiple restrictions bundled inside it. Template identifiers are | ||
| immutable — any change ships as a new template with a new ID. To request a | ||
| template, reach out to your Account Manager or email support@runa.io. | ||
| </Info> | ||
|
|
||
| <Note> | ||
| `usage_config` only applies to prepaid Visa cards. If you set it on any other | ||
| product it is ignored. | ||
| </Note> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -864,7 +864,7 @@ | |
| "$ref": "#/components/schemas/MultipleProduct" | ||
| }, | ||
| { | ||
| "$ref": "#/components/schemas/SingleProduct" | ||
| "$ref": "#/components/schemas/SingleProductWithUsageConfig" | ||
| }, | ||
| { | ||
| "$ref": "#/components/schemas/PayoutSelectionTemplateDetailed" | ||
|
|
@@ -1268,7 +1268,7 @@ | |
| "description": "Choose `SINGLE` if you want the end user to redeem the face value on a single specific product. Choose `MULTIPLE` if the end user can choose to spend the face value across multiple products.", | ||
| "oneOf": [ | ||
| { | ||
| "$ref": "#/components/schemas/SingleProduct" | ||
| "$ref": "#/components/schemas/SingleProductWithUsageConfig" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why rename the component rather than extending the existing one? Ideally we apply this to all cases, other services such as the estimate endpoint can ignore the extra fields for now.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my idea was to not include this parameter in the estimate endpoints. It is optional, but it serves no purpose for the estimate endpoint |
||
| }, | ||
| { | ||
| "$ref": "#/components/schemas/MultipleProduct" | ||
|
|
@@ -1587,6 +1587,50 @@ | |
| "enum": ["SINGLE"], | ||
| "description": "Single product. When only one product code is provided." | ||
| }, | ||
| "SingleProductWithUsageConfig": { | ||
| "title": "Single", | ||
| "required": ["type", "value"], | ||
| "type": "object", | ||
| "example": { | ||
| "type": "SINGLE", | ||
| "value": "AMZ-US" | ||
|
angel-obretenov-runa marked this conversation as resolved.
|
||
| }, | ||
| "properties": { | ||
| "type": { | ||
| "$ref": "#/components/schemas/SingleProductType" | ||
| }, | ||
| "value": { | ||
| "title": "Value", | ||
| "description": "The code for the product the end user will get when redeeming their payout link.", | ||
|
angel-obretenov-runa marked this conversation as resolved.
|
||
| "minLength": 1, | ||
| "example": "AMZ-US", | ||
|
angel-obretenov-runa marked this conversation as resolved.
|
||
| "type": "string" | ||
| }, | ||
| "usage_config": { | ||
| "description": "Optional. **Only applicable to prepaid Visa cards.** Attaches an MCC-rules template to the issued card. Ignored for all other products. See [Card spend controls](/features/prepaid-visa/spend-controls) for a worked example. When set on a prepaid Visa card order, it is returned in the order details.", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/components/schemas/ProductUsageConfig" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "description": "Single product. The end user will be able to redeem the payout link for this specific product." | ||
| }, | ||
| "ProductUsageConfig": { | ||
| "title": "ProductUsageConfig", | ||
| "type": "object", | ||
| "description": "Additional configuration applied to the issued product. Only applicable to prepaid Visa cards.", | ||
| "properties": { | ||
| "spend_rules_template_id": { | ||
| "title": "MCC rules template ID", | ||
| "description": "Identifier of a Runa-authored MCC-rules template applied to the issued card.\n\nOnly applicable to prepaid Visa cards. A single template is applied per card, with multiple restrictions bundled inside that one template. Template identifiers are immutable — changes ship as a new template with a new ID.", | ||
| "type": "string", | ||
| "pattern": "^PSR-[0-9A-HJKMNP-TV-Z]{26}$", | ||
| "example": "PSR-01HW3CXZJD5K9PMNRTV0Y4QF7B" | ||
| } | ||
| } | ||
| }, | ||
| "MultipleProduct": { | ||
| "title": "Multiple", | ||
| "required": ["type", "values"], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page leaves an open question of where these template IDs come from. Have we got that yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left at the bottom of the page some info on how to get that
