NAV Navigation
Shell HTTP JavaScript Ruby Python PHP Java Go

Mariana Tek Stripe Integration API v1.0.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.

Here are the endpoints you need to integrate with Mariana via Stripe.

Email: Support

Authentication

Configuration

Get configuration values

Code samples

# You can also use wget
curl -X POST /api/stripe/v1/configuration/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /api/stripe/v1/configuration/ HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "cart": 123
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/api/stripe/v1/configuration/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/api/stripe/v1/configuration/',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api/stripe/v1/configuration/', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/stripe/v1/configuration/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/stripe/v1/configuration/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/stripe/v1/configuration/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/stripe/v1/configuration/

Retrieve configuration values for Stripe.

Accepts both GET and POST requests. Returns information necessary to initialize Stripe on the frontend.

Optionally accepts a cart parameter. If one is specified, the response will include the Stripe Location ID associated with the cart's fulfillment partner.

Body parameter

{
  "cart": 123
}

Parameters

Name In Type Required Description
body body ConfigurationRequest false none

Example responses

200 Response

{
  "stripe_publishable_api_key": "pk_test_abc123",
  "stripe_location_id": "tml_123"
}

Responses

Status Meaning Description Schema
200 OK Success. ConfigurationResponse
401 Unauthorized Authorization information is missing or invalid. None
403 Forbidden The authenticated user does not have permission to perform this request. None
422 Unprocessable Entity Request is invalid. None

Card Storage

Create a setup intent

Code samples

# You can also use wget
curl -X POST /api/stripe/v1/setup_intent/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /api/stripe/v1/setup_intent/ HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "user": "123",
  "colletion_method": "terminal"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/api/stripe/v1/setup_intent/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/api/stripe/v1/setup_intent/',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api/stripe/v1/setup_intent/', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/stripe/v1/setup_intent/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/stripe/v1/setup_intent/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/stripe/v1/setup_intent/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/stripe/v1/setup_intent/

Trigger a request to Stripe to create a setup intent for a user.

Body parameter

{
  "user": "123",
  "colletion_method": "terminal"
}

Parameters

Name In Type Required Description
body body SetupIntentRequest false none

Example responses

200 Response

{
  "stripe_setup_intent_id": "seti_abc213",
  "stripe_publishable_api_key": "pk_test_abc123",
  "client_secret": "seti_abc123_secret_456def"
}

Responses

Status Meaning Description Schema
200 OK Success. SetupIntentResponse
401 Unauthorized Authorization information is missing or invalid. None
403 Forbidden The authenticated user does not have permission to perform this request. None
422 Unprocessable Entity Request is invalid. None

Create a bankcard from a Stripe payment method

Code samples

# You can also use wget
curl -X POST /api/stripe/v1/store_payment_method/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /api/stripe/v1/store_payment_method/ HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "Jane Doe",
  "partner": 72341,
  "payment_method": "pm_1L2PfRI1kLQM3y1JNVjc7KLL",
  "postal_code": 33213,
  "user": 234510
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/api/stripe/v1/store_payment_method/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/api/stripe/v1/store_payment_method/',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api/stripe/v1/store_payment_method/', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/stripe/v1/store_payment_method/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/stripe/v1/store_payment_method/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/stripe/v1/store_payment_method/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/stripe/v1/store_payment_method/

Receive a Stripe payment method and create a bankcard based on that information

Body parameter

{
  "name": "Jane Doe",
  "partner": 72341,
  "payment_method": "pm_1L2PfRI1kLQM3y1JNVjc7KLL",
  "postal_code": 33213,
  "user": 234510
}

Parameters

Name In Type Required Description
body body StorePaymentMethodRequest false none

Example responses

200 Response

{
  "payment_method": "pm_1L2PfRI1kLQM3y1JNVjc7KLL",
  "bankcard": 993
}

Responses

Status Meaning Description Schema
200 OK Success. StorePaymentMethodResponse
401 Unauthorized Authorization information is missing or invalid. None
403 Forbidden The authenticated user does not have permission to perform this request. None
422 Unprocessable Entity Request is invalid. None

Payment Processing

Create a payment intent

Code samples

# You can also use wget
curl -X POST /api/stripe/v1/payment_intent/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /api/stripe/v1/payment_intent/ HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "cart": "123",
  "amount": "56.78",
  "account_balance_payment_amount": "12.34",
  "payment_type": "card"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/api/stripe/v1/payment_intent/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/api/stripe/v1/payment_intent/',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api/stripe/v1/payment_intent/', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/stripe/v1/payment_intent/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/stripe/v1/payment_intent/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/stripe/v1/payment_intent/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/stripe/v1/payment_intent/

