WalletSubAccount

Companies that support Multi-Wallet setup can create WalletSubAccounts

List WalletSubAccounts

GET /orgs/{org_pk}/wallet-subaccounts/

Example request:

curl -iL --request GET "https://www.readycloud.com/api/v2/orgs/1/wallet-subaccounts/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"

Response 200 (application/json):

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "url": "/api/v2/orgs/1/wallet-subaccounts/1/",
      "unique_id": "acme",
      "bill_to": {
        "company": "ABC Inc.",
        "first_name": "John",
        "last_name": "Doe",
        "address_1": "123 Main St",
        "address_2": "",
        "city": "New York",
        "state": "NY",
        "post_code": "10001",
        "country": "USA",
        "phone": "555-555-5555",
        "email": "[email protected]",
        "residential": false,
        "validated": false,
        "updated_at": "2024-03-10T16:19:25Z",
        "created_at": "2024-03-10T16:19:25Z"
      },
      "ship_to": {
        "company": "XYZ Corp.",
        "first_name": "Jane",
        "last_name": "Smith",
        "address_1": "456 Elm St",
        "address_2": "Apt 2",
        "city": "Los Angeles",
        "state": "CA",
        "post_code": "90001",
        "country": "USA",
        "phone": "555-123-4567",
        "email": "[email protected]",
        "residential": true,
        "validated": true,
        "updated_at": "2024-03-10T16:19:25Z",
        "created_at": "2024-03-10T16:19:25Z"
      },
      "name": "Acme Inc.",
      "email": null,
      "token": "e18a6d4a7627e462d64fd30a7d1ea160",
      "refresh_token": "f3b893ecf1da71c5359b4322ac8baac9",
      "token_expires_at": "1710085765",
      "stripe_client_id": "f71c474a9ec1abf10b2d8022ffabe8",
      "stripe_credit_card": "9a3bb058d002a90aab813f7a223a70b1",
      "wallet_auto_refill_limit": "10.00 USD",
      "wallet_auto_refill_amount": "20.00 USD",
      "negative_wallet_balance_reached_at": null,
      "suspended_at": "2024-03-10T16:19:25Z",
      "updated_at": "2024-03-10T16:19:25Z",
      "created_at": "2024-03-10T16:19:25Z"
    },
    {
      "url": "/api/v2/orgs/ORG/wallet-subaccounts/2/",
      "unique_id": "pear",
      "bill_to": {
        "company": "Smith & Sons",
        "first_name": "Michael",
        "last_name": "Smith",
        "address_1": "789 Oak Ave",
        "address_2": "Suite 100",
        "city": "Chicago",
        "state": "IL",
        "post_code": "60601",
        "country": "USA",
        "phone": "555-789-1234",
        "email": "[email protected]",
        "residential": false,
        "validated": true,
        "updated_at": "2024-03-10T16:19:25Z",
        "created_at": "2024-03-10T16:19:25Z"
      },
      "ship_to": {
        "company": "Johnson Co.",
        "first_name": "Emily",
        "last_name": "Johnson",
        "address_1": "101 Pine St",
        "address_2": "",
        "city": "Miami",
        "state": "FL",
        "post_code": "33101",
        "country": "USA",
        "phone": "555-987-6543",
        "email": "[email protected]",
        "residential": true,
        "validated": true,
        "updated_at": "2024-03-10T16:19:25Z",
        "created_at": "2024-03-10T16:19:25Z"
      },
      "name": "Pear Inc.",
      "email": null,
      "access_token": "25ef6e6b686fb5d39ca44fb4832be924",
      "refresh_token": "d1f064564fff0def91246c9b57697d35",
      "token_expires_at": "1710085765",
      "stripe_client_id": "96091585b8cd0898dd1ed3147f9603",
      "stripe_credit_card": "a72dbfd6e32f38ad252390ec19f1477b",
      "wallet_auto_refill_limit": "30.00 USD",
      "wallet_auto_refill_amount": "15.00 USD",
      "negative_wallet_balance_reached_at": "2024-03-10T16:19:25Z",
      "suspended_at": null,
      "updated_at": "2024-03-10T16:19:25Z",
      "created_at": "2024-03-10T16:19:25Z"
    }
  ]
}

