For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
GuidesAPI Reference
GuidesAPI Reference
  • Network API
  • Customer Request API
  • Management API
      • POSTCreate request chain
LogoLogo
Management APIRequest Chains

Create request chain

POST
/request-chains
POST
/management/v1/request-chains
$curl -X POST https://api.cash.app/management/v1/request-chains \
> -H "Accept: Accept" \
> -H "X-Region: X-Region" \
> -H "X-Signature: X-Signature" \
> -H "User-Agent: User-Agent" \
> -H "Content-Type: application/json" \
> -d '{
> "requests": [
> {
> "uid": "request_1",
> "method": "POST",
> "path": "/network/v1/brands",
> "body": {
> "idempotency_key": "idempotency_key",
> "brand": {
> "name": "Brand Name",
> "reference_id": "reference_id"
> }
> }
> },
> {
> "uid": "request_2",
> "method": "POST",
> "path": "/network/v1/merchants",
> "body": {
> "idempotency_key": "idempotency_key",
> "merchant": {
> "name": "Merchant Name",
> "brand_id": "$request_1:brand.id",
> "country": "US",
> "currency": "USD",
> "category": "5432",
> "reference_id": "reference_id",
> "address": {
> "country": "US"
> }
> }
> }
> },
> {
> "uid": "request_3",
> "method": "GET",
> "path": "/network/v1/brands/{brandId}",
> "path_params": {
> "brandId": "$request_1:brand.id"
> }
> },
> {
> "uid": "request_4",
> "method": "GET",
> "path": "/network/v1/brands",
> "query_params": {
> "limit": "1"
> }
> }
> ],
> "chains": [
> {
> "requests": [
> {
> "uid": "request_1"
> },
> {
> "uid": "request_2"
> },
> {
> "uid": "request_3"
> },
> {
> "uid": "request_4"
> }
> ],
> "execution_mode": "SEQUENTIAL"
> }
> ]
>}'
1{
2 "responses": [
3 {
4 "request_uid": "request_1",
5 "execution_status": "EXECUTED",
6 "path": "/network/v1/brands",
7 "method": "POST",
8 "status_code": 201,
9 "body": {
10 "brand": {
11 "id": "BRAND_brand-id",
12 "reference_id": "reference_id",
13 "name": "Brand Name",
14 "created_at": "2023-01-01T00:00:00Z",
15 "updated_at": "2023-01-01T00:00:00Z",
16 "metadata": {}
17 }
18 },
19 "completed_at": "2023-01-01T00:00:00Z"
20 },
21 {
22 "request_uid": "request_2",
23 "execution_status": "EXECUTED",
24 "path": "/network/v1/merchants",
25 "method": "POST",
26 "status_code": 201,
27 "body": {
28 "merchant": {
29 "id": "MMI_merchant-id",
30 "address": {
31 "country": "US"
32 },
33 "brand_id": "BRAND_brand-id",
34 "category": "5432",
35 "country": "US",
36 "currency": "USD",
37 "name": "Merchant Name",
38 "reference_id": "reference_id",
39 "status": "ACTIVE",
40 "created_at": "2023-01-01T00:00:00Z",
41 "updated_at": "2023-01-01T00:00:00Z",
42 "metadata": {}
43 }
44 },
45 "completed_at": "2023-01-01T00:00:00Z"
46 },
47 {
48 "request_uid": "request_3",
49 "execution_status": "EXECUTED",
50 "path": "/network/v1/brands/BRAND_brand-id",
51 "method": "GET",
52 "status_code": 200,
53 "body": {
54 "brand": {
55 "id": "BRAND_brand-id",
56 "reference_id": "reference_id",
57 "name": "Brand Name",
58 "profile_image_url": "https://franklin-assets.s3.amazonaws.com/merchants/assets/v3/generic/m_category_business.png",
59 "created_at": "2023-01-01T00:00:00Z",
60 "updated_at": "2023-01-01T00:00:00Z",
61 "metadata": {}
62 }
63 },
64 "completed_at": "2023-01-01T00:00:00Z"
65 },
66 {
67 "request_uid": "request_4",
68 "execution_status": "EXECUTED",
69 "path": "/network/v1/brands?limit=1",
70 "method": "GET",
71 "status_code": 200,
72 "body": {
73 "brands": [
74 {
75 "id": "BRAND_brand-id",
76 "reference_id": "reference_id",
77 "name": "Brand Name",
78 "profile_image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Earth_from_Space.jpg/480px-Earth_from_Space.jpg",
79 "created_at": "2023-01-01T00:00:00Z",
80 "updated_at": "2023-01-01T00:00:00Z",
81 "color": "#ffffff",
82 "metadata": {}
83 }
84 ],
85 "cursor": "example-cursor"
86 },
87 "completed_at": "2023-01-01T00:00:00Z"
88 }
89 ]
90}
Executes multiple requests, grouped into "chains", in a single call. The API Client (Client) can use multiple chains and specify sub-requests within each chain to run sequentially or in parallel. However the chains, themselves, will only run sequentially. ### Accessing a previous response's value Clients can access a previous response's value by using the format: `$[previous request's uid]:[key path]`. Clients can use this in the value fields of: - `requests[].body` - `requests[].path_params` - `requests[].query_params` The request's path `requests[].path` has an extra step to access a previous response's value. In the request's path, the Client will first refer to a key in the `requests[].path_params` field using the format: `{[path_params key name]}`. From there `requests[].path_params` can use the pattern described in **Accessing a previous response's value** to obtain a previous response's value. <Warning> The initial security headers will be passed to all requests. Scopes are not required for this endpoint. However, the API key must contain the appropriate scopes required by the individual requests to execute. </Warning> For FAQs and performance improvement details, visit [Optimizing Performance with Request Chaining](../docs/partner-onboarding/optimizing-performance-with-request-chaining.md).
Was this page helpful?
Previous

ErrorResponse

Next
Built with

Executes multiple requests, grouped into “chains”, in a single call. The API Client (Client) can use multiple chains and specify sub-requests within each chain to run sequentially or in parallel. However the chains, themselves, will only run sequentially.

Accessing a previous response’s value

Clients can access a previous response’s value by using the format: $[previous request's uid]:[key path]. Clients can use this in the value fields of:

  • requests[].body
  • requests[].path_params
  • requests[].query_params

The request’s path requests[].path has an extra step to access a previous response’s value. In the request’s path, the Client will first refer to a key in the requests[].path_params field using the format: {[path_params key name]}. From there requests[].path_params can use the pattern described in Accessing a previous response’s value to obtain a previous response’s value.

The initial security headers will be passed to all requests.

Scopes are not required for this endpoint. However, the API key must contain the appropriate scopes required by the individual requests to execute.

For FAQs and performance improvement details, visit Optimizing Performance with Request Chaining.

Headers

AcceptstringRequired
X-RegionstringRequired
X-SignaturestringRequired
User-AgentstringRequired

Request

requestslist of objectsRequired
Requests to execute
chainslist of objectsRequired
Chains control the order and execution modes of requests

Response

Created
responseslist of objects

Errors

400
Bad Request Error