Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Latest commit

 

History

History
60 lines (38 loc) · 2.08 KB

CheckoutApi.md

File metadata and controls

60 lines (38 loc) · 2.08 KB

SquareConnect.CheckoutApi

All URIs are relative to https://connect.squareup.com

Method HTTP request Description
createCheckout POST /v2/locations/{location_id}/checkouts CreateCheckout

createCheckout

CreateCheckoutResponse createCheckout(locationId, body)

CreateCheckout

Links a `checkoutId` to a `checkout_page_url` that customers will be directed to in order to provide their payment information using a payment processing workflow hosted on connect.squareup.com.

Example

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.CheckoutApi();

var locationId = SquareConnect.CheckoutApi.constructFromObject({}); // String | The ID of the business location to associate the checkout with.

var body = SquareConnect.CheckoutApi.constructFromObject({}); // CreateCheckoutRequest | An object containing the fields to POST for the request.  See the corresponding object definition for field details.

apiInstance.createCheckout(locationId, body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
locationId String The ID of the business location to associate the checkout with.
body CreateCheckoutRequest An object containing the fields to POST for the request. See the corresponding object definition for field details.

Return type

CreateCheckoutResponse

Authorization

oauth2

HTTP request headers

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