Get WalletSubAccount

GET /orgs/{org_pk}/wallet-subaccounts/{subaccount_pk}/

Example request:

curl -iL --request GET "https://www.readycloud.com/api/v2/orgs/1/wallet-subaccounts/1/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"

Response 200 (application/json):

{
  "url": "/api/v2/orgs/1/wallet-subaccounts/1/",
  "unique_id": "acme",
  "bill_to": {
    "company": "ABC Inc.",
    "first_name": "John",
    "last_name": "Doe",
    "address_1": "123 Main St",
    "address_2": "",
    "city": "New York",
    "state": "NY",
    "post_code": "10001",
    "country": "USA",
    "phone": "555-555-5555",
    "email": "[email protected]",
    "residential": false,
    "validated": false,
    "updated_at": "2024-03-10T16:19:25Z",
    "created_at": "2024-03-10T16:19:25Z"
  },
  "ship_to": {
    "company": "XYZ Corp.",
    "first_name": "Jane",
    "last_name": "Smith",
    "address_1": "456 Elm St",
    "address_2": "Apt 2",
    "city": "Los Angeles",
    "state": "CA",
    "post_code": "90001",
    "country": "USA",
    "phone": "555-123-4567",
    "email": "[email protected]",
    "residential": true,
    "validated": true,
    "updated_at": "2024-03-10T16:19:25Z",
    "created_at": "2024-03-10T16:19:25Z"
  },
  "name": "Acme Inc.",
  "email": null,
  "token": "e18a6d4a7627e462d64fd30a7d1ea160",
  "refresh_token": "f3b893ecf1da71c5359b4322ac8baac9",
  "token_expires_at": "1710085765",
  "stripe_client_id": "f71c474a9ec1abf10b2d8022ffabe8",
  "stripe_credit_card": "9a3bb058d002a90aab813f7a223a70b1",
  "wallet_auto_refill_limit": "10.00 USD",
  "wallet_auto_refill_amount": "20.00 USD",
  "negative_wallet_balance_reached_at": null,
  "suspended_at": "2024-03-10T16:19:25Z",
  "updated_at": "2024-03-10T16:19:25Z",
  "created_at": "2024-03-10T16:19:25Z"
}

Create WalletSubAccount

Create new WalletSubAccount. Note that 400 response will be returned if WalletSubAccount with supplied unique_id already exists.

POST /orgs/{org_pk}/wallet-subaccounts/

  • Attributes:
    • unique_id (required) - unique identifier of the customer.
    • bill_to - customer’s billing address
    • ship_to - customer’s shipping address

Example request:

curl -iL --request POST -H "Content-Type: application/json" --upload-file data.json "https://www.readycloud.com/api/v2/orgs/1/wallet-subaccounts/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"

data.json:

{
  "unique_id": "orange",
  "bill_to": {
    "company": "Orange Co.",
    "first_name": "Alice",
    "last_name": "Johnson",
    "address_1": "789 Maple Ave",
    "address_2": "Apt 200",
    "city": "Boston",
    "state": "MA",
    "post_code": "02101",
    "country": "USA",
    "phone": "555-123-4567",
    "email": "[email protected]",
    "residential": true,
    "validated": false
  },
  "ship_to": {
    "company": "Green Corp.",
    "first_name": "Bob",
    "last_name": "Smith",
    "address_1": "456 Pine St",
    "address_2": "Suite 50",
    "city": "Seattle",
    "state": "WA",
    "post_code": "98101",
    "country": "USA",
    "phone": "555-987-6543",
    "email": "[email protected]",
    "residential": false,
    "validated": true
  },
  "name": "Orange Inc.",
  "email": "[email protected]",
  "stripe_credit_card": "1a2b3c4d5e6f7g8h9i0j",
  "wallet_auto_refill_limit": "50.00 USD",
  "wallet_auto_refill_amount": "25.00 USD",
  "negative_wallet_balance_reached_at": null
}