Trigger a request to Stripe to create a payment intent for a cart & amount.

Body parameter

{
  "cart": "123",
  "amount": "56.78",
  "account_balance_payment_amount": "12.34",
  "payment_type": "card"
}

Parameters

Name In Type Required Description
body body PaymentIntentRequest false none

Example responses

200 Response

{
  "stripe_payment_intent_id": "pi_abc213",
  "stripe_publishable_api_key": "pk_test_abc123",
  "client_secret": "pi_abc123_secret_456def"
}

Responses

Status Meaning Description Schema
200 OK Success. PaymentIntentResponse
401 Unauthorized Authorization information is missing or invalid. None
403 Forbidden The authenticated user does not have permission to perform this request. None
422 Unprocessable Entity Request is invalid. None

Get the status of a cart

Code samples

# You can also use wget
curl -X POST /api/stripe/v1/payment_status/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /api/stripe/v1/payment_status/ HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "cart": "123"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/api/stripe/v1/payment_status/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/api/stripe/v1/payment_status/',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api/stripe/v1/payment_status/', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/stripe/v1/payment_status/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/stripe/v1/payment_status/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/stripe/v1/payment_status/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/stripe/v1/payment_status/

Use this endpoint to poll the status of a cart.

Body parameter

{
  "cart": "123"
}

Parameters

Name In Type Required Description
body body PaymentStatusRequest false none

Example responses

200 Response

{
  "status": "Open",
  "order": "123",
  "error": "Cool T-Shirt is out of stock :("
}

Responses

Status Meaning Description Schema
200 OK Success. PaymentStatusResponse
401 Unauthorized Authorization information is missing or invalid. None
403 Forbidden The authenticated user does not have permission to perform this request. None
422 Unprocessable Entity Request is invalid. None

Terminal

Create a connection token

Code samples

# You can also use wget
curl -X POST /api/stripe/v1/connection_token/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /api/stripe/v1/connection_token/ HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "cart": 123
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/api/stripe/v1/connection_token/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/api/stripe/v1/connection_token/',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api/stripe/v1/connection_token/', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/stripe/v1/connection_token/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/stripe/v1/connection_token/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/stripe/v1/connection_token/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/stripe/v1/connection_token/

Create a token to connect to a terminal reader.

Body parameter

{
  "cart": 123
}

Parameters

Name In Type Required Description
body body ConnectionTokenRequest false none

Example responses

200 Response

{
  "stripe_connection_token": "pst_test_123abc_456def"
}

Responses

Status Meaning Description Schema
200 OK Success. ConnectionTokenResponse
401 Unauthorized Authorization information is missing or invalid. None
403 Forbidden The authenticated user does not have permission to perform this request. None
422 Unprocessable Entity Request is invalid. None

Deregister a terminal reader

Code samples

# You can also use wget
curl -X POST /api/stripe/v1/deregister_terminal/ \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /api/stripe/v1/deregister_terminal/ HTTP/1.1

Content-Type: application/json

const inputBody = '{
  "terminal_id": "tmr_123"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/api/stripe/v1/deregister_terminal/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/api/stripe/v1/deregister_terminal/',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api/stripe/v1/deregister_terminal/', headers = headers)

print(r.json())

 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/stripe/v1/deregister_terminal/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/stripe/v1/deregister_terminal/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/stripe/v1/deregister_terminal/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/stripe/v1/deregister_terminal/

Deregister a terminal reader.

Body parameter

{
  "terminal_id": "tmr_123"
}

Parameters

Name In Type Required Description
body body DeregisterTerminalRequest false none

Responses

Status Meaning Description Schema
204 No Content Success. None
401 Unauthorized Authorization information is missing or invalid. None
403 Forbidden The authenticated user does not have permission to perform this request. None
422 Unprocessable Entity Request is invalid. None

Register a terminal reader

Code samples

# You can also use wget
curl -X POST /api/stripe/v1/register_terminal/ \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /api/stripe/v1/register_terminal/ HTTP/1.1

Content-Type: application/json

const inputBody = '{
  "location": "123",
  "registration_code": "donkey-gecko-inspired",
  "label": "Front Desk"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/api/stripe/v1/register_terminal/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/api/stripe/v1/register_terminal/',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api/stripe/v1/register_terminal/', headers = headers)

