Skip to content

Latest commit

 

History

History
252 lines (178 loc) · 7.27 KB

CheckoutsApi.md

File metadata and controls

252 lines (178 loc) · 7.27 KB

SumUpRestApi.CheckoutsApi

All URIs are relative to https://api.sumup.com/{version}

Method HTTP request Description
checkoutsGet GET /checkouts List checkouts
checkoutsIdDelete DELETE /checkouts/{id} Deactivate a checkout
checkoutsIdGet GET /checkouts/{id} Retrieve a checkout
checkoutsIdPut PUT /checkouts/{id} Process a checkout
checkoutsPost POST /checkouts Create a checkout

checkoutsGet

[CheckoutSuccess] checkoutsGet(opts)

List checkouts

Lists created checkout resources according to the applied `checkout_reference`.

Example

import {SumUpRestApi} from 'sumup-rest-api';
let defaultClient = SumUpRestApi.ApiClient.instance;

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

let apiInstance = new SumUpRestApi.CheckoutsApi();
let opts = { 
  'checkoutReference': "checkoutReference_example" // String | Filters the list of checkout resources by the unique ID of the checkout.
};
apiInstance.checkoutsGet(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
checkoutReference String Filters the list of checkout resources by the unique ID of the checkout. [optional]

Return type

[CheckoutSuccess]

Authorization

accessToken

HTTP request headers

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

checkoutsIdDelete

InlineResponse2001 checkoutsIdDelete(id)

Deactivate a checkout

Deactivates an identified checkout resource. If the checkout has already been processed it can not be deactivated.

Example

import {SumUpRestApi} from 'sumup-rest-api';
let defaultClient = SumUpRestApi.ApiClient.instance;

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

let apiInstance = new SumUpRestApi.CheckoutsApi();
let id = "id_example"; // String | Unique ID of the checkout resource.

apiInstance.checkoutsIdDelete(id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
id String Unique ID of the checkout resource.

Return type

InlineResponse2001

Authorization

accessToken

HTTP request headers

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

checkoutsIdGet

CheckoutSuccess checkoutsIdGet(id)

Retrieve a checkout

Retrieves an identified checkout resource. Use this request after processing a checkout to confirm its status and inform the end user respectively.

Example

import {SumUpRestApi} from 'sumup-rest-api';
let defaultClient = SumUpRestApi.ApiClient.instance;

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

let apiInstance = new SumUpRestApi.CheckoutsApi();
let id = "id_example"; // String | Unique ID of the checkout resource.

apiInstance.checkoutsIdGet(id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
id String Unique ID of the checkout resource.

Return type

CheckoutSuccess

Authorization

accessToken

HTTP request headers

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

checkoutsIdPut

CheckoutSuccess checkoutsIdPut(id, opts)

Process a checkout

Processing a checkout will attempt to charge the provided payment instrument for the amount of the specified checkout resource initiated in the `Create a checkout` endpoint. Follow this request with `Retrieve a checkout` to confirm its status.

Example

import {SumUpRestApi} from 'sumup-rest-api';

let apiInstance = new SumUpRestApi.CheckoutsApi();
let id = "id_example"; // String | Unique ID of the checkout resource.
let opts = { 
  'body': new SumUpRestApi.CheckoutProcessMixin() // CheckoutProcessMixin | Details of the payment instrument for processing the checkout.
};
apiInstance.checkoutsIdPut(id, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
id String Unique ID of the checkout resource.
body CheckoutProcessMixin Details of the payment instrument for processing the checkout. [optional]

Return type

CheckoutSuccess

Authorization

No authorization required

HTTP request headers

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

checkoutsPost

Checkout checkoutsPost(opts)

Create a checkout

Creates a new payment checkout resource. The unique `checkout_reference` created by this request, is used for further manipulation of the checkout. For 3DS checkouts, add the `redirect_url` parameter to your request body schema. Follow by processing a checkout to charge the provided payment instrument.

Example

import {SumUpRestApi} from 'sumup-rest-api';
let defaultClient = SumUpRestApi.ApiClient.instance;

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

let apiInstance = new SumUpRestApi.CheckoutsApi();
let opts = { 
  'body': new SumUpRestApi.CheckoutCreateRequest() // CheckoutCreateRequest | 
};
apiInstance.checkoutsPost(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
body CheckoutCreateRequest [optional]

Return type

Checkout

Authorization

accessToken

HTTP request headers

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