Response 201 (application/json):

{
  "unique_id": "orange",
  "bill_to": {
    "company": "Orange Co.",
    "first_name": "Alice",
    "last_name": "Johnson",
    "address_1": "789 Maple Ave",
    "address_2": "Apt 200",
    "city": "Boston",
    "state": "MA",
    "post_code": "02101",
    "country": "USA",
    "phone": "555-123-4567",
    "email": "[email protected]",
    "residential": true,
    "validated": false
  },
  "ship_to": {
    "company": "Green Corp.",
    "first_name": "Bob",
    "last_name": "Smith",
    "address_1": "456 Pine St",
    "address_2": "Suite 50",
    "city": "Seattle",
    "state": "WA",
    "post_code": "98101",
    "country": "USA",
    "phone": "555-987-6543",
    "email": "[email protected]",
    "residential": false,
    "validated": true
  },
  "name": "Orange Inc.",
  "email": "[email protected]",
  "access_token": "e18a6d4a7627e462d64fd30a7d1ea160",
  "stripe_credit_card": "1a2b3c4d5e6f7g8h9i0j",
  "wallet_auto_refill_limit": "50.00 USD",
  "wallet_auto_refill_amount": "25.00 USD",
  "negative_wallet_balance_reached_at": null
}

Note that token is assigned upon the WalletSubAccount creation. Token will be valid for 30 minutes, after that you need to refer to the Refresh WalletSubAccount token section.

Update WalletSubAccount

Update specific WalletSubAccount.

PATCH /orgs/{org_pk}/wallet-subaccounts/{subaccount_pk}/

Example request:

curl -iL --request PATCH -H "Content-Type: application/json" --upload-file data.json "https://www.readycloud.com/api/v2/orgs/1/wallet-subaccounts/1/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"

data.json:

{
  "url": "/api/v2/orgs/1/wallet-subaccounts/1/",
  "suspended_at": "2024-03-13T02:12:48Z"
}

Response 200 (application/json):

{
  "url": "/api/v2/orgs/1/wallet-subaccounts/1/",
  "unique_id": "acme",
  "bill_to": {
    "company": "ABC Inc.",
    "first_name": "John",
    "last_name": "Doe",
    "address_1": "123 Main St",
    "address_2": "",
    "city": "New York",
    "state": "NY",
    "post_code": "10001",
    "country": "USA",
    "phone": "555-555-5555",
    "email": "[email protected]",
    "residential": false,
    "validated": false,
    "updated_at": "2024-03-10T16:19:25Z",
    "created_at": "2024-03-10T16:19:25Z"
  },
  "ship_to": {
    "company": "XYZ Corp.",
    "first_name": "Jane",
    "last_name": "Smith",
    "address_1": "456 Elm St",
    "address_2": "Apt 2",
    "city": "Los Angeles",
    "state": "CA",
    "post_code": "90001",
    "country": "USA",
    "phone": "555-123-4567",
    "email": "[email protected]",
    "residential": true,
    "validated": true,
    "updated_at": "2024-03-10T16:19:25Z",
    "created_at": "2024-03-10T16:19:25Z"
  },
  "name": "Acme Inc.",
  "email": null,
  "token": "e18a6d4a7627e462d64fd30a7d1ea160",
  "refresh_token": "f3b893ecf1da71c5359b4322ac8baac9",
  "token_expires_at": "1710085765",
  "stripe_client_id": "f71c474a9ec1abf10b2d8022ffabe8",
  "stripe_credit_card": "9a3bb058d002a90aab813f7a223a70b1",
  "wallet_auto_refill_limit": "10.00 USD",
  "wallet_auto_refill_amount": "20.00 USD",
  "negative_wallet_balance_reached_at": null,
  "suspended_at": "2024-03-13T02:12:48Z",
  "updated_at": "2024-03-10T16:19:25Z",
  "created_at": "2024-03-10T16:19:25Z"
}

