NAV Navbar
Shell Ruby NodeJS Python Java PHP Go
  • Split API v1.0
  • Guides
  • Sandbox
  • Configuration
  • Agreements
  • Bank Accounts
  • Contacts
  • Open Agreements
  • Payment Requests
  • Payments
  • Payouts
  • Refund Requests
  • Refunds
  • Transactions
  • Unassigned Agreements
  • Users
  • Schemas
  • Split API v1.0

    Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

    Split allows you to make, get and manage payments using nothing but bank accounts.

    It is important to understand that there are 2 main ways Split can be used for maximum flexibility:

    1. Between Split accounts.
    2. Between a Split account and anyone.

    Due to the above, certain endpoints and techniques will differ slightly depending on who you are interacting with. You can find more on this in the Making payments and Getting paid guides.

    Conventions

    Guides

    Try it out

    The best way to familiarise yourself with our API is by interacting with it.

    We've preloaded a collection of all our endpoints for you to use in Postman. Before you start, load up our API collection:

    Run in Postman

    Okay, lets get things setup!

    1. Create a Split account

      If you haven't already, you'll want to create a sandbox Split account at https://go-sandbox.split.cash

    2. Register your application with Split

      Sign in and create an OAuth2 application: https://go-sandbox.split.cash/oauth/applications.

      Split OAuth2 app create

    3. Generate personal access tokens

      The quickest way to access your Split account via the API is using personal access tokens. Click on your newly created application from your application list and click on + Personal Access Token.

      Split locate personal OAuth2 tokens

      (You'll have the option to give the token a title)

      Split personal OAuth2 tokens

    4. Use personal access token in Postman

      You can use this access_token to authorise any requests to the Split API in Postman by choosing the Bearer Token option under the Authorization tab.

      Postman use personal OAuth2 tokens

    5. Make an API request!

      You are now ready to interact with your Split account via the API! Go ahead and send a request using Postman.

      Postman use personal OAuth2 tokens

    Get started

    This guide will help you setup an OAuth2 app in order to get authenticated & authorised to communicate with the Split API.

    Before you start:

    1. Create a Split account

      If you haven't already, you'll want to create a sandbox Split account at https://go-sandbox.split.cash.

    2. Choose authentication method

      All requests to the Split API require a access_token for authentication. There are two options for obtaining these tokens, the correct option will depend on your use case:

      Personal access token If you only need to access your own Split account via the API, then using personal access tokens are the most straight-forward way. Refer to Personal access token to setup. These tokens do not expire so no refreshing is required.

      OAuth grant flow When you require your application to act on behalf of other Split accounts you'll need to implement the OAuth grant flow process. Refer to OAuth grant flow guide to setup. There is also an OAuth grant flow tutorial. These access tokens expire every 2 hours, unless the offline_access scope is used in which case the tokens will not expire.

    Personal access token

    If you're looking to only access your own account via the API, you can generate a personal access token from the UI. These tokens do not expire, but can be deleted.

    OAuth grant flow

    1. Register your application with Split

      Once you've got your account up and running, sign in and create an OAuth2 profile for your application: https://go-sandbox.split.cash/oauth/applications

      Parameter Description
      Name The name of your application. When using the the Authorisation Grant Flow, users will see this name as the application requesting access to their account.
      Redirect URI Set this to your application's endpoint charged with receiving the authorisation code.
    2. Obtain an authorisation code

      Construct the initial URL the user will need to visit in order to grant your application permission to act on his/her behalf. The constructed URL describes the level of permission (scope), the application requesting permission (client_id) and where the user gets redirected once they've granted permission (redirect_uri).

      The URL should be formatted to look like this: https://go-sandbox.split.cash/oauth/authorize?response_type=code&client_id={client_id}&redirect_uri={redirect_uri}&scope={scope}

      Parameter Description
      response_type Always set to code
      client_id This is your Application ID as generated when you registered your application with Split
      redirect_uri URL where the user will get redirected along with the newly generated authorisation code
      scope The scope of permission you're requesting
    3. Exchange the authorisation code for an access token

      When the user visits the above-mentioned URL, they will be presented with a Split login screen and then an authorisation screen:

      Authorise OAuth2 app

      After the user has authorised your application, they will be returned to your application at the URL specified in redirect_uri along with the code query parameter as the authorisation code.

      Finally, the authorisation code can than be exchanged for an access token and refresh token pair by POSTing to: https://go-sandbox.split.cash/oauth/token

      Parameter Description
      grant_type Set to authorization_code
      client_id This is your Application ID as generated when you registered your application with Split
      client_secret This is your Secret as generated when you registered your application with Split
      code The authorisation code returned with the user
      redirect_uri Same URL used in step 3
    4. Wrap-up

      Now that you have an access token and refresh token, you can interact with the Split API as the user related to the access token. To do so, you must simply append the access token to the header of any API request: Authorization: Bearer {access_token}

    OAuth grant flow tutorial

    The OAuth grant flow process is demonstrated using Postman in the steps below.

    Before you start, load up our API collection:

    Run in Postman

    A screencast of this process is also available: https://vimeo.com/246203244.

    1. Create a Split account

      If you haven't already, you'll want to create a sandbox Split account at https://go-sandbox.split.cash

    2. Register your application with Split

      Sign in and create an OAuth2 application: https://go-sandbox.split.cash/oauth/applications.

      Use the special Postman callback URL: https://www.getpostman.com/oauth2/callback

      Split OAuth2 app setup

    3. In Postman, setup your environment variables

      Click on Manage Environments

      Postman environment variables

      We've included the Split Payments Public Sandbox environment to get you started. Go ahead an click on it.

      Select Postman environment

      Using the details from the OAuth2 app you created earlier, fill in the oauth2_application_id & oauth2_secret fields.

      Fill in environment values

    4. Setup the authorization

      Click on the Authorization tab and select OAuth 2.0

      Postman Authorization tab

      Click the Get New Access Token button

      Postman get new access token

      Fill in the OAuth2 form as below:

      Postman OAuth2

    5. Get authorised

      Click Request Token and wait a few seconds and a browser window will popup

      Sign in with your Split account (or any other Split account you want to authorise).

      Signin Split to authorise via OAuth2

      Click Authorise to allow the app to access the signed in account. Once complete, Postman will automatically exchange the authorisation code it received from Split for the access_token/refresh_token pair. It will then store the access_token/refresh_token for you to use in subsequent API requests. The access_token effectively allows you to send requests via the API as the user who provided you authorisation.

      Authorise OAuth2 app

    6. You're now ready to use the API

      Select an endpoint from the Split collection from the left hand side menu. Before you send an API request ensure you select your access token and Postman will automatically add it to the request header.

      Postman use token

    Authentication and Authorisation

    Split uses OAuth2 over https to manage authentication and authorisation.

    OAuth2 is a protocol that lets external applications request permission from another Split user to send requests on their behalf without getting their password. This is preferred over Basic Authentication because access tokens can be limited by scope and can be revoked by the user at any time.

    New to OAuth2? DigitalOcean has a fantastic 5 minute introduction to OAuth2.

    We currently support the authorisation code and refresh token grants.

    Authorisation Code Grant

    This type of grant allows your application to act on behalf of a user. If you've ever used a website or application with your Google, Twitter or Facebook account, this is the grant being used.

    See the Get Started guide for step by step details on how to use this grant.

    Refresh Token Grant

    Code sample

    curl -F "grant_type=refresh_token" \
         -F "client_id={{oauth2_application_id}}" \
         -F "client_secret={{oauth2_application_secret }}" \
         -F "refresh_token={{refresh_token}}" \
         -X POST https://go-sandbox.split.cash/oauth/token
    

    Example response

    {
        "access_token": "ad0b5847cb7d254f1e2ff1910275fe9dcb95345c9d54502d156fe35a37b93e80",
        "token_type": "bearer",
        "expires_in": 7200,
        "refresh_token": "cc38f78a5b8abe8ee81cdf25b1ca74c3fa10c3da2309de5ac37fde00cbcf2815",
        "scope": "public"
    }
    

    When using the authorisation code grant above, Split will return a refresh token along with the access token. Access tokens are short lived and last 2 hours but refresh tokens do not expire.

    When the access token expires, instead of sending the user back through the authorisation flow you can use the refresh token to retrieve a new access token with the same permissions as the old one.

    Making payments

    In order to payout funds, you'll be looking to use the Payments endpoint. Whether you're paying out another Split account holder or anyone, the process is the same:

    1. Add the recipient to your Contacts: Split Contact or Anyone Contact
    2. Make the Payment to your Contact.

    Common use cases:

    Getting paid

    There are 2 ways to get paid:

    POSTing a Payment Request

    Provides the ability to send a Payment Request (get paid) to any Contact that is either:

    For a Split Contact:

    For an Anyone Contact:

    Common use cases:

    Example flow embedding an Open Agreement link using an iFrame in order to automate future Payment Request approvals:

    Hosted Open Agreement

    Sharing an Open Payment Request

    Provides the ability to get paid once-off by a anyone whether they are a Split account holder or not.

    Usage notes:

    Common use cases:

    Example flow embedding the Open Payment Request link using an iFrame:

    Hosted Open Payment Request

    Idempotent requests

    Example response

    {
      "errors": [
        {
          "title": "Duplicate idempotency key",
          "detail": "A resource has already been created with this idempotency key",
          "links": {
            "about": "https://docs.split.cash/"
          },
          "meta": {
            "resource_ref": "PB.1a4"
          }
        }
      ]
    }
    

    The Split API supports idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a Payment is POSTed and a there is a network connection error, you can retry the Payment with the same idempotency key to guarantee that only a single Payment is created.

    To perform an idempotent request, provide an additional Idempotency-Key: <key> header to the request. You can pass any value as the key but we suggest that you use V4 UUIDs or another appropriately random string.

    Keys expire after 24 hours. If there is a subsequent request with the same idempotency key within the 24 hour period, we will return a 409 Conflict.

    Speeding up onboarding

    Consider the following scenario:

    Split is integrated in your application to handle payments.
    A customer would like to use Split but does not yet have Split account.
    You already have some information about this customer.

    Given the above, in a standard implementation where a customer enables/uses Split within your application, these are the steps they would follow:

    1. Click on some sort of button within your app to use Split.
    2. They get redirected to the Split sign in page (possibly via a popup or modal).
    3. Since they don't yet have a Split account, they would click on sign up.
    4. They would fill in all their signup details and submit.
    5. They would be presented with the authorisation page.
    6. They would click the "Authorise" button and be redirected to your app.

    Whilst not too bad, we can do better!

    In order to speed up the process, we allow query string params to be appended to the authorisation URL. For instance, if we already have some information about the customer and know they probably don't have a Split account, we can embed this information in the authorisation URL.

    Supported query string parameters

    Parameter Description
    landing Accepted values: business_sign_up or personal_sign_up. What page the user should see first if not already signed in. Default is the sign in page.
    nickname Only letters, numbers, dashes and underscores are permitted. This will be used to identify the account in Split.
    name Business account only. Business name.
    abn Business account only. Business ABN.
    phone Business account only. Business phone number.
    street_address
    suburb
    state See the sign up page for accepted values
    postcode
    first_name
    last_name
    mobile_phone
    email

    All values should be URL encoded.

    As an example, the following authorisation URL would display the personal sign up & prefill the first name field with George: https://go-sandbox.split.cash/oauth/authorize?response_type=code&client_id=xxx&redirect_uri=xxx&scope=xxx&landing=personal_sign_up&first_name=George

    You can also pass the values directly to the sign up page outside of the OAuth2 authorisation process. Click on the following link to see the values preloaded: https://go-sandbox.split.cash/business/sign_up?name=GeorgeCo&nickname=georgeco&first_name=George.

    Sandbox

    Try out your happy paths and not-so happy paths, the sandbox is a great place to get started without transfering actual funds. All transactions are simulated and no communication with financial institutions is performed.

    The sandbox works on 2.5 minute cycle to better illustrate how transactions are received and the lifecyle they go through. In other words, every 2.5 minutes we simulate communicating with financial institutions and update statuses and events accordingly.

    Testing details

    All 6 digits BSBs are valid in the sandbox with the exception of 100000 which is a place keeper for an invalid BSB. In production, only valid and real BSB are accepted.

    Payment failure bank accounts

    You can send Payments to the following reserved bank accounts to trigger specific failures.

    Failure type Branch code (BSB) Account number
    account_closed 300000 99999
    customer_deceased 400000 99999
    incorrect_account_number 500000 99999
    refer_to_split 700000 99999

    Payment Request failure bank accounts

    You can send Payment Requests to the following reserved bank accounts to trigger specific failures.

    Failure type Branch code (BSB) Account number
    payment_stopped 200000 99999
    account_closed 300000 99999
    customer_deceased 400000 99999
    incorrect_account_number 500000 99999
    refer_to_customer 600000 99999
    refer_to_split 700000 99999
    insufficient_funds 800000 99999

    Instant account verification accounts

    When using any of our hosted solutions (Payment Requests, Open Agreements or Unassigned Agreements) you may want to test the Instant Account Verification (IAV) process where we accept online banking credentials to validate bank account access. To do so, you can use the following credentials:

    Login Password
    gavinBelson hooli2016
    jared django
    richard tabsnotspaces

    Configuration

    Scopes

    Scopes define the level of access granted via the OAuth2 authorisation process. As a best practice, only use the scopes your application will require.

    Scope Description
    public View user's public information
    agreements Manage user's Agreements
    bank_accounts Manage user's Bank Accounts
    contacts Manage user's Contacts
    open_agreements Manage user's Open Agreements
    payments Manage user's Payments
    payment_requests Manage user's Payment Requests
    refund_requests Manage user's Refund Requests
    refunds Manage user's Refunds
    transactions Access user's Transactions
    offline_access Create non-expiring access tokens for user

    Pagination

    Example response header

    Link: <http://api-sandbox.split.cash/contacts?page=5>; rel="last", <http://api-sandbox.split.cash/contacts?page=2>; rel="next"
    Per-Page: 25
    Total: 5
    

    All collections are paginated to 25 items by default and the pagination information may be found in the response header. You can customise the pagination by appending ?per_page=x and/or ?page=x to the endpoint URL.

    Remitter

    Example request

    {
      "...": "...",
      "metadata": {
       "remitter": "CustomRem"
       }
    }
    

    You can elect to assign a remitter name on a per-request basis when submitting Payments & Payment Requests. Simply append the remitter key and a value within the metadata key.

    Webhooks

    Example response

    {
      "event": {
        "type": "object.action",
        "at": "yyyy-mm-ddThh:mm:ssZ",
        "who": {
          "account_id": "x",
          "bank_account_id": "x"
        }
      },
      "data": [
        {
          // The data section will follow the same type of structure
          // as the event type it is representing. For example, if the
          // event type was "debit.scheduled", the data representation
          // structure would be that of a debit object. Too see what a
          // debit object structure looks like, see the Transactions
          // section.
        }
      ]
    }
    

    We support two main categories of webhooks:

    1. Owner: These webhooks are managed by the owner of the Split account and only report on events owned by the Split account.
    2. App: These webhooks are managed by the Split OAuth2 application owner and will report on events relating to any authorised Split account (limited by scope).

    All events posted to the designated URL fit the same structure.

    Checking Webhook Signatures

    Example header

    Split-Signature: 1514772000.93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635
    

    Split signs the webhook events it sends to your endpoints. We do so by including a signature in each event’s Split-Signature header. This allows you to validate that the events were indeed sent by Split.

    Before you can verify signatures, you need to retrieve your endpoint’s secret from your Webhooks settings. Each endpoint has its own unique secret; if you use multiple endpoints, you must obtain a secret for each one. If you use multiple endpoints, you must obtain a secret for each one.

    The Split-Signature header contains a timestamp and one or more signatures. All separated by . (dot).

    Example code

    # Shell example is not available
    
    package main
    
    import (
        "crypto/hmac"
        "crypto/sha256"
        "strings"
        "fmt"
        "encoding/hex"
    )
    
    func main() {
        secret := "1234"
        message := "{\"data\":{\"key\":\"value\"}}"
        splitSignature := "1514772000.93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635"
    
        data := strings.Split(splitSignature, ".")
        timestamp, givenSignature := data[0], data[1]
    
        signedPayload := timestamp + "." + message
    
        hash := hmac.New(sha256.New, []byte(secret))
        hash.Write([]byte(signedPayload))
        expectedSignature := hex.EncodeToString(hash.Sum(nil))
    
        fmt.Println(expectedSignature)
        // 93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635
        fmt.Println(givenSignature)
        // 93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635
    }
    
    import hashlib
    import hmac
    
    split_signature = '1514772000.93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635'
    secret = bytes('1234').encode('utf-8')
    message = bytes('{"data":{"key":"value"}}').encode('utf-8')
    
    data = split_signature.split('.')
    timestamp = data[0]
    given_signature = data[1]
    
    signed_payload = timestamp + '.' + message
    
    expected_signature = hmac.new(secret, signed_payload, digestmod=hashlib.sha256).hexdigest()
    
    print(expected_signature)
    # > 93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635
    
    print(given_signature)
    # > 93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635
    
    require 'openssl'
    
    split_signature = '1514772000.93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635'
    secret = '1234'
    message = '{"data":{"key":"value"}}'
    
    timestamp, given_signature, *other = split_signature.split('.')
    signed_payload = timestamp + '.' + message
    expected_signature = OpenSSL::HMAC.hexdigest('sha256', secret, signed_payload)
    
    puts(expected_signature)
    # => 93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635
    puts(given_signature)
    # => 93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635
    
    var crypto = require('crypto')
    var message = '{\"data\":{\"key\":\"value\"}}'
    var secret = '1234'
    var splitSignature = '1514772000.93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635'
    
    var data = splitSignature.split('.')
    var timestamp = data[0]
    var givenSignature = data[1]
    
    var signedPayload = timestamp + '.' + message
    
    var expectedSignature = crypto.createHmac('sha256', secret).update(signedPayload).digest('hex')
    
    console.log(expectedSignature)
    // 93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635
    console.log(givenSignature)
    // 93eee90206280b25e82b38001e23961cba4c007f4d925ba71ecc2d9804978635
    

    Step 1. Extract the timestamp and signatures from the header

    Split the header, using the . (dot) character as the separator, to get a list of elements.

    Element Description
    timestamp Unix time in seconds when the signature was created
    signature Request signature
    other Placeholder for future parameters (currently not used)

    Step 2: Prepare the signed_payload string

    You achieve this by concatenating:

    Step 3: Determine the expected signature

    Compute an HMAC with the SHA256 hash function. Use the endpoint’s signing secret as the key, and use the signed_payload string as the message.

    Step 4: Compare signatures

    Compare the signature in the header to the expected signature. If a signature matches, compute the difference between the current timestamp and the received timestamp, then decide if the difference is within your tolerance.

    To protect against timing attacks, use a constant-time string comparison to compare the expected signature to each of the received signatures.

    Agreements

    Split Agreements are managed on a per Contact basis and allow two parties to agree on terms for which future Payment Requests will be auto-approved.

    Agreement are unidirectional. In other words, if both parties wish for auto-approved Payment Requests, they must each propose an Agreement to the other.

    Direction

    Agreements are therefore broken up by direction:

    1. Incoming: Agreement received from another Split account
    2. Outgoing: Agreement sent to another Split account

    Lifecycle

    An Agreement can have the following statuses:

    Status Description
    proposed Waiting for the Agreement to be accepted or declined.
    accepted The Agreement have been accepted and is active.
    cancelled The Agreement has been cancelled (The initiator or authoriser can cancel an Agreement).
    declined The Agreement has been declined.
    expended The Agreement has been expended (Only for single_use Unassigned Agreements).

    Propose an Agreement

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/agreements \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}' \
      --header 'content-type: application/json' \
      --data '{"authoriser_contact_id":"8df89c16-330f-462b-8891-808d7bdceb7f","terms":{"per_payout":{"min_amount":null,"max_amount":10000},"per_frequency":{"days":7,"max_amount":1000000}}}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/agreements")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    request.body = "{\"authoriser_contact_id\":\"8df89c16-330f-462b-8891-808d7bdceb7f\",\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}"
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/agreements",
      "headers": {
        "content-type": "application/json",
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ authoriser_contact_id: '8df89c16-330f-462b-8891-808d7bdceb7f',
      terms:
       { per_payout: { min_amount: null, max_amount: 10000 },
         per_frequency: { days: 7, max_amount: 1000000 } } }));
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    payload = "{\"authoriser_contact_id\":\"8df89c16-330f-462b-8891-808d7bdceb7f\",\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}"
    
    headers = {
        'content-type': "application/json",
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/agreements", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/agreements")
      .header("content-type", "application/json")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .body("{\"authoriser_contact_id\":\"8df89c16-330f-462b-8891-808d7bdceb7f\",\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $body = new http\Message\Body;
    $body->append('{"authoriser_contact_id":"8df89c16-330f-462b-8891-808d7bdceb7f","terms":{"per_payout":{"min_amount":null,"max_amount":10000},"per_frequency":{"days":7,"max_amount":1000000}}}');
    
    $request->setRequestUrl('https://api-sandbox.split.cash/agreements');
    $request->setRequestMethod('POST');
    $request->setBody($body);
    
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json',
      'content-type' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/agreements"
    
        payload := strings.NewReader("{\"authoriser_contact_id\":\"8df89c16-330f-462b-8891-808d7bdceb7f\",\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("content-type", "application/json")
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /agreements

    Propose an Agreement to another Split Contact

    Body parameter

    {
      "authoriser_contact_id": "8df89c16-330f-462b-8891-808d7bdceb7f",
      "terms": {
        "per_payout": {
          "min_amount": null,
          "max_amount": 10000
        },
        "per_frequency": {
          "days": 7,
          "max_amount": 1000000
        }
      }
    }
    

    Parameters

    Parameter In Type Required Description
    body body ProposeAgreementRequest true No description
    » authoriser_contact_id body string false The Authoriser's contact ID (Contact.data.id)
    » terms body Terms true Terms
    »» per_payout body PerPayout true No description
    »»» min_amount body number\ null false
    »»» max_amount body number\ null false
    »» per_frequency body PerFrequency true No description
    »»» days body number\ null false
    »»» max_amount body number\ null false

    Example responses

    201 Response

    {
      "data": {
        "ref": "A.2",
        "initiator_id": "4e2728cc-b4ba-42c2-a6c3-26a7758de58d",
        "authoriser_id": "0d290763-bd5a-4b4d-a8ce-06c64c4a697b",
        "contact_id": "8df89c16-330f-462b-8891-808d7bdceb7f",
        "bank_account_id": "fb9381ec-22af-47fd-8998-804f947aaca3",
        "status": "proposed",
        "status_reason": null,
        "responded_at": null,
        "created_at": "2017-03-20T00:53:27Z",
        "terms": {
          "per_payout": {
            "max_amount": 10000,
            "min_amount": null
          },
          "per_frequency": {
            "days": 7,
            "max_amount": 1000000
          }
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Created ProposeAgreementResponse

    Approve an Agreement

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/agreements/A.2/accept \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/agreements/A.2/accept")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/agreements/A.2/accept",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/agreements/A.2/accept", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/agreements/A.2/accept")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/agreements/A.2/accept');
    $request->setRequestMethod('POST');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/agreements/A.2/accept"
    
        req, _ := http.NewRequest("POST", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /agreements/{agreement_ref}/accept

    Approve an incoming Agreement

    Parameters

    Parameter In Type Required Description
    agreement_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "A.2",
        "initiator_id": "4e2728cc-b4ba-42c2-a6c3-26a7758de58d",
        "authoriser_id": "8df89c16-330f-462b-8891-808d7bdceb7f",
        "contact_id": "0d290763-bd5a-4b4d-a8ce-06c64c4a697b",
        "bank_account_id": "fb9381ec-22af-47fd-8998-804f947aaca3",
        "status": "accepted",
        "status_reason": null,
        "responded_at": "2017-03-20T02:13:11Z",
        "created_at": "2017-03-20T00:53:27Z",
        "terms": {
          "per_payout": {
            "max_amount": 10000,
            "min_amount": 1
          },
          "per_frequency": {
            "days": 7,
            "max_amount": 1000000
          }
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ApproveAgreementResponse

    Decline and Agreement

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/agreements/A.2/decline \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/agreements/A.2/decline")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/agreements/A.2/decline",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/agreements/A.2/decline", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/agreements/A.2/decline")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/agreements/A.2/decline');
    $request->setRequestMethod('POST');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/agreements/A.2/decline"
    
        req, _ := http.NewRequest("POST", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /agreements/{agreement_ref}/decline

    Decline an incoming Agreement

    Parameters

    Parameter In Type Required Description
    agreement_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "A.2",
        "initiator_id": "4e2728cc-b4ba-42c2-a6c3-26a7758de58d",
        "authoriser_id": "8df89c16-330f-462b-8891-808d7bdceb7f",
        "contact_id": "0d290763-bd5a-4b4d-a8ce-06c64c4a697b",
        "bank_account_id": "fb9381ec-22af-47fd-8998-804f947aaca3",
        "status": "declined",
        "status_reason": null,
        "responded_at": "2017-03-20T02:13:11Z",
        "created_at": "2017-03-20T00:53:27Z",
        "terms": {
          "per_payout": {
            "max_amount": 10000,
            "min_amount": 1
          },
          "per_frequency": {
            "days": 7,
            "max_amount": 1000000
          }
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK DeclineAgreementResponse

    Get an Agreement

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/agreements/A.2 \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/agreements/A.2")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/agreements/A.2",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/agreements/A.2", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/agreements/A.2")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/agreements/A.2');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/agreements/A.2"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /agreements/{agreement_ref}

    Get a single Agreement by its reference

    Parameters

    Parameter In Type Required Description
    agreement_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "A.2",
        "initiator_id": "4e2728cc-b4ba-42c2-a6c3-26a7758de58d",
        "authoriser_id": "8df89c16-330f-462b-8891-808d7bdceb7f",
        "contact_id": "0d290763-bd5a-4b4d-a8ce-06c64c4a697b",
        "bank_account_id": "fb9381ec-22af-47fd-8998-804f947aaca3",
        "status": "approved",
        "status_reason": null,
        "responded_at": "2017-03-20T02:13:11Z",
        "created_at": "2017-03-20T00:53:27Z",
        "terms": {
          "per_payout": {
            "max_amount": 10000,
            "min_amount": 1
          },
          "per_frequency": {
            "days": 7,
            "max_amount": 1000000
          }
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK GetAgreementResponse

    Cancel an Agreement

    Code samples

    curl --request DELETE \
      --url https://api-sandbox.split.cash/agreements/A.2 \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/agreements/A.2")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/agreements/A.2",
      "headers": {
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = { 'authorization': "Bearer {access-token}" }
    
    conn.request("DELETE", "/agreements/A.2", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.delete("https://api-sandbox.split.cash/agreements/A.2")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/agreements/A.2');
    $request->setRequestMethod('DELETE');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/agreements/A.2"
    
        req, _ := http.NewRequest("DELETE", url, nil)
    
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    DELETE /agreements/{agreement_ref}

    An Agreement can be cancelled by the initiator at any time whilst the authoriser (Agreement recipient) can only cancel a previously accepted Agreement.

    Parameters

    Parameter In Type Required Description
    agreement_ref path string true Single value, exact match

    Responses

    Status Meaning Description Schema
    204 No Content No Content None

    List incoming Agreements

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/agreements/incoming \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/agreements/incoming")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/agreements/incoming",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/agreements/incoming", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/agreements/incoming")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/agreements/incoming');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/agreements/incoming"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /agreements/incoming

    By default, all incoming Agreements will be returned. You can apply filters to your query to customise the returned Agreements.

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match
    contact_id query string false Contact ID (Contact.data.id), single value, exact match
    initiator_id query string false Initiator ID (Contact.data.account.id), single value, exact match
    status query array[string] false Multiple values, exact match

    Enumerated Values

    Parameter Value
    status proposed
    status accepted
    status declined
    status cancelled

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "A.2",
          "initiator_id": "4e2728cc-b4ba-42c2-a6c3-26a7758de58d",
          "authoriser_id": "8df89c16-330f-462b-8891-808d7bdceb7f",
          "contact_id": "0d290763-bd5a-4b4d-a8ce-06c64c4a697b",
          "bank_account_id": "fb9381ec-22af-47fd-8998-804f947aaca3",
          "status": "proposed",
          "status_reason": null,
          "responded_at": null,
          "created_at": "2017-03-20T00:53:27Z",
          "terms": {
            "per_payout": {
              "max_amount": 10000,
              "min_amount": 1
            },
            "per_frequency": {
              "days": 7,
              "max_amount": 1000000
            }
          }
        },
        {
          "ref": "A.1",
          "initiator_id": "4e2728cc-b4ba-42c2-a6c3-26a7758de58d",
          "authoriser_id": "56df206a-aaff-471a-b075-11882bc8906a",
          "contact_id": "a80ac411-c8fb-45c0-9557-607c54649907",
          "bank_account_id": "fa80ac411-c8fb-45c0-9557-607c54649907",
          "status": "proposed",
          "status_reason": null,
          "responded_at": null,
          "created_at": "2017-03-16T22:51:48Z",
          "terms": {
            "per_payout": {
              "max_amount": 5000,
              "min_amount": 0
            },
            "per_frequency": {
              "days": "1",
              "max_amount": 10000
            }
          }
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListIncomingAgreementsResponse

    List outgoing Agreements

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/agreements/outgoing \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/agreements/outgoing")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/agreements/outgoing",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/agreements/outgoing", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/agreements/outgoing")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/agreements/outgoing');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/agreements/outgoing"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /agreements/outgoing

    By default, all outgoing Agreements will be returned. You can apply filters to your query to customise the returned Agreements.

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match
    authoriser_id query string false Authoriser ID (Contact.data.account.id), single value, exact match
    contact_id query string false Contact ID (Contact.data.id), single value, exact match
    status query array[string] false Exact match

    Enumerated Values

    Parameter Value
    status proposed
    status accepted
    status declined
    status cancelled

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "A.4",
          "initiator_id": "4e2728cc-b4ba-42c2-a6c3-26a7758de58d",
          "authoriser_id": "8df89c16-330f-462b-8891-808d7bdceb7f",
          "contact_id": "a80ac411-c8fb-45c0-9557-607c54649907",
          "bank_account_id": "fa80ac411-c8fb-45c0-9557-607c54649907",
          "status": "proposed",
          "status_reason": null,
          "responded_at": null,
          "created_at": "2017-03-20T00:53:27Z",
          "terms": {
            "per_payout": {
              "max_amount": 10000,
              "min_amount": 1
            },
            "per_frequency": {
              "days": 7,
              "max_amount": 1000000
            }
          }
        },
        {
          "ref": "A.3",
          "initiator_id": "4e2728cc-b4ba-42c2-a6c3-26a7758de58d",
          "authoriser_id": "56df206a-aaff-471a-b075-11882bc8906a",
          "contact_id": "a80ac411-c8fb-45c0-9557-607c54649907",
          "bank_account_id": "fa80ac411-c8fb-45c0-9557-607c54649907",
          "status": "proposed",
          "status_reason": null,
          "responded_at": null,
          "created_at": "2017-03-16T22:51:48Z",
          "terms": {
            "per_payout": {
              "max_amount": 5000,
              "min_amount": 0
            },
            "per_frequency": {
              "days": "1",
              "max_amount": 10000
            }
          }
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListOutgoingAgreementsResponse

    Bank Accounts

    Your currently linked up bank accounts.

    List all Bank Accounts

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/bank_accounts \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/bank_accounts")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/bank_accounts",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/bank_accounts", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/bank_accounts")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/bank_accounts');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/bank_accounts"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /bank_accounts

    By default, all Bank Accounts will be returned. There can currently be only 1 active bank account.

    Example responses

    200 Response

    {
      "data": [
        {
          "id": "6a7ed958-f1e8-42dc-8c02-3901d7057357",
          "branch_code": "493192",
          "bank_name": "National Australia Bank",
          "account_number": "3993013",
          "status": "active"
        },
        {
          "id": "56df206a-aaff-471a-b075-11882bc8906a",
          "branch_code": "302193",
          "bank_name": "National Australia Bank",
          "account_number": "119302",
          "status": "removed"
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListAllBankAccountsResponse

    Contacts

    Your Contacts form an address book of parties with whom you can interact. In order to initiate any type of transaction you must first have the party in your Contact list.

    Add a Split Contact

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/contacts \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}' \
      --header 'content-type: application/json' \
      --data '{"nickname":"outstanding_tours"}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/contacts")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    request.body = "{\"nickname\":\"outstanding_tours\"}"
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/contacts",
      "headers": {
        "content-type": "application/json",
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ nickname: 'outstanding_tours' }));
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    payload = "{\"nickname\":\"outstanding_tours\"}"
    
    headers = {
        'content-type': "application/json",
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/contacts", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/contacts")
      .header("content-type", "application/json")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .body("{\"nickname\":\"outstanding_tours\"}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $body = new http\Message\Body;
    $body->append('{"nickname":"outstanding_tours"}');
    
    $request->setRequestUrl('https://api-sandbox.split.cash/contacts');
    $request->setRequestMethod('POST');
    $request->setBody($body);
    
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json',
      'content-type' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/contacts"
    
        payload := strings.NewReader("{\"nickname\":\"outstanding_tours\"}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("content-type", "application/json")
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /contacts

    Add a Split Contact

    Body parameter

    {
      "nickname": "outstanding_tours"
    }
    

    Parameters

    Parameter In Type Required Description
    body body AddASplitContactRequest true No description
    » nickname body string true Split account nickname

    Example responses

    201 Response

    {
      "data": {
        "id": "6a7ed958-f1e8-42dc-8c02-3901d7057357",
        "name": "Outstanding Tours Pty Ltd",
        "email": "accounts@outstandingtours.com.au",
        "type": "Split account",
        "bank_account": {
          "id": "55afddde-4296-4daf-8e49-7ba481ef9608",
          "account_number": "947434694",
          "branch_code": "304304",
          "bank_name": "National Australia Bank",
          "state": "verified"
        },
        "account": {
          "id": "77be6ecc-5fa7-454b-86d6-02a5f147878d",
          "nickname": "outstanding_tours",
          "abn": "123456789",
          "name": "Outstanding Tours Pty Ltd"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Created AddASplitContactResponse
    404 Not Found Not Found None

    List all Contacts

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/contacts \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/contacts")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/contacts",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/contacts", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/contacts")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/contacts');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/contacts"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /contacts

    By default, all Contacts will be returned. You can apply filters to your query to customise the returned Contact list.

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match
    account_id query string false Single value, string search
    name query string false Single value, string search
    nickname query string false Single value, string search
    email query string false Single value, string search
    bank_account_id query string false Single value, exact match
    bank_account_branch_code query string false Single value, exact match
    bank_account_account_number query string false Single value, exact match

    Example responses

    200 Response

    {
      "data": [
        {
          "id": "6a7ed958-f1e8-42dc-8c02-3901d7057357",
          "name": "Outstanding Tours Pty Ltd",
          "email": "accounts@outstandingtours.com.au",
          "type": "Split account",
          "bank_account": {
            "id": "095c5ab7-7fa8-40fd-b317-cddbbf4c8fbc",
            "account_number": "494307",
            "branch_code": "435434",
            "bank_name": "National Australia Bank",
            "state": "verified"
          },
          "account": {
            "id": "77be6ecc-5fa7-454b-86d6-02a5f147878d",
            "nickname": "outstanding_tours",
            "abn": "123456789",
            "name": "Outstanding Tours Pty Ltd"
          }
        },
        {
          "id": "49935c67-c5df-4f00-99f4-1413c18a89a0",
          "name": "Adventure Dudes Pty Ltd",
          "email": "accounts@adventuredudes.com.au",
          "type": "Split account",
          "bank_account": {
            "id": "861ff8e4-7acf-4897-9e53-e7c5ae5f7cc0",
            "account_number": "4395959",
            "branch_code": "068231",
            "bank_name": "National Australia Bank",
            "state": "verified"
          },
          "account": {
            "id": "362f7fe8-4af2-4902-b3d7-b5ab704ef2e7",
            "nickname": "adventure_dudes",
            "abn": "126754389",
            "name": "Adventure Dudes Pty Ltd"
          }
        },
        {
          "id": "eb3266f9-e172-4b6c-b802-fe5ac4d3250a",
          "name": "Surfing World Pty Ltd",
          "email": "accounts@surfingworld.com.au",
          "type": "Split account",
          "bank_account": {
            "id": null,
            "account_number": null,
            "branch_code": null,
            "bank_name": null,
            "state": "disabled"
          },
          "account": {
            "id": "a31dc907-9c7a-4736-84c9-1149cf03de42",
            "nickname": "surfing_world",
            "abn": "295443789",
            "name": "Surfing World Pty Ltd"
          }
        },
        {
          "id": "6a7ed958-f1e8-42dc-8c02-3901d7057357",
          "name": "Hunter Thompson",
          "email": "hunter@batcountry.com",
          "type": "anyone",
          "bank_account": {
            "id": "55afddde-4296-4daf-8e49-7ba481ef9608",
            "account_number": "13048322",
            "branch_code": "123456",
            "bank_name": "National Australia Bank",
            "state": "pending_verification"
          },
          "anyone_account": {
            "id": "77be6ecc-5fa7-454b-86d6-02a5f147878d"
          }
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListAllContactsResponse

    Add an Anyone Contact

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/contacts/anyone \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}' \
      --header 'content-type: application/json' \
      --data '{"name":"Hunter Thompson","email":"hunter@batcountry.com","branch_code":"123456","account_number":"13048322"}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/contacts/anyone")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    request.body = "{\"name\":\"Hunter Thompson\",\"email\":\"hunter@batcountry.com\",\"branch_code\":\"123456\",\"account_number\":\"13048322\"}"
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/contacts/anyone",
      "headers": {
        "content-type": "application/json",
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ name: 'Hunter Thompson',
      email: 'hunter@batcountry.com',
      branch_code: '123456',
      account_number: '13048322' }));
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    payload = "{\"name\":\"Hunter Thompson\",\"email\":\"hunter@batcountry.com\",\"branch_code\":\"123456\",\"account_number\":\"13048322\"}"
    
    headers = {
        'content-type': "application/json",
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/contacts/anyone", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/contacts/anyone")
      .header("content-type", "application/json")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .body("{\"name\":\"Hunter Thompson\",\"email\":\"hunter@batcountry.com\",\"branch_code\":\"123456\",\"account_number\":\"13048322\"}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $body = new http\Message\Body;
    $body->append('{"name":"Hunter Thompson","email":"hunter@batcountry.com","branch_code":"123456","account_number":"13048322"}');
    
    $request->setRequestUrl('https://api-sandbox.split.cash/contacts/anyone');
    $request->setRequestMethod('POST');
    $request->setBody($body);
    
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json',
      'content-type' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/contacts/anyone"
    
        payload := strings.NewReader("{\"name\":\"Hunter Thompson\",\"email\":\"hunter@batcountry.com\",\"branch_code\":\"123456\",\"account_number\":\"13048322\"}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("content-type", "application/json")
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /contacts/anyone

    When you want to pay somebody that doesn't have a Split account, you can add them as an Anyone Contact.

    Body parameter

    {
      "name": "Hunter Thompson",
      "email": "hunter@batcountry.com",
      "branch_code": "123456",
      "account_number": "13048322"
    }
    

    Parameters

    Parameter In Type Required Description
    body body AddAnAnyoneContactRequest true No description
    » name body string true The name of the Contact
    » email body string true The email of the Contact
    » branch_code body string true The bank account BSB of the Contact
    » account_number body string true The bank account number of the Contact

    Example responses

    201 Response

    {
      "data": {
        "id": "6a7ed958-f1e8-42dc-8c02-3901d7057357",
        "name": "Hunter Thompson",
        "email": "hunter@batcountry.com",
        "type": "anyone",
        "bank_account": {
          "id": "55afddde-4296-4daf-8e49-7ba481ef9608",
          "account_number": "13048322",
          "branch_code": "123456",
          "bank_name": "National Australia Bank",
          "state": "pending_verification"
        },
        "anyone_account": {
          "id": "77be6ecc-5fa7-454b-86d6-02a5f147878d"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Created AddAnAnyoneContactResponse

    Get a Contact

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608 \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/contacts/55afddde-4296-4daf-8e49-7ba481ef9608",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/contacts/55afddde-4296-4daf-8e49-7ba481ef9608", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /contacts/{id}

    Get a single Contact by its ID

    Parameters

    Parameter In Type Required Description
    id path string(UUID) true Contact ID (Contact.data.id)

    Example responses

    200 Response

    {
      "data": {
        "id": "fcabeacb-2ef6-4b27-ba19-4f6fa0d57dcb",
        "name": "Outstanding Tours Pty Ltd",
        "email": "accounts@outstandingtours.com.au",
        "type": "Split account",
        "bank_account": {
          "id": "55afddde-4296-4daf-8e49-7ba481ef9608",
          "account_number": "947434694",
          "branch_code": "304304",
          "bank_name": "National Australia Bank",
          "state": "pending_verification"
        },
        "account": {
          "id": "77be6ecc-5fa7-454b-86d6-02a5f147878d",
          "nickname": "outstanding_tours",
          "abn": "123456789",
          "name": "Outstanding Tours Pty Ltd"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK GetAContactResponse
    404 Not Found Not Found None

    Remove a Contact

    Code samples

    curl --request DELETE \
      --url https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608 \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/contacts/55afddde-4296-4daf-8e49-7ba481ef9608",
      "headers": {
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = { 'authorization': "Bearer {access-token}" }
    
    conn.request("DELETE", "/contacts/55afddde-4296-4daf-8e49-7ba481ef9608", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.delete("https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608');
    $request->setRequestMethod('DELETE');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608"
    
        req, _ := http.NewRequest("DELETE", url, nil)
    
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    DELETE /contacts/{id}

    Parameters

    Parameter In Type Required Description
    id path string(UUID) true Contact ID (Contact.data.id)

    Responses

    Status Meaning Description Schema
    204 No Content No description None

    Update a Contact

    Code samples

    curl --request PATCH \
      --url https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608 \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}' \
      --header 'content-type: application/json' \
      --data '{"name":"My very own alias"}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Patch.new(url)
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    request.body = "{\"name\":\"My very own alias\"}"
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "PATCH",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/contacts/55afddde-4296-4daf-8e49-7ba481ef9608",
      "headers": {
        "content-type": "application/json",
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ name: 'My very own alias' }));
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    payload = "{\"name\":\"My very own alias\"}"
    
    headers = {
        'content-type': "application/json",
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("PATCH", "/contacts/55afddde-4296-4daf-8e49-7ba481ef9608", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.patch("https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608")
      .header("content-type", "application/json")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .body("{\"name\":\"My very own alias\"}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $body = new http\Message\Body;
    $body->append('{"name":"My very own alias"}');
    
    $request->setRequestUrl('https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608');
    $request->setRequestMethod('PATCH');
    $request->setBody($body);
    
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json',
      'content-type' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/contacts/55afddde-4296-4daf-8e49-7ba481ef9608"
    
        payload := strings.NewReader("{\"name\":\"My very own alias\"}")
    
        req, _ := http.NewRequest("PATCH", url, payload)
    
        req.Header.Add("content-type", "application/json")
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    PATCH /contacts/{id}

    You can update the name of any Contact. This is essentially an alias you can use to provide something contextually meaninful.

    Body parameter

    {
      "name": "My very own alias"
    }
    

    Parameters

    Parameter In Type Required Description
    id path string true Contact ID (Contact.data.id)
    body body UpdateAContactRequest true No description
    » name body string true The name of the Contact

    Example responses

    200 Response

    {
      "data": {
        "id": "fcabeacb-2ef6-4b27-ba19-4f6fa0d57dcb",
        "name": "My very own alias",
        "email": "accounts@outstandingtours.com.au",
        "type": "Split account",
        "bank_account": {
          "id": "55afddde-4296-4daf-8e49-7ba481ef9608",
          "account_number": "947434694",
          "branch_code": "304304",
          "bank_name": "National Australia Bank",
          "state": "pending_verification"
        },
        "account": {
          "id": "77be6ecc-5fa7-454b-86d6-02a5f147878d",
          "nickname": "outstanding_tours",
          "abn": "123456789",
          "name": "Outstanding Tours Pty Ltd"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK UpdateAContactResponse
    404 Not Found Not Found None

    Open Agreements

    An Open Agreement is essentially an Agreement template with no specific authoriser. Each time an Open Agreement is accepted by either a Split account holder or anyone, the authoriser is added to your Contacts list and a new Agreement is automatically created between the Open Agreement initiator and the authoriser.

    An Open Agreement can be accepted multiple times by different parties and the result is the same: A new Agreement. Additionally, an Open Agreement can be accepted by anybody, not just other Split users. This is achieved by using our Instant Account Verification process as part of accepting an Open Agreement.

    Lifecycle

    An Open Agreement can have the following statuses:

    Status Description
    active The Open Agreement can be viewed and accepted.
    closed The Open Agreement can not be viewed or accepted.

    Create an Open Agreement

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/open_agreements \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}' \
      --header 'content-type: application/json' \
      --data '{"title":"Subscription Plan A","terms":{"per_payout":{"min_amount":null,"max_amount":10000},"per_frequency":{"days":7,"max_amount":1000000}}}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/open_agreements")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    request.body = "{\"title\":\"Subscription Plan A\",\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}"
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/open_agreements",
      "headers": {
        "content-type": "application/json",
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ title: 'Subscription Plan A',
      terms:
       { per_payout: { min_amount: null, max_amount: 10000 },
         per_frequency: { days: 7, max_amount: 1000000 } } }));
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    payload = "{\"title\":\"Subscription Plan A\",\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}"
    
    headers = {
        'content-type': "application/json",
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/open_agreements", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/open_agreements")
      .header("content-type", "application/json")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .body("{\"title\":\"Subscription Plan A\",\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $body = new http\Message\Body;
    $body->append('{"title":"Subscription Plan A","terms":{"per_payout":{"min_amount":null,"max_amount":10000},"per_frequency":{"days":7,"max_amount":1000000}}}');
    
    $request->setRequestUrl('https://api-sandbox.split.cash/open_agreements');
    $request->setRequestMethod('POST');
    $request->setBody($body);
    
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json',
      'content-type' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/open_agreements"
    
        payload := strings.NewReader("{\"title\":\"Subscription Plan A\",\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("content-type", "application/json")
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /open_agreements

    Create an Open Agreement that can be accepted by anyone.

    Body parameter

    {
      "title": "Subscription Plan A",
      "terms": {
        "per_payout": {
          "min_amount": null,
          "max_amount": 10000
        },
        "per_frequency": {
          "days": 7,
          "max_amount": 1000000
        }
      }
    }
    

    Parameters

    Parameter In Type Required Description
    body body CreateOpenAgreementRequest true No description
    » title body string true Title of the Open Agreement (Visible to authorisers)
    » terms body Terms true Terms
    »» per_payout body PerPayout true No description
    »»» min_amount body number\ null false
    »»» max_amount body number\ null false
    »» per_frequency body PerFrequency true No description
    »»» days body number\ null false
    »»» max_amount body number\ null false

    Example responses

    201 Response

    {
      "data": {
        "ref": "OA.1",
        "title": "Subscription Plan A",
        "status": "active",
        "created_at": "2017-03-20T00:53:27Z",
        "terms": {
          "per_payout": {
            "min_amount": null,
            "max_amount": 10000
          },
          "per_frequency": {
            "days": 7,
            "max_amount": 1000000
          }
        },
        "link": "https://go-sandbox.split.cash/open_agreements/aecff76d-13e0-4e17-b7c5-844ae07fa675/agreements/invitation"
      }
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Created CreateOpenAgreementResponse

    List all Open Agreements

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/open_agreements \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/open_agreements")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/open_agreements",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/open_agreements", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/open_agreements")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/open_agreements');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/open_agreements"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /open_agreements

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "OA.1",
          "title": "Subscription Plan A",
          "status": "active",
          "created_at": "2017-03-20T00:53:27Z",
          "terms": {
            "per_payout": {
              "max_amount": 10000,
              "min_amount": null
            },
            "per_frequency": {
              "days": 7,
              "max_amount": 1000000
            }
          },
          "link": "https://go-sandbox.split.cash/open_agreements/2e002c0b-ffaf-44eb-a35c-15fa384ddde1/agreements/invitation"
        },
        {
          "ref": "OA.2",
          "title": "Subscription Plan B",
          "status": "closed",
          "created_at": "2017-03-20T00:53:27Z",
          "terms": {
            "per_payout": {
              "max_amount": 10000,
              "min_amount": null
            },
            "per_frequency": {
              "days": null,
              "max_amount": null
            }
          },
          "link": "https://go-sandbox.split.cash/open_agreements/948e3662-154d-42d1-bdc9-a05c251d3981/agreements/invitation"
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListAllOpenAgreementsResponse

    Activate a closed Open Agreement

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/open_agreements/OA.1/activate \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/open_agreements/OA.1/activate")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/open_agreements/OA.1/activate",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/open_agreements/OA.1/activate", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/open_agreements/OA.1/activate")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/open_agreements/OA.1/activate');
    $request->setRequestMethod('POST');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/open_agreements/OA.1/activate"
    
        req, _ := http.NewRequest("POST", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /open_agreements/{open_agreement_ref}/activate

    Allow the Open Agreement to viewed and accepted

    Parameters

    Parameter In Type Required Description
    open_agreement_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "OA.1",
        "title": "Subscription Plan A",
        "status": "active",
        "created_at": "2017-03-20T00:53:27Z",
        "terms": {
          "per_payout": {
            "max_amount": 10000,
            "min_amount": null
          },
          "per_frequency": {
            "days": 7,
            "max_amount": 1000000
          }
        },
        "link": "https://go-sandbox.split.cash/open_agreements/2e002c0b-ffaf-44eb-a35c-15fa384ddde1/agreements/invitation"
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ActivateOpenAgreementResponse

    Close an active Open Agreement

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/open_agreements/OA.1/close \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/open_agreements/OA.1/close")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/open_agreements/OA.1/close",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/open_agreements/OA.1/close", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/open_agreements/OA.1/close")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/open_agreements/OA.1/close');
    $request->setRequestMethod('POST');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/open_agreements/OA.1/close"
    
        req, _ := http.NewRequest("POST", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /open_agreements/{open_agreement_ref}/close

    Disable the Open Agreement from being viewed or accepted

    Parameters

    Parameter In Type Required Description
    open_agreement_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "OA.1",
        "title": "Subscription Plan A",
        "status": "closed",
        "created_at": "2017-03-20T00:53:27Z",
        "terms": {
          "per_payout": {
            "max_amount": 10000,
            "min_amount": null
          },
          "per_frequency": {
            "days": 7,
            "max_amount": 1000000
          }
        },
        "link": "https://go-sandbox.split.cash/open_agreements/2e002c0b-ffaf-44eb-a35c-15fa384ddde1/agreements/invitation"
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK CloseOpenAgreementResponse

    Payment Requests

    A Payment Request (PR) is used to request payment from another party. Additionally, a Payment Request can be approved by anybody, not just other Split users. This is achieved by using our Instant Account Verification process as part of approving a Payment Request.

    Applicable scenarios
    1. A Split account sends a PR to a Contact that is a Split account:
      1. The authoriser must either approve or decline the request; or
      2. Given there is an Agreement in place and the PR is within the terms of the Agreement, then the PR will be automatically approved; or
      3. Given the PR is not within the terms of the Agreement, then the authoriser must either approve or decline the request.
    2. A Split accounts sends a PR to a Contact that is not a Split account:
      1. Given there is an Agreement in place and the PR is within the terms of the Agreement, then the PR will be automatically approved; or
      2. Given the PR is not within the terms of the Agreement, then the PR will not be created; or
      3. There is no Agreement in place, then the PR will not be created.
    Direction

    Payment Requests are broken up by direction:

    1. Incoming: An incoming Payment Request (you are the authoriser/payer)
    2. Outgoing: An outgoing Payment Request (you are the initiator/payee)

    There are two response fields that differ depending on the direction:

    Field Description
    debit_ref Only visible to the PR authoriser (incoming PRs). This reference corresponds to the newly created debit to process the approved PR.
    credit_ref Only visible to the PR initiator (outgoing PRs). This reference corresponds to the newly created credit from the approved PR.

    Lifecycle

    A Payment Request can have the following statuses:

    Status Description
    pending_approval Waiting for the authoriser to approve the PR.
    approved The authoriser has approved the PR.
    declined The payer has declined the PR.
    cancelled The initiator has cancelled the PR.

    Request Payment

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/payment_requests \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}' \
      --header 'content-type: application/json' \
      --data '{"description":"Visible to both initiator and authoriser","matures_at":"2016-12-19T02:10:56Z","amount":99000,"authoriser_contact_id":"de86472c-c027-4735-a6a7-234366a27fc7","metadata":{"custom_key":"Custom string","another_custom_key":"Maybe a URL"}}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payment_requests")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    request.body = "{\"description\":\"Visible to both initiator and authoriser\",\"matures_at\":\"2016-12-19T02:10:56Z\",\"amount\":99000,\"authoriser_contact_id\":\"de86472c-c027-4735-a6a7-234366a27fc7\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}"
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payment_requests",
      "headers": {
        "content-type": "application/json",
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ description: 'Visible to both initiator and authoriser',
      matures_at: '2016-12-19T02:10:56Z',
      amount: 99000,
      authoriser_contact_id: 'de86472c-c027-4735-a6a7-234366a27fc7',
      metadata:
       { custom_key: 'Custom string',
         another_custom_key: 'Maybe a URL' } }));
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    payload = "{\"description\":\"Visible to both initiator and authoriser\",\"matures_at\":\"2016-12-19T02:10:56Z\",\"amount\":99000,\"authoriser_contact_id\":\"de86472c-c027-4735-a6a7-234366a27fc7\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}"
    
    headers = {
        'content-type': "application/json",
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/payment_requests", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/payment_requests")
      .header("content-type", "application/json")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .body("{\"description\":\"Visible to both initiator and authoriser\",\"matures_at\":\"2016-12-19T02:10:56Z\",\"amount\":99000,\"authoriser_contact_id\":\"de86472c-c027-4735-a6a7-234366a27fc7\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $body = new http\Message\Body;
    $body->append('{"description":"Visible to both initiator and authoriser","matures_at":"2016-12-19T02:10:56Z","amount":99000,"authoriser_contact_id":"de86472c-c027-4735-a6a7-234366a27fc7","metadata":{"custom_key":"Custom string","another_custom_key":"Maybe a URL"}}');
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payment_requests');
    $request->setRequestMethod('POST');
    $request->setBody($body);
    
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json',
      'content-type' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payment_requests"
    
        payload := strings.NewReader("{\"description\":\"Visible to both initiator and authoriser\",\"matures_at\":\"2016-12-19T02:10:56Z\",\"amount\":99000,\"authoriser_contact_id\":\"de86472c-c027-4735-a6a7-234366a27fc7\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("content-type", "application/json")
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /payment_requests

    Body parameter

    {
      "description": "Visible to both initiator and authoriser",
      "matures_at": "2016-12-19T02:10:56Z",
      "amount": 99000,
      "authoriser_contact_id": "de86472c-c027-4735-a6a7-234366a27fc7",
      "metadata": {
        "custom_key": "Custom string",
        "another_custom_key": "Maybe a URL"
      }
    }
    

    Parameters

    Parameter In Type Required Description
    body body MakeAPaymentRequestRequest true No description
    » description body string true Description visible to the initiator (payee) & authoriser (payer)
    » matures_at body string true Date & time in UTC ISO8601 that the Payment will be processed if the request is approved. (If the request is approved after this point in time, it will be processed straight away)
    » amount body number true Amount in cents to pay the initiator
    » authoriser_contact_id body string true The Contact the payment will be requested from (Contact.data.id)'
    » metadata body Metadata false Use for your custom data an certain Split customisations

    Example responses

    201 Response

    {
      "data": {
        "ref": "PR.3",
        "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
        "authoriser_id": "970e4526-67d9-4ed9-b554-f5cf390ab775",
        "authoriser_contact_id": "de86472c-c027-4735-a6a7-234366a27fc7",
        "status": "pending_approval",
        "responded_at": null,
        "created_at": "2016-12-19T02:10:56Z",
        "credit_ref": null,
        "payout": {
          "amount": 99000,
          "description": "The elite package for 4",
          "matures_at": "2016-12-25T00:00:00Z"
        },
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Created MakeAPaymentRequestResponse
    422 Unprocessable Entity When a payment is requested from an Anyone Contact with no valid Agreement MakeAPaymentRequestWithNoAgreementResponse

    Approve a Payment Request

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/payment_requests/PR.3/approve \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payment_requests/PR.3/approve")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payment_requests/PR.3/approve",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/payment_requests/PR.3/approve", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/payment_requests/PR.3/approve")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payment_requests/PR.3/approve');
    $request->setRequestMethod('POST');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payment_requests/PR.3/approve"
    
        req, _ := http.NewRequest("POST", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /payment_requests/{payment_request_ref}/approve

    Parameters

    Parameter In Type Required Description
    payment_request_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "PR.3",
        "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
        "authoriser_id": "d194c54b-9183-410c-966b-50485c5ce3f0",
        "authoriser_contact_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
        "status": "approved",
        "responded_at": "2016-12-19T02:38:04Z",
        "created_at": "2016-12-19T02:10:56Z",
        "debit_ref": "D.b",
        "payout": {
          "amount": 99000,
          "description": "The elite package for 4",
          "matures_at": "2016-12-25T00:00:00Z"
        },
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ApprovePaymentRequestResponse

    Decline a Payment Request

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/payment_requests/PR.3/decline \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payment_requests/PR.3/decline")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payment_requests/PR.3/decline",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/payment_requests/PR.3/decline", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/payment_requests/PR.3/decline")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payment_requests/PR.3/decline');
    $request->setRequestMethod('POST');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payment_requests/PR.3/decline"
    
        req, _ := http.NewRequest("POST", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /payment_requests/{payment_request_ref}/decline

    Parameters

    Parameter In Type Required Description
    payment_request_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "PR.3",
        "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
        "authoriser_id": "d194c54b-9183-410c-966b-50485c5ce3f0",
        "authoriser_contact_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
        "status": "declined",
        "responded_at": "2016-12-19T02:38:04Z",
        "created_at": "2016-12-19T02:10:56Z",
        "debit_ref": null,
        "payout": {
          "amount": 99000,
          "description": "The elite package for 4",
          "matures_at": "2016-12-25T00:00:00Z"
        },
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK No description DeclinePaymentRequestResponse

    Get a Payment Request

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/payment_requests/PR.3 \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payment_requests/PR.3")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payment_requests/PR.3",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/payment_requests/PR.3", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/payment_requests/PR.3")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payment_requests/PR.3');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payment_requests/PR.3"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /payment_requests/{payment_request_ref}

    Parameters

    Parameter In Type Required Description
    payment_request_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "PR.3",
        "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
        "authoriser_id": "970e4526-67d9-4ed9-b554-f5cf390ab775",
        "authoriser_contact_id": "de86472c-c027-4735-a6a7-234366a27fc7",
        "status": "approved",
        "responded_at": "2016-12-19T02:38:04Z",
        "created_at": "2016-12-19T02:10:56Z",
        "credit_ref": "C.b",
        "payout": {
          "amount": 99000,
          "description": "The elite package for 4",
          "matures_at": "2016-12-25T00:00:00Z"
        },
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK GetAPaymentRequestResponse

    Cancel a Payment Request

    Code samples

    curl --request DELETE \
      --url https://api-sandbox.split.cash/payment_requests/PR.3 \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payment_requests/PR.3")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payment_requests/PR.3",
      "headers": {
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = { 'authorization': "Bearer {access-token}" }
    
    conn.request("DELETE", "/payment_requests/PR.3", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.delete("https://api-sandbox.split.cash/payment_requests/PR.3")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payment_requests/PR.3');
    $request->setRequestMethod('DELETE');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payment_requests/PR.3"
    
        req, _ := http.NewRequest("DELETE", url, nil)
    
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    DELETE /payment_requests/{payment_request_ref}

    A Payment Request can be cancelled as long as the associated transaction's state is maturing or matured.

    Parameters

    Parameter In Type Required Description
    payment_request_ref path string true Single value, exact match

    Responses

    Status Meaning Description Schema
    204 No Content No Content None

    List incoming Payment Requests

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/payment_requests/incoming \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payment_requests/incoming")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payment_requests/incoming",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/payment_requests/incoming", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/payment_requests/incoming")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payment_requests/incoming');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payment_requests/incoming"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /payment_requests/incoming

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "PR.2",
          "initiator_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
          "authoriser_id": "de86472c-c027-4735-a6a7-234366a27fc7",
          "authoriser_contact_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
          "status": "approved",
          "responded_at": "2016-12-19T02:10:18Z",
          "created_at": "2016-12-19T02:09:09Z",
          "debit_ref": "D.a",
          "payout": {
            "amount": 30000,
            "description": "The SuperPackage",
            "matures_at": "2016-12-20T00:00:00Z"
          }
        },
        {
          "ref": "PR.3",
          "initiator_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
          "authoriser_id": "de86472c-c027-4735-a6a7-234366a27fc7",
          "authoriser_contact_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
          "status": "pending_approval",
          "responded_at": null,
          "created_at": "2016-12-19T02:10:56Z",
          "debit_ref": null,
          "payout": {
            "amount": 99000,
            "description": "The elite package for 4",
            "matures_at": "2016-12-25T00:00:00Z"
          },
          "metadata": {
            "custom_key": "Custom string",
            "another_custom_key": "Maybe a URL"
          }
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListIncomingPaymentRequestsResponse

    List outgoing Payment Requests

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/payment_requests/outgoing \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payment_requests/outgoing")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payment_requests/outgoing",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/payment_requests/outgoing", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/payment_requests/outgoing")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payment_requests/outgoing');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payment_requests/outgoing"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /payment_requests/outgoing

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "PR.4",
          "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
          "authoriser_id": "de86472c-c027-4735-a6a7-234366a27fc7",
          "authoriser_contact_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
          "status": "approved",
          "responded_at": "2016-12-19T02:10:18Z",
          "created_at": "2016-12-19T02:09:09Z",
          "credit_ref": "C.a",
          "payout": {
            "amount": 30000,
            "description": "The SuperPackage",
            "matures_at": "2016-12-20T00:00:00Z"
          }
        },
        {
          "ref": "PR.5",
          "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
          "authoriser_id": "de86472c-c027-4735-a6a7-234366a27fc7",
          "authoriser_contact_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
          "status": "pending_approval",
          "responded_at": null,
          "created_at": "2016-12-19T02:10:56Z",
          "credit_ref": null,
          "payout": {
            "amount": 99000,
            "description": "The elite package for 4",
            "matures_at": "2016-12-25T00:00:00Z"
          }
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListOutgoingPaymentRequestsResponse

    Get a Payment Request's history

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/payment_requests/PR.3/history \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payment_requests/PR.3/history")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payment_requests/PR.3/history",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/payment_requests/PR.3/history", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/payment_requests/PR.3/history")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payment_requests/PR.3/history');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payment_requests/PR.3/history"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /payment_requests/{payment_request_ref}/history

    Gives you visibility of the entire Payment Request lifecycle including the generated debit and credit transactions.

    Parameters

    Parameter In Type Required Description
    payment_request_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": [
        {
          "type": "payout_request",
          "event": "requested",
          "at": "2017-01-05T07:47:45Z",
          "ref": "PR.3",
          "by": "Fancy Pants (fancy_pants)"
        },
        {
          "type": "payout_request",
          "event": "approved",
          "at": "2017-01-07T06:13:52Z",
          "ref": "PR.3",
          "by": "Lycra Co (lycra_co)"
        },
        {
          "type": "debit",
          "event": "scheduled",
          "at": "2017-01-07T06:13:52Z",
          "ref": "D.n",
          "by": "Split Payments"
        },
        {
          "type": "credit",
          "event": "scheduled",
          "at": "2017-01-07T06:13:52Z",
          "ref": "C.e",
          "by": "Split Payments"
        },
        {
          "type": "debit",
          "event": "matured",
          "at": "2017-01-08T04:30:14Z",
          "ref": "D.n",
          "by": "Split Payments"
        },
        {
          "type": "debit",
          "event": "processing",
          "at": "2017-01-08T04:30:14Z",
          "ref": "D.n",
          "by": "Split Payments"
        },
        {
          "type": "debit",
          "event": "clearing",
          "at": "2017-01-08T19:02:20Z",
          "ref": "D.n",
          "by": "Split Payments"
        },
        {
          "type": "debit",
          "event": "cleared",
          "at": "2017-01-11T19:07:52Z",
          "ref": "D.n",
          "by": "Split Payments"
        },
        {
          "type": "credit",
          "event": "matured",
          "at": "2017-01-11T19:07:52Z",
          "ref": "C.e",
          "by": "Split Payments"
        },
        {
          "type": "credit",
          "event": "processing",
          "at": "2017-01-12T04:30:25Z",
          "ref": "C.e",
          "by": "Split Payments"
        },
        {
          "type": "credit",
          "event": "clearing",
          "at": "2017-01-12T05:17:32Z",
          "ref": "C.e",
          "by": "Split Payments"
        },
        {
          "type": "credit",
          "event": "cleared",
          "at": "2017-01-15T05:27:12Z",
          "ref": "C.e",
          "by": "Split Payments"
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK GetAPaymentRequestsHistoryResponse

    Payments

    A Payment is made up of two parts:

    1. General details about the Payment.
    2. One or many Payouts with individual recipients, amounts and descriptions.

    Lifecycle

    The Payment is simply a group of Payouts therefore it does not have a particular status. Its Payouts however have their status regularly updated, for a list of possible Payout statuses check out the Transactions.

    Make a Payment

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/payments \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}' \
      --header 'content-type: application/json' \
      --data '{"description":"The SuperPackage","matures_at":"2016-09-13T00:00:00Z","payouts":[{"amount":30000,"description":"A tandem skydive jump SB23094","recipient_contact_id":"48b89364-1577-4c81-ba02-96705895d457","metadata":{"invoice_ref":"BILL-0001","invoice_id":"c80a9958-e805-47c0-ac2a-c947d7fd778d","custom_key":"Custom string","another_custom_key":"Maybe a URL"}},{"amount":30000,"description":"A scuba dive SDS5464","recipient_contact_id":"dc6f1e60-3803-43ca-a200-7d641816f57f"}],"metadata":{"custom_key":"Custom string","another_custom_key":"Maybe a URL"}}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payments")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    request.body = "{\"description\":\"The SuperPackage\",\"matures_at\":\"2016-09-13T00:00:00Z\",\"payouts\":[{\"amount\":30000,\"description\":\"A tandem skydive jump SB23094\",\"recipient_contact_id\":\"48b89364-1577-4c81-ba02-96705895d457\",\"metadata\":{\"invoice_ref\":\"BILL-0001\",\"invoice_id\":\"c80a9958-e805-47c0-ac2a-c947d7fd778d\",\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}},{\"amount\":30000,\"description\":\"A scuba dive SDS5464\",\"recipient_contact_id\":\"dc6f1e60-3803-43ca-a200-7d641816f57f\"}],\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}"
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payments",
      "headers": {
        "content-type": "application/json",
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ description: 'The SuperPackage',
      matures_at: '2016-09-13T00:00:00Z',
      payouts:
       [ { amount: 30000,
           description: 'A tandem skydive jump SB23094',
           recipient_contact_id: '48b89364-1577-4c81-ba02-96705895d457',
           metadata:
            { invoice_ref: 'BILL-0001',
              invoice_id: 'c80a9958-e805-47c0-ac2a-c947d7fd778d',
              custom_key: 'Custom string',
              another_custom_key: 'Maybe a URL' } },
         { amount: 30000,
           description: 'A scuba dive SDS5464',
           recipient_contact_id: 'dc6f1e60-3803-43ca-a200-7d641816f57f' } ],
      metadata:
       { custom_key: 'Custom string',
         another_custom_key: 'Maybe a URL' } }));
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    payload = "{\"description\":\"The SuperPackage\",\"matures_at\":\"2016-09-13T00:00:00Z\",\"payouts\":[{\"amount\":30000,\"description\":\"A tandem skydive jump SB23094\",\"recipient_contact_id\":\"48b89364-1577-4c81-ba02-96705895d457\",\"metadata\":{\"invoice_ref\":\"BILL-0001\",\"invoice_id\":\"c80a9958-e805-47c0-ac2a-c947d7fd778d\",\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}},{\"amount\":30000,\"description\":\"A scuba dive SDS5464\",\"recipient_contact_id\":\"dc6f1e60-3803-43ca-a200-7d641816f57f\"}],\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}"
    
    headers = {
        'content-type': "application/json",
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/payments", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/payments")
      .header("content-type", "application/json")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .body("{\"description\":\"The SuperPackage\",\"matures_at\":\"2016-09-13T00:00:00Z\",\"payouts\":[{\"amount\":30000,\"description\":\"A tandem skydive jump SB23094\",\"recipient_contact_id\":\"48b89364-1577-4c81-ba02-96705895d457\",\"metadata\":{\"invoice_ref\":\"BILL-0001\",\"invoice_id\":\"c80a9958-e805-47c0-ac2a-c947d7fd778d\",\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}},{\"amount\":30000,\"description\":\"A scuba dive SDS5464\",\"recipient_contact_id\":\"dc6f1e60-3803-43ca-a200-7d641816f57f\"}],\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $body = new http\Message\Body;
    $body->append('{"description":"The SuperPackage","matures_at":"2016-09-13T00:00:00Z","payouts":[{"amount":30000,"description":"A tandem skydive jump SB23094","recipient_contact_id":"48b89364-1577-4c81-ba02-96705895d457","metadata":{"invoice_ref":"BILL-0001","invoice_id":"c80a9958-e805-47c0-ac2a-c947d7fd778d","custom_key":"Custom string","another_custom_key":"Maybe a URL"}},{"amount":30000,"description":"A scuba dive SDS5464","recipient_contact_id":"dc6f1e60-3803-43ca-a200-7d641816f57f"}],"metadata":{"custom_key":"Custom string","another_custom_key":"Maybe a URL"}}');
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payments');
    $request->setRequestMethod('POST');
    $request->setBody($body);
    
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json',
      'content-type' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payments"
    
        payload := strings.NewReader("{\"description\":\"The SuperPackage\",\"matures_at\":\"2016-09-13T00:00:00Z\",\"payouts\":[{\"amount\":30000,\"description\":\"A tandem skydive jump SB23094\",\"recipient_contact_id\":\"48b89364-1577-4c81-ba02-96705895d457\",\"metadata\":{\"invoice_ref\":\"BILL-0001\",\"invoice_id\":\"c80a9958-e805-47c0-ac2a-c947d7fd778d\",\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}},{\"amount\":30000,\"description\":\"A scuba dive SDS5464\",\"recipient_contact_id\":\"dc6f1e60-3803-43ca-a200-7d641816f57f\"}],\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("content-type", "application/json")
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /payments

    Body parameter

    {
      "description": "The SuperPackage",
      "matures_at": "2016-09-13T00:00:00Z",
      "payouts": [
        {
          "amount": 30000,
          "description": "A tandem skydive jump SB23094",
          "recipient_contact_id": "48b89364-1577-4c81-ba02-96705895d457",
          "metadata": {
            "invoice_ref": "BILL-0001",
            "invoice_id": "c80a9958-e805-47c0-ac2a-c947d7fd778d",
            "custom_key": "Custom string",
            "another_custom_key": "Maybe a URL"
          }
        },
        {
          "amount": 30000,
          "description": "A scuba dive SDS5464",
          "recipient_contact_id": "dc6f1e60-3803-43ca-a200-7d641816f57f"
        }
      ],
      "metadata": {
        "custom_key": "Custom string",
        "another_custom_key": "Maybe a URL"
      }
    }
    

    Parameters

    Parameter In Type Required Description
    body body MakeAPaymentRequest true No description
    » description body string true User description. Only visible to the payer
    » matures_at body string true Date & time in UTC ISO8601 the Payment should be processed. (Can not be earlier than the start of current day)
    » payouts body [Payout] true One or many Payouts
    »» Payout body Payout false The actual Payout
    »»» amount body number true Amount in cents to pay the recipient
    »»» description body string true Description that both the payer an recipient can see
    »»» recipient_contact_id body string true Contact to pay (Contact.data.id)
    »»» metadata body Metadata false Use for your custom data an certain Split customisations
    »» metadata body Metadata false Use for your custom data an certain Split customisations

    Detailed descriptions

    »» Payout: The actual Payout

    Example responses

    201 Response

    {
      "data": {
        "ref": "PB.1",
        "payouts": [
          {
            "ref": "D.1",
            "recipient_contact_id": "48b89364-1577-4c81-ba02-96705895d457",
            "batch_description": "The SuperPackage",
            "matures_at": "2016-09-13T23:50:44Z",
            "created_at": "2016-09-10T23:50:44Z",
            "status": "maturing",
            "amount": 30000,
            "description": "A tandem skydive jump SB23094",
            "from_id": "83623359-e86e-440c-9780-432a3bc3626f",
            "to_id": "21066764-c103-4e7f-b436-4cee7db5f400",
            "metadata": {
              "invoice_ref": "BILL-0001",
              "invoice_id": "c80a9958-e805-47c0-ac2a-c947d7fd778d",
              "custom_key": "Custom string",
              "another_custom_key": "Maybe a URL"
            }
          },
          {
            "ref": "D.2",
            "recipient_contact_id": "48b89364-1577-4c81-ba02-96705895d457",
            "batch_description": "The SuperPackage",
            "matures_at": "2016-09-13T23:50:44Z",
            "created_at": "2016-09-10T23:50:44Z",
            "status": "maturing",
            "amount": 30000,
            "description": "A scuba dive SDS5464",
            "from_id": "83623359-e86e-440c-9780-432a3bc3626f",
            "to_id": "21066764-c103-4e7f-b436-4cee7db5f400"
          }
        ],
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Created MakeAPaymentResponse

    List all Payments

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/payments \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payments")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payments",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/payments", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/payments")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payments');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payments"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /payments

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "PB.1",
          "payouts": [
            {
              "ref": "D.1",
              "recipient_contact_id": "48b89364-1577-4c81-ba02-96705895d457",
              "batch_description": "This description is only available to the payer",
              "matures_at": "2016-09-13T23:50:44Z",
              "created_at": "2016-09-10T23:50:44Z",
              "status": "maturing",
              "amount": 30000,
              "description": "The recipient will see this description",
              "from_id": "83623359-e86e-440c-9780-432a3bc3626f",
              "to_id": "21066764-c103-4e7f-b436-4cee7db5f400",
              "metadata": {
                "invoice_ref": "BILL-0001",
                "invoice_id": "c80a9958-e805-47c0-ac2a-c947d7fd778d",
                "custom_key": "Custom string",
                "another_custom_key": "Maybe a URL"
              }
            },
            {
              "ref": "D.2",
              "recipient_contact_id": "dc6f1e60-3803-43ca-a200-7d641816f57f",
              "batch_description": "This description is only available to the payer",
              "matures_at": "2016-09-13T23:50:44Z",
              "created_at": "2016-09-10T23:50:44Z",
              "status": "maturing",
              "amount": 30000,
              "description": "The recipient will see this description",
              "from_id": "48b89364-1577-4c81-ba02-96705895d457",
              "to_id": "f989d9cd-87fc-4c73-b0a4-1eb0e8768d3b"
            }
          ],
          "metadata": {
            "custom_key": "Custom string",
            "another_custom_key": "Maybe a URL"
          }
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListAllPaymentsResponse

    Get a Payment

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/payments/PB.1 \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payments/PB.1")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payments/PB.1",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/payments/PB.1", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/payments/PB.1")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payments/PB.1');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payments/PB.1"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /payments/{payment_ref}

    Get a single payment by its reference

    Parameters

    Parameter In Type Required Description
    payment_ref path string true Payment reference

    Example responses

    200 Response

    {
      "data": {
        "ref": "PB.1",
        "payouts": [
          {
            "ref": "D.1",
            "recipient_contact_id": "48b89364-1577-4c81-ba02-96705895d457",
            "batch_description": "The SuperPackage",
            "matures_at": "2016-09-13T23:50:44Z",
            "created_at": "2016-09-10T23:50:44",
            "status": "maturing",
            "amount": 30000,
            "description": "A tandem skydive jump SB23094",
            "from_id": "83623359-e86e-440c-9780-432a3bc3626f",
            "to_id": "21066764-c103-4e7f-b436-4cee7db5f400",
            "metadata": {
              "invoice_ref": "BILL-0001",
              "invoice_id": "c80a9958-e805-47c0-ac2a-c947d7fd778d",
              "custom_key": "Custom string",
              "another_custom_key": "Maybe a URL"
            }
          },
          {
            "ref": "D.2",
            "recipient_contact_id": "dc6f1e60-3803-43ca-a200-7d641816f57f",
            "batch_description": "The SuperPackage",
            "matures_at": "2016-09-13T23:50:44Z",
            "created_at": "2016-09-10T23:50:44Z",
            "status": "maturing",
            "amount": 30000,
            "description": "A scuba dive SDS5464",
            "from_id": "48b89364-1577-4c81-ba02-96705895d457",
            "to_id": "f989d9cd-87fc-4c73-b0a4-1eb0e8768d3b"
          }
        ],
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK GetAPaymentResponse

    Payouts

    Payouts are what a Payment or Payment Request are made of and can be either a debit or a credit. One or all Payouts can be voided individually as part of the larger Payment or Payment Request.

    Retry a credit/debit Payout

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/payouts/C.2/retry \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payouts/C.2/retry")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payouts/C.2/retry",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/payouts/C.2/retry", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/payouts/C.2/retry")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payouts/C.2/retry');
    $request->setRequestMethod('POST');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payouts/C.2/retry"
    
        req, _ := http.NewRequest("POST", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /payouts/{ref}/retry

    Split will prefail a debit and its associated credit transaction before ever sending it to the bank if we detect a high probability of insufficient funds.

    This endpoint allows you to retry the payout without having to recreate the parent request. e.g A Payment or Payment Request.

    Parameters

    Parameter In Type Required Description
    ref path string true Payout debit or credit reference

    Example responses

    200 Response

    {
      "data": {
        "ref": "C.2",
        "parent_ref": "PR.039a",
        "type": "credit",
        "category": "payout",
        "created_at": "2016-12-05T23:15:00Z",
        "matures_at": "2016-12-06T23:15:00Z",
        "cleared_at": null,
        "bank_ref": null,
        "status": "maturing",
        "party_contact_id": "33c6e31d3-1dc1-448b-9512-0320bc44fdcf",
        "party_name": "Price and Sons",
        "party_nickname": "price-and-sons-2",
        "party_bank_ref": null,
        "description": "Money for jam",
        "amount": 1
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK RetryPayoutResponse

    Void a Payout

    Code samples

    curl --request DELETE \
      --url https://api-sandbox.split.cash/payouts/D.1 \
      --header 'authorization: Bearer {access-token}' \
      --header 'content-type: application/json' \
      --data '{"details":"Incorrect recipient"}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payouts/D.1")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["content-type"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    request.body = "{\"details\":\"Incorrect recipient\"}"
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payouts/D.1",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ details: 'Incorrect recipient' }));
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    payload = "{\"details\":\"Incorrect recipient\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("DELETE", "/payouts/D.1", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.delete("https://api-sandbox.split.cash/payouts/D.1")
      .header("content-type", "application/json")
      .header("authorization", "Bearer {access-token}")
      .body("{\"details\":\"Incorrect recipient\"}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $body = new http\Message\Body;
    $body->append('{"details":"Incorrect recipient"}');
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payouts/D.1');
    $request->setRequestMethod('DELETE');
    $request->setBody($body);
    
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'content-type' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payouts/D.1"
    
        payload := strings.NewReader("{\"details\":\"Incorrect recipient\"}")
    
        req, _ := http.NewRequest("DELETE", url, payload)
    
        req.Header.Add("content-type", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    DELETE /payouts/{ref}

    You can void any Payout debit from your account that has not yet matured. In the case where it has matured, you can send a Refund Request to the Payout recipient once the Payout has successfully cleared in order to reverse the transaction.

    Body parameter

    {
      "details": "Incorrect recipient"
    }
    

    Parameters

    Parameter In Type Required Description
    ref path string true Payout debit reference
    body body VoidAPayoutRequest false No description
    » details body string false Optional details about why the payout has been voided

    Responses

    Status Meaning Description Schema
    204 No Content No Content None

    Refund Requests

    Manage Refund Requests (RR) applied against successfully cleared Payouts. A refunder corresponds to a recipient of a successfully cleared Payout (credit).

    Direction

    Refund Requests are broken up by direction:

    1. Incoming: An incoming Refund Request (you are the authoriser/refunder)
    2. Outgoing: An outgoing Refund Request (you are the initiator/refundee)

    There are two response fields that differ depending on the direction:

    Field Description
    debit_ref Only visible to the RR authoriser (incoming RRs). This reference corresponds to the newly created debit to process the approved RR.
    credit_ref Only visible to the RR initiator (outgoing RRs). This reference corresponds to the newly created credit from the approved RR.

    Lifecycle

    A Refund Request can have the following statuses:

    Status Description
    pending_approval Waiting for the authoriser to approve the RR.
    approved The authoriser has approved the RR.
    declined The payer has declined the RR.
    cancelled The initiator has cancelled the RR.

    Request a Refund

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/payout_refund_requests \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}' \
      --header 'content-type: application/json' \
      --data '{"for_ref":"D.1","amount":500,"reason":"Because reason","metadata":{"custom_key":"Custom string","another_custom_key":"Maybe a URL"}}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payout_refund_requests")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    request.body = "{\"for_ref\":\"D.1\",\"amount\":500,\"reason\":\"Because reason\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}"
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payout_refund_requests",
      "headers": {
        "content-type": "application/json",
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ for_ref: 'D.1',
      amount: 500,
      reason: 'Because reason',
      metadata:
       { custom_key: 'Custom string',
         another_custom_key: 'Maybe a URL' } }));
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    payload = "{\"for_ref\":\"D.1\",\"amount\":500,\"reason\":\"Because reason\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}"
    
    headers = {
        'content-type': "application/json",
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/payout_refund_requests", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/payout_refund_requests")
      .header("content-type", "application/json")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .body("{\"for_ref\":\"D.1\",\"amount\":500,\"reason\":\"Because reason\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $body = new http\Message\Body;
    $body->append('{"for_ref":"D.1","amount":500,"reason":"Because reason","metadata":{"custom_key":"Custom string","another_custom_key":"Maybe a URL"}}');
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payout_refund_requests');
    $request->setRequestMethod('POST');
    $request->setBody($body);
    
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json',
      'content-type' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payout_refund_requests"
    
        payload := strings.NewReader("{\"for_ref\":\"D.1\",\"amount\":500,\"reason\":\"Because reason\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("content-type", "application/json")
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /payout_refund_requests

    Certain rules apply to the creation of a Refund Request:

    Body parameter

    {
      "for_ref": "D.1",
      "amount": 500,
      "reason": "Because reason",
      "metadata": {
        "custom_key": "Custom string",
        "another_custom_key": "Maybe a URL"
      }
    }
    

    Parameters

    Parameter In Type Required Description
    body body RequestARefundRequest true No description
    » for_ref body string true The Payout debit reference to refund against
    » amount body number true Amount in cents to request from the original payout recipient
    » reason body string false Reason for the refund request. Visible to both parties.
    » metadata body Metadata false Use for your custom data an certain Split customisations

    Example responses

    201 Response

    {
      "data": {
        "ref": "RR.2",
        "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
        "authoriser_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
        "status": "pending_approval",
        "responded_at": null,
        "created_at": "2016-12-19T04:34:38Z",
        "for_ref": "D.1",
        "credit_ref": null,
        "amount": 500,
        "reason": "Because reasons",
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Created RequestARefundResponse

    Approve Refund Request

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/payout_refund_requests/PR.3/approve \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payout_refund_requests/PR.3/approve")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payout_refund_requests/PR.3/approve",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/payout_refund_requests/PR.3/approve", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/payout_refund_requests/PR.3/approve")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payout_refund_requests/PR.3/approve');
    $request->setRequestMethod('POST');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payout_refund_requests/PR.3/approve"
    
        req, _ := http.NewRequest("POST", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /payout_refund_requests/{payout_refund_request_ref}/approve

    Parameters

    Parameter In Type Required Description
    payout_refund_request_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "RR.2",
        "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
        "authoriser_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
        "status": "approved",
        "responded_at": "2016-12-19T04:42:59Z",
        "created_at": "2016-12-19T04:34:38Z",
        "for_ref": "C.1",
        "debit_ref": "D.2c3",
        "amount": 100,
        "reason": "Because reasons",
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ApprovePayoutRefundRequestResponse

    Decline Refund Request

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/payout_refund_requests/PR.3/decline \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payout_refund_requests/PR.3/decline")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payout_refund_requests/PR.3/decline",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/payout_refund_requests/PR.3/decline", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/payout_refund_requests/PR.3/decline")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payout_refund_requests/PR.3/decline');
    $request->setRequestMethod('POST');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payout_refund_requests/PR.3/decline"
    
        req, _ := http.NewRequest("POST", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /payout_refund_requests/{payout_refund_request_ref}/decline

    Parameters

    Parameter In Type Required Description
    payout_refund_request_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "RR.2",
        "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
        "authoriser_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
        "status": "declined",
        "responded_at": "2016-12-19T04:42:59Z",
        "created_at": "2016-12-19T04:34:38Z",
        "for_ref": "D.1",
        "debit_ref": null,
        "amount": 100,
        "reason": "Because reasons",
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK DeclinePayoutRefundRequestResponse

    Retrieve a Refund Request

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/payout_refund_requests/RR.2 \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payout_refund_requests/RR.2")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payout_refund_requests/RR.2",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/payout_refund_requests/RR.2", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/payout_refund_requests/RR.2")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payout_refund_requests/RR.2');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payout_refund_requests/RR.2"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /payout_refund_requests/{payout_refund_request_ref}

    Get a specific Refund Request by its reference

    Parameters

    Parameter In Type Required Description
    payout_refund_request_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "RR.2",
        "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
        "authoriser_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
        "status": "pending_approval",
        "responded_at": null,
        "created_at": "2016-12-19T04:34:38Z",
        "for_ref": "D.1",
        "credit_ref": null,
        "amount": 10000,
        "reason": "Because reasons",
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK RetrieveARefundRequestResponse

    Cancel a Refund Request

    Code samples

    curl --request DELETE \
      --url https://api-sandbox.split.cash/payout_refund_requests/RR.2 \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payout_refund_requests/RR.2")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payout_refund_requests/RR.2",
      "headers": {
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = { 'authorization': "Bearer {access-token}" }
    
    conn.request("DELETE", "/payout_refund_requests/RR.2", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.delete("https://api-sandbox.split.cash/payout_refund_requests/RR.2")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payout_refund_requests/RR.2');
    $request->setRequestMethod('DELETE');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payout_refund_requests/RR.2"
    
        req, _ := http.NewRequest("DELETE", url, nil)
    
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    DELETE /payout_refund_requests/{payout_refund_request_ref}

    A Refund Request can only be canceled if it is pending approval.

    Parameters

    Parameter In Type Required Description
    payout_refund_request_ref path string true Single value, exact match

    Responses

    Status Meaning Description Schema
    204 No Content No Content None

    List incoming Refund Requests

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/payout_refund_requests/incoming \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payout_refund_requests/incoming")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payout_refund_requests/incoming",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/payout_refund_requests/incoming", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/payout_refund_requests/incoming")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payout_refund_requests/incoming');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payout_refund_requests/incoming"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /payout_refund_requests/incoming

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "RR.2",
          "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
          "authoriser_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
          "status": "approved",
          "responded_at": "2016-12-19T04:42:59Z",
          "created_at": "2016-12-19T04:34:38Z",
          "for_ref": "C.1",
          "debit_ref": "D.2c3",
          "amount": 100,
          "reason": "Because reasons",
          "metadata": {
            "custom_key": "Custom string",
            "another_custom_key": "Maybe a URL"
          }
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListIncomingRefundRequestsResponse

    List outgoing Refund Requests

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/payout_refund_requests/outgoing \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/payout_refund_requests/outgoing")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/payout_refund_requests/outgoing",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/payout_refund_requests/outgoing", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/payout_refund_requests/outgoing")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/payout_refund_requests/outgoing');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/payout_refund_requests/outgoing"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /payout_refund_requests/outgoing

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "RR.2",
          "initiator_id": "ca7bc5b3-e47f-4153-96fb-bbe326b42772",
          "authoriser_id": "fb6a9252-3818-44dc-b5aa-2195391a746f",
          "status": "pending_approval",
          "responded_at": null,
          "created_at": "2016-12-19T04:34:38Z",
          "for_ref": "D.1",
          "credit_ref": null,
          "amount": 10000,
          "reason": "Because reasons",
          "metadata": {
            "custom_key": "Custom string",
            "another_custom_key": "Maybe a URL"
          }
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListOutgoingRefundRequestsResponse

    Refunds

    Refunds can be issued for any successfully cleared Payout (credit) transactions.

    Direction

    Refunds are broken up by direction:

    1. Incoming: An incoming Refund (you are the recipient of the refund)
    2. Outgoing: An outgoing Refund (you are the issuer of the refund)

    There are two response fields that differ depending on the direction:

    Field Description
    debit_ref Only visible to the Refund issuer (outgoing Refunds). This reference corresponds to the newly created debit to process the Refund.
    credit_ref Only visible to the Refund recipient (incoming Refunds). This reference corresponds to the newly created credit to process the Refund.

    Issue a Refund

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/credits/string/refunds \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}' \
      --header 'content-type: application/json' \
      --data '{"amount":500,"reason":"Because reason","metadata":{"custom_key":"Custom string","another_custom_key":"Maybe a URL"}}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/credits/string/refunds")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    request.body = "{\"amount\":500,\"reason\":\"Because reason\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}"
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/credits/string/refunds",
      "headers": {
        "content-type": "application/json",
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ amount: 500,
      reason: 'Because reason',
      metadata:
       { custom_key: 'Custom string',
         another_custom_key: 'Maybe a URL' } }));
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    payload = "{\"amount\":500,\"reason\":\"Because reason\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}"
    
    headers = {
        'content-type': "application/json",
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/credits/string/refunds", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/credits/string/refunds")
      .header("content-type", "application/json")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .body("{\"amount\":500,\"reason\":\"Because reason\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $body = new http\Message\Body;
    $body->append('{"amount":500,"reason":"Because reason","metadata":{"custom_key":"Custom string","another_custom_key":"Maybe a URL"}}');
    
    $request->setRequestUrl('https://api-sandbox.split.cash/credits/string/refunds');
    $request->setRequestMethod('POST');
    $request->setBody($body);
    
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json',
      'content-type' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/credits/string/refunds"
    
        payload := strings.NewReader("{\"amount\":500,\"reason\":\"Because reason\",\"metadata\":{\"custom_key\":\"Custom string\",\"another_custom_key\":\"Maybe a URL\"}}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("content-type", "application/json")
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /credits/{credit_ref}/refunds

    Certain rules apply to the issuance of a refund:

    Body parameter

    {
      "amount": 500,
      "reason": "Because reason",
      "metadata": {
        "custom_key": "Custom string",
        "another_custom_key": "Maybe a URL"
      }
    }
    

    Parameters

    Parameter In Type Required Description
    credit_ref path string true No description
    body body IssueARefundRequest true No description
    » amount body number true Amount in cents refund
    » reason body string false Reason for the refund. Visible to both parties.
    » metadata body Metadata false Use for your custom data an certain Split customisations

    Example responses

    201 Response

    {
      "data": {
        "ref": "PRF.1",
        "for_ref": "C.59",
        "debit_ref": "D.hi",
        "created_at": "2017-05-08T07:20:24Z",
        "amount": 500,
        "reason": "Because reason",
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Created IssueARefundResponse

    List incoming Refunds

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/refunds/incoming \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/refunds/incoming")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/refunds/incoming",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/refunds/incoming", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/refunds/incoming")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/refunds/incoming');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/refunds/incoming"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /refunds/incoming

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "PRF.2",
          "for_ref": "D.5",
          "credit_ref": "C.q",
          "created_at": "2017-05-09T04:45:26Z",
          "amount": 5,
          "reason": "Because reason",
          "metadata": {
            "custom_key": "Custom string",
            "another_custom_key": "Maybe a URL"
          }
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListIncomingRefundsResponse

    List outgoing Refunds

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/refunds/outgoing \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/refunds/outgoing")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/refunds/outgoing",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/refunds/outgoing", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/refunds/outgoing")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/refunds/outgoing');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/refunds/outgoing"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /refunds/outgoing

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "PRF.2",
          "for_ref": "C.5",
          "debit_ref": "D.5a",
          "created_at": "2017-05-09T04:45:26Z",
          "amount": 5,
          "reason": "Because reason",
          "metadata": {
            "custom_key": "Custom string",
            "another_custom_key": "Maybe a URL"
          }
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListOutgoingRefundsResponse

    Retrieve a Refund

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/refunds/PRF.1 \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/refunds/PRF.1")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/refunds/PRF.1",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/refunds/PRF.1", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/refunds/PRF.1")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/refunds/PRF.1');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/refunds/PRF.1"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /refunds/{refund_ref}

    Get a single Refund by its reference

    Parameters

    Parameter In Type Required Description
    refund_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "PRF.1",
        "for_ref": "C.59",
        "debit_ref": "D.hi",
        "created_at": "2017-05-08T07:20:24Z",
        "amount": 500,
        "reason": "Because reason",
        "metadata": {
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK RetrieveARefundResponse

    Transactions

    The transactions endpoint provides a detailed look at all past, current and future scheduled debits & credits relating to the Split account. In other words, we not only show the transactions initiated by the Split account but also show transactions where the Split account is on the receiving end - even for payments that have not yet matured.

    Lifecycle

    A transaction (debit or credit) can have the following statuses:

    Status Description
    maturing The maturation date has not yet been reached
    matured The maturation date has been reached and the transaction is eligible for processing.
    preprocessing The transaction is undergoing pre-checks before being sent to the bank.
    processing The transaction has been submitted to the bank.
    clearing Waiting for confirmation from the bank that the transaction has succeeded.
    cleared The transaction is complete.
    rejected The bank has rejected the transaction due to incorrect bank account details.
    returned The transaction did not successfully clear.
    voided The transaction has been cancelled and is no longer eligible for processing.
    pending_verification The bank account must be verified before the transaction can proceed.
    paused The transaction has temporary been paused by Split pending internal review.
    prefailed The transaction was never submitted to the bank because we detected that there were insufficient funds. The transaction can be retried.

    Failure reasons

    Example response

    {
      "data": [
        {
          "ref": "D.3",
          "parent_ref": null,
          "type": "debit",
          "category": "payout_refund",
          "created_at": "2016-12-07T23:15:00Z",
          "matures_at": "2016-12-10T23:15:00Z",
          "cleared_at": null,
          "bank_ref": null,
          "status": "returned",
          "failure_reason": "refer_to_customer",
          "failure_details": "Incorrect recipient"
          "party_contact_id": "26297f44-c5e1-40a1-9864-3e0b0754c32a",
          "party_name": "Sanford-Rees",
          "party_nickname": "sanford-rees-8",
          "description": null,
          "amount": 1
        }
      ]
    }
    

    The rejected, returned, voided & prefailed statuses are always accompanied by a failure_reason:

    Reason Description
    invalid_bsb_number BSB number is invalid
    payment_stopped The payment was stopped at the bank. Can be due to a customer requesting a stop payment with their financial institution.
    account_closed The bank account is closed
    customer_deceased Customer is deceased
    incorrect_account_number Account number is incorrect
    refer_to_customer Usually due to insufficient funds
    refer_to_split Failed due to reasons not listed here. Please contact us.
    insufficient_funds Insufficient funds
    user_voided Voided by payout initiator
    admin_voided Voided by Split Payments admin

    Some failures will include additional details which will be returned in failure_details

    List all transactions

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/transactions \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/transactions")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/transactions",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/transactions", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/transactions")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/transactions');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/transactions"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /transactions

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match
    ref (debit or credit) query string false Single value, exact match
    parent_ref query string false Single value, exact match
    bank_ref query string false Single value, exact match
    status query array[string] false Multiple values, exact match
    category query array[string] false Multiple values, exact match
    type query array[string] false Multiple values, exact match
    other_party query string false Single value, string search
    other_party_bank_ref query string false Single value, exact match
    party_contact_id query string false Single value, exact match
    description query string false Single value, string search
    min_amount query integer false Cents, Single value, exact match
    max_amount query integer false Cents, single value, exact match
    min_created_date query string(date-time) false Date/time UTC ISO 8601 format, Single value, exact match
    max_created_date query string(date-time) false Date/time UTC ISO 8601 format, single value, exact match
    min_matured_date query string(date-time) false Date/time UTC ISO 8601 format, Single value, exact match
    max_matured_date query string(date-time) false Date/time UTC ISO 8601 format, single value, exact match
    min_cleared_date query string(date-time) false Date/time UTC ISO 8601 format, Single value, exact match
    max_cleared_date query string(date-time) false Date/time UTC ISO 8601 format, single value, exact match

    Enumerated Values

    Parameter Value
    status maturing
    status matured
    status preprocessing
    status processing
    status clearing
    status cleared
    status rejected
    status returned
    status voided
    status pending_verification
    status paused
    category payout
    category payout_refund
    category invoice
    type debit
    type credit

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "D.3",
          "parent_ref": null,
          "type": "debit",
          "category": "payout_refund",
          "created_at": "2016-12-07T23:15:00Z",
          "matures_at": "2016-12-10T23:15:00Z",
          "cleared_at": "2016-12-10T23:15:00Z",
          "bank_ref": "DT.9a",
          "status": "cleared",
          "party_contact_id": "31354923-b1e9-4d65-b03c-415ead89cbf3",
          "party_name": "Sanford-Rees",
          "party_nickname": null,
          "party_bank_ref": "CT.11",
          "description": null,
          "amount": 20000
        },
        {
          "ref": "D.2",
          "parent_ref": "PB.2",
          "type": "debit",
          "category": "payout",
          "created_at": "2016-12-06T23:15:00Z",
          "matures_at": "2016-12-09T23:15:00Z",
          "cleared_at": null,
          "bank_ref": null,
          "status": "maturing",
          "party_contact_id": "3c6e31d3-1dc1-448b-9512-0320bc44fdcf",
          "party_name": "Gutmann-Schmidt",
          "party_nickname": null,
          "party_bank_ref": null,
          "description": "Batteries for hire",
          "amount": 2949299
        },
        {
          "ref": "C.2",
          "parent_ref": "PB.s0z",
          "type": "credit",
          "category": "payout",
          "created_at": "2016-12-05T23:15:00Z",
          "matures_at": "2016-12-06T23:15:00Z",
          "cleared_at": "2016-12-09T23:15:00Z",
          "bank_ref": "CT.1",
          "status": "cleared",
          "party_contact_id": "33c6e31d3-1dc1-448b-9512-0320bc44fdcf",
          "party_name": "Price and Sons",
          "party_nickname": "price-and-sons-2",
          "party_bank_ref": null,
          "description": "Online purchase",
          "amount": 19999,
          "metadata": {
            "customer_id": "xur4492",
            "product_ref": "TSXL392110x"
          }
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListAllTransactionsResponse

    Unassigned Agreements

    An agreement with no preset authoriser that can only be accepted once and must be accepted within a predefined time period.

    Unassigned Agreements are shared using the generated link available in the response body. You can then include it in an email, text message, embed it in an iFrame, etc...

    Propose an Unassigned Agreement

    Code samples

    curl --request POST \
      --url https://api-sandbox.split.cash/unassigned_agreements \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}' \
      --header 'content-type: application/json' \
      --data '{"expiry_in_seconds":60,"terms":{"per_payout":{"min_amount":null,"max_amount":10000},"per_frequency":{"days":7,"max_amount":1000000}}}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/unassigned_agreements")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    request.body = "{\"expiry_in_seconds\":60,\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}"
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/unassigned_agreements",
      "headers": {
        "content-type": "application/json",
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({ expiry_in_seconds: 60,
      terms:
       { per_payout: { min_amount: null, max_amount: 10000 },
         per_frequency: { days: 7, max_amount: 1000000 } } }));
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    payload = "{\"expiry_in_seconds\":60,\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}"
    
    headers = {
        'content-type': "application/json",
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("POST", "/unassigned_agreements", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.post("https://api-sandbox.split.cash/unassigned_agreements")
      .header("content-type", "application/json")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .body("{\"expiry_in_seconds\":60,\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $body = new http\Message\Body;
    $body->append('{"expiry_in_seconds":60,"terms":{"per_payout":{"min_amount":null,"max_amount":10000},"per_frequency":{"days":7,"max_amount":1000000}}}');
    
    $request->setRequestUrl('https://api-sandbox.split.cash/unassigned_agreements');
    $request->setRequestMethod('POST');
    $request->setBody($body);
    
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json',
      'content-type' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/unassigned_agreements"
    
        payload := strings.NewReader("{\"expiry_in_seconds\":60,\"terms\":{\"per_payout\":{\"min_amount\":null,\"max_amount\":10000},\"per_frequency\":{\"days\":7,\"max_amount\":1000000}}}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("content-type", "application/json")
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    POST /unassigned_agreements

    Create an Unassigned Agreement

    Body parameter

    {
      "expiry_in_seconds": 60,
      "terms": {
        "per_payout": {
          "min_amount": null,
          "max_amount": 10000
        },
        "per_frequency": {
          "days": 7,
          "max_amount": 1000000
        }
      }
    }
    

    Parameters

    Parameter In Type Required Description
    body body ProposeUnassignedAgreementRequest true No description
    » expiry_in_seconds body number true The amount of time in seconds before the Unassigned Agreement can no longer be accepted.
    » single_use body boolean false Optionally propose a single use agreement. When the Unassigned Agreement is accepted and a Payment Request is approved according to the Agreement terms, the agreement will automatically become expended.

    The proposed agreement must have equal max/min per_payout amounts and null per_frequency amounts.

    Furthermore, we will automatically check that the authoriser's bank account has sufficient funds to honour the agreement terms.
    » terms body Terms true Terms
    »» per_payout body PerPayout true No description
    »»» min_amount body number\ null false
    »»» max_amount body number\ null false
    »» per_frequency body PerFrequency true No description
    »»» days body number\ null false
    »»» max_amount body number\ null false

    Example responses

    201 Response

    {
      "data": {
        "ref": "A.4k",
        "initiator_id": "4e2728cc-b4ba-42c2-a6c3-26a7758de58d",
        "status": "proposed",
        "responded_at": null,
        "created_at": "2017-03-20T00:53:27Z",
        "terms": {
          "per_payout": {
            "max_amount": 10000,
            "min_amount": null
          },
          "per_frequency": {
            "days": 7,
            "max_amount": 1000000
          }
        },
        "assignment_expires_at": "2017-03-20T00:54:27Z",
        "link": "https://go-sandbox.split.cash/unassigned_agreements/b61fc159-8779-4a17-a826-e398e3e7e211/invitation"
      }
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Created ProposeUnassignedAgreementResponse

    List all Unassigned Agreements

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/unassigned_agreements \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/unassigned_agreements")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/unassigned_agreements",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/unassigned_agreements", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/unassigned_agreements")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/unassigned_agreements');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/unassigned_agreements"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /unassigned_agreements

    Will return all Unassigned Agreements that have not yet be accepted.

    Parameters

    Parameter In Type Required Description
    page query string false Page of results to return, single value, exact match
    per_page query string false Number of results per page, single value, exact match

    Example responses

    200 Response

    {
      "data": [
        {
          "ref": "A.4k",
          "initiator_id": "4e2728cc-b4ba-42c2-a6c3-26a7758de58d",
          "status": "proposed",
          "responded_at": null,
          "created_at": "2017-03-20T00:53:27Z",
          "terms": {
            "per_payout": {
              "max_amount": 10000,
              "min_amount": null
            },
            "per_frequency": {
              "days": 7,
              "max_amount": 1000000
            }
          },
          "assignment_expires_at": "2017-03-20T00:54:27Z",
          "link": "https://go-sandbox.split.cash/unassigned_agreements/b61fc159-8779-4a17-a826-e398e3e7e211/invitation"
        },
        {
          "ref": "A.7ea",
          "initiator_id": "b61fc159-8779-4a17-a826-e398e3e7e211",
          "status": "proposed",
          "responded_at": null,
          "created_at": "2017-03-21T00:53:27Z",
          "terms": {
            "per_payout": {
              "max_amount": null,
              "min_amount": null
            },
            "per_frequency": {
              "days": null,
              "max_amount": null
            }
          },
          "assignment_expires_at": "2017-03-21T00:54:27Z",
          "link": "https://go-sandbox.split.cash/unassigned_agreements/4e2728cc-b4ba-42c2-a6c3-26a7758de58d/invitation"
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ListUnassignedAgreementsResponse

    Get an Unassigned Agreement

    Code samples

    curl --request GET \
      --url https://api-sandbox.split.cash/unassigned_agreements/A.4k \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {access-token}'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api-sandbox.split.cash/unassigned_agreements/A.4k")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["accept"] = 'application/json'
    request["authorization"] = 'Bearer {access-token}'
    
    response = http.request(request)
    puts response.read_body
    
    var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "api-sandbox.split.cash",
      "port": null,
      "path": "/unassigned_agreements/A.4k",
      "headers": {
        "accept": "application/json",
        "authorization": "Bearer {access-token}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    import http.client
    
    conn = http.client.HTTPSConnection("api-sandbox.split.cash")
    
    headers = {
        'accept': "application/json",
        'authorization': "Bearer {access-token}"
        }
    
    conn.request("GET", "/unassigned_agreements/A.4k", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    HttpResponse<String> response = Unirest.get("https://api-sandbox.split.cash/unassigned_agreements/A.4k")
      .header("accept", "application/json")
      .header("authorization", "Bearer {access-token}")
      .asString();
    
    <?php
    
    $client = new http\Client;
    $request = new http\Client\Request;
    
    $request->setRequestUrl('https://api-sandbox.split.cash/unassigned_agreements/A.4k');
    $request->setRequestMethod('GET');
    $request->setHeaders(array(
      'authorization' => 'Bearer {access-token}',
      'accept' => 'application/json'
    ));
    
    $client->enqueue($request)->send();
    $response = $client->getResponse();
    
    echo $response->getBody();
    
    package main
    
    import (
        "fmt"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api-sandbox.split.cash/unassigned_agreements/A.4k"
    
        req, _ := http.NewRequest("GET", url, nil)
    
        req.Header.Add("accept", "application/json")
        req.Header.Add("authorization", "Bearer {access-token}")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    

    GET /unassigned_agreements/{unassigned_agreement_ref}

    Get a single Unassigned Agreement by its reference

    Parameters

    Parameter In Type Required Description
    unassigned_agreement_ref path string true Single value, exact match

    Example responses

    200 Response

    {
      "data": {
        "ref": "A.4k",
        "initiator_id": "4e2728cc-b4ba-42c2-a6c3-26a7758de58d",
        "status": "proposed",
        "responded_at": null,
        "created_at": "2017-03-20T00:53:27Z",
        "terms": {
          "per_payout": {
            "max_amount": 10000,
            "min_amount": null
          },
          "per_frequency": {
            "days": 7,
            "max_amount"