print(r.json())

 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/stripe/v1/register_terminal/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/stripe/v1/register_terminal/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/stripe/v1/register_terminal/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/stripe/v1/register_terminal/

Register a terminal reader with Stripe.

Body parameter

{
  "location": "123",
  "registration_code": "donkey-gecko-inspired",
  "label": "Front Desk"
}

Parameters

Name In Type Required Description
body body RegisterTerminalRequest false none

Responses

Status Meaning Description Schema
204 No Content Success. None
401 Unauthorized Authorization information is missing or invalid. None
403 Forbidden The authenticated user does not have permission to perform this request. None
422 Unprocessable Entity Request is invalid. None

List terminal readers

Code samples

# You can also use wget
curl -X POST /api/stripe/v1/terminal_readers/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /api/stripe/v1/terminal_readers/ HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "location": "123"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/api/stripe/v1/terminal_readers/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/api/stripe/v1/terminal_readers/',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api/stripe/v1/terminal_readers/', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/stripe/v1/terminal_readers/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/stripe/v1/terminal_readers/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/stripe/v1/terminal_readers/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/stripe/v1/terminal_readers/

Query Stripe for the terminal readers registered at a given location.

Body parameter

{
  "location": "123"
}

Parameters

Name In Type Required Description
body body TerminalListRequest false none

Example responses

200 Response

[
  {
    "terminal_id": "tmr_123",
    "label": "Front Desk"
  }
]

Responses

Status Meaning Description Schema
200 OK Success. TerminalListResponse
401 Unauthorized Authorization information is missing or invalid. None
403 Forbidden The authenticated user does not have permission to perform this request. None
422 Unprocessable Entity Request is invalid. None

Update a terminal reader

Code samples

# You can also use wget
curl -X POST /api/stripe/v1/update_terminal/ \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /api/stripe/v1/update_terminal/ HTTP/1.1

Content-Type: application/json

const inputBody = '{
  "terminal_id": "tmr_123",
  "label": "Front Desk"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/api/stripe/v1/update_terminal/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/api/stripe/v1/update_terminal/',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/api/stripe/v1/update_terminal/', headers = headers)

print(r.json())

 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/stripe/v1/update_terminal/', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/stripe/v1/update_terminal/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/stripe/v1/update_terminal/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/stripe/v1/update_terminal/

Update the label on a terminal reader registered with Stripe.

Body parameter

{
  "terminal_id": "tmr_123",
  "label": "Front Desk"
}

Parameters

Name In Type Required Description
body body UpdateTerminalRequest false none

Responses

Status Meaning Description Schema
204 No Content Success. None
401 Unauthorized Authorization information is missing or invalid. None
403 Forbidden The authenticated user does not have permission to perform this request. None
422 Unprocessable Entity Request is invalid. None

Schemas

ConfigurationRequest

{
  "cart": 123
}

Properties

Name Type Required Restrictions Description
cart string false none Optional. The ID of the cart that will be checked out.

ConfigurationResponse

{
  "stripe_publishable_api_key": "pk_test_abc123",
  "stripe_location_id": "tml_123"
}

Properties

Name Type Required Restrictions Description
stripe_publishable_api_key string false none Used to identify our account with Stripe. Required to initialize Stripe on the frontend.
stripe_location_id string false none If the request specified a cart parameter, this field will contain the Stripe Location ID associated with the cart's fulfillment partner.

ConnectionTokenRequest

{
  "cart": 123
}

Properties

Name Type Required Restrictions Description
cart string true none The ID of the cart that will be paid for.

ConnectionTokenResponse

{
  "stripe_connection_token": "pst_test_123abc_456def"
}

Properties

Name Type Required Restrictions Description
stripe_connection_token string false none Used to connect to a Stripe terminal reader on the frontend.

DeregisterTerminalRequest

{
  "terminal_id": "tmr_123"
}

Properties

Name Type Required Restrictions Description
terminal_id string true none The Stripe Terminal ID of the reader to deregister.

PaymentIntentRequest

{
  "cart": "123",
  "amount": "56.78",
  "account_balance_payment_amount": "12.34",
  "payment_type": "card"
}

Properties

Name Type Required Restrictions Description
cart string true none The ID of the cart that will be paid for.
amount string true none The amount that will be charged in Stripe.
account_balance_payment_amount string false none How much account balance to apply to the order, if any.
payment_type string false none How payment information will be collected. Can be card to denote manual card entry or terminal to denote that the payment method will be read via terminal reader. Defaults to card.