Refresh WalletSubAccount token

Refresh token to get access for additional 30 minutes. client_id and client_secret will be granted by ReadyCloud support team. bearer_token and refresh_token are taken from token and refresh_token of respective WalletSubAccount API instance.

POST /api/v1/oauth2/token/

Example request:

curl -iL --request POST "https://www.readycloud.com/api/v1/oauth2/token/" -d "bearer_token=e18a6d4a7627e462d64fd30a7d1ea160" -d "refresh_token=f3b893ecf1da71c5359b4322ac8baac9" -d "grant_type=refresh_token" -d "client_id=dc08301101b7a2c0fa2b40c7f8b184" -d "client_secret=47b0106d8e3e6397c71d1c14f621b1"

Response 200 (application/json):

{
  "access_token": "e18a6d4a7627e462d64fd30a7d1ea160",
  "expires_in": 1800,
  "token_type": "bearer",
  "refresh_token": "f9956dbda773b3d88ad07c41e66f7b5f"
}

List WalletSubAccountTransactions

GET /orgs/{org_pk}/wallet-subaccounts/{subaccount_pk}/transactions/

Example request:

curl -iL --request GET "https://www.readycloud.com/api/v2/orgs/1/wallet-subaccounts/1/transactions/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"

Response 200 (application/json):

{
  "count": 2,
  "next": null,
  "previous": null,
  "current_wallet_balance": "9963.00 USD",
  "results": [
    {
      "url": "/api/v2/orgs/1/wallet-subaccounts/1/transactions/1/",
      "kind": "equipment_return",
      "amount": "9999.00 USD",
      "balance": "9999.00 USD",
      "transaction_type": "refill",
      "created_at": "2017-11-09T11:19:46Z",
      "last_transaction": null,
      "log": null,
      "order": null,
      "order_primary_id": null,
      "box": null,
      "confirm_of": null,
      "void_of": null,
      "voided_by": null,
      "confirmed_by": null
    },
    {
      "url": "/api/v2/orgs/1/wallet-subaccounts/1/transactions/2/",
      "kind": "equipment_return",
      "amount": "-36.00 USD",
      "balance": "9963.00 USD",
      "transaction_type": "refill",
      "created_at": "2017-11-09T11:19:46Z",
      "last_transaction": "/api/v2/orgs/1/wallet-subaccounts/1/transactions/1/",
      "log": null,
      "order": "/api/v2/orgs/1/orders/1/",
      "order_primary_id": "AB-1001-R1",
      "box": "/api/v2/orgs/1/orders/1/boxes/1/",
      "confirm_of": null,
      "void_of": null,
      "voided_by": null,
      "confirmed_by": null
    }
  ]
}
  • filters: GET parameters to filter results.

    Filters will limit the WalletSubAccountTransactions returned, all filters are optional, multiple filters can be specified.

    • created_at__date - 2021-09-19

      Example. Get all transactions that were created in the given date in ISO 8601 format.

Get WalletSubAccountTransaction

GET /orgs/{org_pk}/wallet-subaccounts/{subaccount_pk}/transactions/{transaction_pk}/

Example request:

curl -iL --request GET "https://www.readycloud.com/api/v2/orgs/1/wallet-subaccounts/1/transactions/1/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"

Response 200 (application/json):

{
  "url": "/api/v2/orgs/1/wallet-subaccounts/1/transactions/1/",
  "kind": "equipment_return",
  "amount": "9999.00 USD",
  "balance": "9999.00 USD",
  "transaction_type": "refill",
  "created_at": "2017-11-09T11:19:46Z",
  "last_transaction": null,
  "log": null,
  "order": null,
  "order_primary_id": null,
  "box": null,
  "confirm_of": null,
  "void_of": null,
  "voided_by": null,
  "confirmed_by": null
}