Encrypt a pay distribution config

Learn how to encrypt a pay distribution config.

To start the pay distribution update process in Link you must initialize it with the payDistributionConfig parameter set to an encrypted version of your pay distribution configuration.

The encryption is necessary to ensure your bank account details are never exposed on the front-end. Your full routing and account numbers always appear encrypted on the end user's device.

To encrypt your pay distribution config make a POST request into pay-distribution-configs/encrypt with your pay distribution config in the payload.

This request returns an encrypted version of the pay distribution config.

{
    "bank_account": {
        "bank_name": "New Bank",
        "routing_number": "084101234",
        "account_number": "9483746361234",
        "account_type": "checking"
    },
    "card": {
        "card_number": "4253177385403456",
        "cardholder_title": "Mr",
        "cardholder_first_name": "John",
        "cardholder_last_name": "Doe",
        "card_name": "Viza",
        "expiration_year": 2030,
        "expiration_month": 10,
        "card_cvc_cvv": "900",
        "address_line1": "759 Victoria Plaza",
        "address_line2": "Unit 12",
        "city": "Los Angeles",
        "state": "CA",
        "postal_code": "90210",
        "country": "US"
    },
    "entire_allocation": true
}

Validation

When encryption is performed, types and values in the card and bank_account objects are validated. This validation ensures that:

  • Each field is of the correct type.
  • Required fields are specified.
  • account_number, routing_number , card_number, and card_cvc_cvv fields contain only numbers and are the correct length.
  • The card expiration date is valid.
  • If either the first or last name card fields are specified, then the other field is as well.
  • If the cardholder title field is specified, the first and last name card fields are as well.
  • The pay distribution config is self-consistent. This means that:
    • At least one destination is set.
    • If bank_account is set, the validation ensures that either amount or percent allocation is set, or entire_allocation is true.
    • If entire_allocation is true, the validation ensures that neither amount or percent allocation is set.
    • Amount and percent allocations are self-consistent:
      • value, min_value, max_value are valid decimal numbers.
      • 0 ≤ min_value ≤ value ≤ max_value for amount allocation.
      • 0 ≤ min_value ≤ value ≤ max_value ≤ 100 for percent allocation.

When a card_source object is defined in your pay distribution configuration, the Argyle API validates it before encryption. This validation ensures that:

  • If the card_source object is defined, then bank_account or card objects cannot be present in the pay distribution configuration.
  • The value of the partner attribute must be unit. Accepted values can potentially change when more partners are integrated in the future.
Language
Authentication
Basic
base64
:
Click Try It! to start a request and see the response here!