Enumerated Values

Property Value
payment_type card
payment_type terminal

PaymentIntentResponse

{
  "stripe_payment_intent_id": "pi_abc213",
  "stripe_publishable_api_key": "pk_test_abc123",
  "client_secret": "pi_abc123_secret_456def"
}

Properties

Name Type Required Restrictions Description
stripe_payment_intent_id string false none ID of the PaymentIntent created with Stripe.
stripe_publishable_api_key string false none Used to identify our account with Stripe. Required to initialize Stripe on the frontend.
client_secret string false none Used to complete a payment with Stripe through our frontend. Per Stripe, "should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer."

PaymentStatusRequest

{
  "cart": "123"
}

Properties

Name Type Required Restrictions Description
cart string true none The ID of the cart that is being checked out.

PaymentStatusResponse

{
  "status": "Open",
  "order": "123",
  "error": "Cool T-Shirt is out of stock :("
}

Properties

Name Type Required Restrictions Description
status string false none The status of the cart specified in the request. Options include Open, Submitted, and Failed. Submitted means successful.
order string false none If the specified cart was checked out successfully, this will specify the ID of the resulting order.
error string false none If checkout failed, either because the payment failed with Stripe or something went wrong on our end, this field will contain the text of the error that caused the failure.

RegisterTerminalRequest

{
  "location": "123",
  "registration_code": "donkey-gecko-inspired",
  "label": "Front Desk"
}

Properties

Name Type Required Restrictions Description
location string true none The ID of the Mariana Location where the terminal should be registered.
registration_code string true none The three-word code that is displayed on a reader's screen during the registration process.
label string true none The human-readable name for this reader that should be displayed on the checkout page.

SetupIntentRequest

{
  "user": "123",
  "colletion_method": "terminal"
}

Properties

Name Type Required Restrictions Description
user string true none The ID of the user account where the card will be saved.
colletion_method string false none Collection method is used to determine if the setup intent request is coming from a Stripe terminal or entered manually.

Enumerated Values

Property Value
colletion_method manual
colletion_method terminal

SetupIntentResponse

{
  "stripe_setup_intent_id": "seti_abc213",
  "stripe_publishable_api_key": "pk_test_abc123",
  "client_secret": "seti_abc123_secret_456def"
}

Properties

Name Type Required Restrictions Description
stripe_setup_intent_id string false none ID of the SetupIntent created with Stripe.
stripe_publishable_api_key string false none Used to identify our account with Stripe. Required to initialize Stripe on the frontend.
client_secret string false none Used to complete the card storage process with Stripe through our frontend. Per Stripe, "should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer."

StorePaymentMethodRequest

{
  "name": "Jane Doe",
  "partner": 72341,
  "payment_method": "pm_1L2PfRI1kLQM3y1JNVjc7KLL",
  "postal_code": 33213,
  "user": 234510
}

Properties

Name Type Required Restrictions Description
name string false none The name of the owner of the payment method.
partner string true none The ID of the partner. The partner is used to determine the Stripe gateway where the bankcard will be stored.
payment_method string true none The ID of the Stripe payment method. This ID will be used to retrieve the payment method from Stripe.
postal_code string true none The postal code that belongs to the card that will be saved. After creating a bankcard the payment method in Stripe will be updated with this postal code.
user string true none The Mariana user ID that will be attached to the newly created bankcard.

StorePaymentMethodResponse

{
  "payment_method": "pm_1L2PfRI1kLQM3y1JNVjc7KLL",
  "bankcard": 993
}

Properties

Name Type Required Restrictions Description
payment_method string false none The Stripe payment method ID.
bankcard string false none The ID of the newly created bankcard.

TerminalListRequest

{
  "location": "123"
}

Properties

Name Type Required Restrictions Description
location string true none The ID of the Mariana Location to list terminal readers for.

TerminalListResponse

[
  {
    "terminal_id": "tmr_123",
    "label": "Front Desk"
  }
]

Properties

Name Type Required Restrictions Description
terminal_id string false none The Stripe Terminal ID of a reader registered at the given location.
label string false none The human-readable name for the registered reader.

UpdateTerminalRequest

{
  "terminal_id": "tmr_123",
  "label": "Front Desk"
}

Properties

Name Type Required Restrictions Description
terminal_id string true none The Stripe Terminal ID of the reader to update.
label string true none The new human-readable name for the reader.