apicommands

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package apicommands connects CLI commands to the OpenAPI operations exposed by the pinned SumUp Go SDK.

Index

Constants

View Source
const (
	CatalogSDKModule      = "github.com/sumup/sumup-go"
	CatalogSDKVersion     = "v0.19.0"
	CatalogOpenAPIVersion = "1.0.0"
	CatalogSpecSHA256     = "b050b86c35d18907a2a6b9f633bd1460568f37e450465047947c2aefad98d72e"
)

Variables

View Source
var Operations = []Operation{
	{
		ID:          "CreateCheckout",
		Client:      "Checkouts",
		SDKMethod:   "Create",
		HTTPMethod:  "POST",
		Path:        "/v0.1/checkouts",
		Summary:     "Create a checkout",
		Description: "Creates a new payment checkout resource. The unique `checkout_reference` created by this request, is used for further manipulation of the checkout.\n\nFor 3DS checkouts, add the `redirect_url` parameter to your request body schema.\nTo use the [Hosted Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the `hosted_checkout.enabled` to `true`.\n\nFollow by processing a checkout to charge the provided payment instrument.",
		RequestBody: &RequestBody{Schema: "CheckoutCreateRequest", Required: true},
	},
	{
		ID:          "CreateApplePaySession",
		Client:      "Checkouts",
		SDKMethod:   "CreateApplePaySession",
		HTTPMethod:  "PUT",
		Path:        "/v0.2/checkouts/{checkout_id}/apple-pay-session",
		Summary:     "Create an Apple Pay session",
		Description: "Creates an Apple Pay merchant session for the specified checkout.\n\nUse this endpoint after the customer selects Apple Pay and before calling\n`ApplePaySession.completeMerchantValidation(...)` in the browser.\nSumUp validates the merchant session request and returns the Apple Pay\nsession object that your frontend should pass to Apple's JavaScript API.",
		Parameters: []Parameter{
			{Name: "checkout_id", Location: "path", Description: "Unique identifier of the checkout resource.", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "object", Required: false},
	},
	{
		ID:          "DeactivateCheckout",
		Client:      "Checkouts",
		SDKMethod:   "Deactivate",
		HTTPMethod:  "DELETE",
		Path:        "/v0.1/checkouts/{checkout_id}",
		Summary:     "Deactivate a checkout",
		Description: "Deactivates an identified checkout resource. If the checkout has already been processed it can not be deactivated.",
		Parameters: []Parameter{
			{Name: "checkout_id", Location: "path", Description: "Unique identifier of the checkout resource.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "GetCheckout",
		Client:      "Checkouts",
		SDKMethod:   "Get",
		HTTPMethod:  "GET",
		Path:        "/v0.1/checkouts/{checkout_id}",
		Summary:     "Retrieve a checkout",
		Description: "Retrieves an identified checkout resource. Use this request after processing a checkout to confirm its status and inform the end user respectively.",
		Parameters: []Parameter{
			{Name: "checkout_id", Location: "path", Description: "Unique identifier of the checkout resource.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "ListCheckouts",
		Client:      "Checkouts",
		SDKMethod:   "List",
		HTTPMethod:  "GET",
		Path:        "/v0.1/checkouts",
		Summary:     "List checkouts",
		Description: "Lists created checkout resources according to the applied `checkout_reference`.",
		Parameters: []Parameter{
			{Name: "checkout_reference", Location: "query", Description: "Filters the list of checkout resources by the unique reference of the checkout.", Type: "string", Format: "", Required: false},
		},
	},
	{
		ID:          "GetPaymentMethods",
		Client:      "Checkouts",
		SDKMethod:   "ListAvailablePaymentMethods",
		HTTPMethod:  "GET",
		Path:        "/v0.1/merchants/{merchant_code}/payment-methods",
		Summary:     "Get available payment methods",
		Description: "Get payment methods available for the given merchant to use with a checkout.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "amount", Location: "query", Description: "The amount for which the payment methods should be eligible, in major units.", Type: "number", Format: "", Required: false},
			{Name: "currency", Location: "query", Description: "The currency for which the payment methods should be eligible.", Type: "string", Format: "", Required: false},
		},
	},
	{
		ID:          "UpdateCheckout",
		Client:      "Checkouts",
		SDKMethod:   "Update",
		HTTPMethod:  "PATCH",
		Path:        "/v0.1/checkouts/{checkout_id}",
		Summary:     "Update a checkout",
		Description: "Updates an identified checkout resource.",
		Parameters: []Parameter{
			{Name: "checkout_id", Location: "path", Description: "Unique identifier of the checkout resource.", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "CheckoutUpdateRequest", Required: true},
	},
	{
		ID:          "CreateCustomer",
		Client:      "Customers",
		SDKMethod:   "Create",
		HTTPMethod:  "POST",
		Path:        "/v0.1/customers",
		Summary:     "Create a customer",
		Description: "Creates a new saved customer resource which you can later manipulate and save payment instruments to.",
		RequestBody: &RequestBody{Schema: "Customer", Required: true},
	},
	{
		ID:          "DeactivatePaymentInstrument",
		Client:      "Customers",
		SDKMethod:   "DeactivatePaymentInstrument",
		HTTPMethod:  "DELETE",
		Path:        "/v0.1/customers/{customer_id}/payment-instruments/{token}",
		Summary:     "Deactivate a payment instrument",
		Description: "Deactivates an identified card payment instrument resource for a customer.",
		Parameters: []Parameter{
			{Name: "customer_id", Location: "path", Description: "Unique identifier of the saved customer resource.", Type: "string", Format: "", Required: true},
			{Name: "token", Location: "path", Description: "Unique token identifying the card saved as a payment instrument resource.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "GetCustomer",
		Client:      "Customers",
		SDKMethod:   "Get",
		HTTPMethod:  "GET",
		Path:        "/v0.1/customers/{customer_id}",
		Summary:     "Retrieve a customer",
		Description: "Retrieves an identified saved customer resource through the unique `customer_id` parameter, generated upon customer creation.",
		Parameters: []Parameter{
			{Name: "customer_id", Location: "path", Description: "Unique identifier of the saved customer resource.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "ListPaymentInstruments",
		Client:      "Customers",
		SDKMethod:   "ListPaymentInstruments",
		HTTPMethod:  "GET",
		Path:        "/v0.1/customers/{customer_id}/payment-instruments",
		Summary:     "List payment instruments",
		Description: "Lists all payment instrument resources that are saved for an identified customer.",
		Parameters: []Parameter{
			{Name: "customer_id", Location: "path", Description: "Unique identifier of the saved customer resource.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "UpdateCustomer",
		Client:      "Customers",
		SDKMethod:   "Update",
		HTTPMethod:  "PUT",
		Path:        "/v0.1/customers/{customer_id}",
		Summary:     "Update a customer",
		Description: "Updates an identified saved customer resource's personal details.\n\nThe request only overwrites the parameters included in the request, all other parameters will remain with their initially assigned values.",
		Parameters: []Parameter{
			{Name: "customer_id", Location: "path", Description: "Unique identifier of the saved customer resource.", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "object", Required: true},
	},
	{
		ID:          "CreateMerchantMember",
		Client:      "Members",
		SDKMethod:   "Create",
		HTTPMethod:  "POST",
		Path:        "/v0.1/merchants/{merchant_code}/members",
		Summary:     "Create a member",
		Description: "Create a merchant member.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "object", Required: true},
	},
	{
		ID:          "DeleteMerchantMember",
		Client:      "Members",
		SDKMethod:   "Delete",
		HTTPMethod:  "DELETE",
		Path:        "/v0.1/merchants/{merchant_code}/members/{member_id}",
		Summary:     "Delete a member",
		Description: "Deletes a merchant member.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "member_id", Location: "path", Description: "The ID of the member to retrieve.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "GetMerchantMember",
		Client:      "Members",
		SDKMethod:   "Get",
		HTTPMethod:  "GET",
		Path:        "/v0.1/merchants/{merchant_code}/members/{member_id}",
		Summary:     "Retrieve a member",
		Description: "Retrieve a merchant member.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "member_id", Location: "path", Description: "The ID of the member to retrieve.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "ListMerchantMembers",
		Client:      "Members",
		SDKMethod:   "List",
		HTTPMethod:  "GET",
		Path:        "/v0.1/merchants/{merchant_code}/members",
		Summary:     "List members",
		Description: "Lists merchant members.",
		Parameters: []Parameter{
			{Name: "offset", Location: "query", Description: "Offset of the first member to return.", Type: "integer", Format: "", Required: false},
			{Name: "limit", Location: "query", Description: "Maximum number of members to return.", Type: "integer", Format: "", Required: false},
			{Name: "scroll", Location: "query", Description: "Indicates to skip count query.", Type: "boolean", Format: "", Required: false},
			{Name: "email", Location: "query", Description: "Filter the returned members by email address prefix.", Type: "string", Format: "", Required: false},
			{Name: "user.id", Location: "query", Description: "Search for a member by user id.", Type: "string", Format: "uuid", Required: false},
			{Name: "status", Location: "query", Description: "Filter the returned members by the membership status.", Type: "MembershipStatus", Format: "", Required: false},
			{Name: "roles", Location: "query", Description: "Filter the returned members by role.", Type: "array", Format: "", Required: false},
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "UpdateMerchantMember",
		Client:      "Members",
		SDKMethod:   "Update",
		HTTPMethod:  "PUT",
		Path:        "/v0.1/merchants/{merchant_code}/members/{member_id}",
		Summary:     "Update a member",
		Description: "Update the merchant member.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "member_id", Location: "path", Description: "The ID of the member to retrieve.", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "object", Required: true},
	},
	{
		ID:          "ListMemberships",
		Client:      "Memberships",
		SDKMethod:   "List",
		HTTPMethod:  "GET",
		Path:        "/v0.1/memberships",
		Summary:     "List memberships",
		Description: "List memberships of the current user.",
		Parameters: []Parameter{
			{Name: "offset", Location: "query", Description: "Offset of the first member to return.", Type: "integer", Format: "", Required: false},
			{Name: "limit", Location: "query", Description: "Maximum number of members to return.", Type: "integer", Format: "", Required: false},
			{Name: "kind", Location: "query", Description: "Filter memberships by resource kind.", Type: "ResourceType", Format: "", Required: false},
			{Name: "status", Location: "query", Description: "Filter the returned memberships by the membership status.", Type: "MembershipStatus", Format: "", Required: false},
			{Name: "resource.type", Location: "query", Description: "Filter memberships by resource kind.", Type: "ResourceType", Format: "", Required: false},
			{Name: "resource.attributes.sandbox", Location: "query", Description: "Filter memberships by the sandbox status of the resource the membership is in.", Type: "boolean", Format: "", Required: false},
			{Name: "resource.name", Location: "query", Description: "Filter memberships by the name of the resource the membership is in.", Type: "string", Format: "", Required: false},
			{Name: "resource.parent.id", Location: "query", Description: "Filter memberships by the parent of the resource the membership is in.\nWhen filtering by parent both `resource.parent.id` and `resource.parent.type` must be present. Pass explicit null to filter for resources without a parent.", Type: "string", Format: "", Required: false},
			{Name: "resource.parent.type", Location: "query", Description: "Filter memberships by the parent of the resource the membership is in.\nWhen filtering by parent both `resource.parent.id` and `resource.parent.type` must be present. Pass explicit null to filter for resources without a parent.", Type: "", Format: "", Required: false},
			{Name: "roles", Location: "query", Description: "Filter the returned memberships by role.", Type: "array", Format: "", Required: false},
		},
	},
	{
		ID:          "GetMerchant",
		Client:      "Merchants",
		SDKMethod:   "Get",
		HTTPMethod:  "GET",
		Path:        "/v1/merchants/{merchant_code}",
		Summary:     "Get Merchant",
		Description: "Returns a Merchant for a valid Merchant code.",
		Parameters: []Parameter{
			{Name: "version", Location: "query", Description: "The version of the resource. At the moment, the only supported value is `latest`. When provided and the requested resource's `change_status` is pending, the resource will be returned with all pending changes applied. When no changes are pending the resource is returned as is. The `change_status` in the response body will reflect the current state of the resource.", Type: "string", Format: "", Required: false},
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "GetPerson",
		Client:      "Merchants",
		SDKMethod:   "GetPerson",
		HTTPMethod:  "GET",
		Path:        "/v1/merchants/{merchant_code}/persons/{person_id}",
		Summary:     "Get Person",
		Description: "Returns a single Person related to a Merchant.",
		Parameters: []Parameter{
			{Name: "version", Location: "query", Description: "The version of the resource. At the moment, the only supported value is `latest`. When provided and the requested resource's `change_status` is pending, the resource will be returned with all pending changes applied. When no changes are pending the resource is returned as is. The `change_status` in the response body will reflect the current state of the resource.", Type: "string", Format: "", Required: false},
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "person_id", Location: "path", Description: "Person ID", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "ListPersons",
		Client:      "Merchants",
		SDKMethod:   "ListPersons",
		HTTPMethod:  "GET",
		Path:        "/v1/merchants/{merchant_code}/persons",
		Summary:     "List Persons",
		Description: "Returns the Persons related to a Merchant.",
		Parameters: []Parameter{
			{Name: "version", Location: "query", Description: "The version of the resource. At the moment, the only supported value is `latest`. When provided and the requested resource's `change_status` is pending, the resource will be returned with all pending changes applied. When no changes are pending the resource is returned as is. The `change_status` in the response body will reflect the current state of the resource.", Type: "string", Format: "", Required: false},
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "ListPayoutsV1",
		Client:      "Payouts",
		SDKMethod:   "List",
		HTTPMethod:  "GET",
		Path:        "/v1.0/merchants/{merchant_code}/payouts",
		Summary:     "List payouts",
		Description: "Lists payout and payout-deduction records for the specified merchant account within the requested date range.\n\nThe response can include:\n- regular payouts (`type = PAYOUT`)\n- deduction records for refunds, chargebacks, direct debit returns, or balance adjustments\n\nResults are sorted by payout date in the requested `order`.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "start_date", Location: "query", Description: "Start date of the payout period filter, inclusive, in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) `date` format (`YYYY-MM-DD`).", Type: "string", Format: "date", Required: true},
			{Name: "end_date", Location: "query", Description: "End date of the payout period filter, inclusive, in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) `date` format (`YYYY-MM-DD`). Must be greater than or equal to `start_date`.", Type: "string", Format: "date", Required: true},
			{Name: "format", Location: "query", Description: "Response format for the payout list.", Type: "string", Format: "", Required: false},
			{Name: "limit", Location: "query", Description: "Maximum number of payout records to return.", Type: "integer", Format: "", Required: false},
			{Name: "order", Location: "query", Description: "Sort direction for the returned payouts.", Type: "string", Format: "", Required: false},
		},
	},
	{
		ID:          "CreateReader",
		Client:      "Readers",
		SDKMethod:   "Create",
		HTTPMethod:  "POST",
		Path:        "/v0.1/merchants/{merchant_code}/readers",
		Summary:     "Create a Reader",
		Description: "Create a new Reader for the merchant account.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "object", Required: true},
	},
	{
		ID:          "CreateReaderCheckout",
		Client:      "Readers",
		SDKMethod:   "CreateCheckout",
		HTTPMethod:  "POST",
		Path:        "/v0.1/merchants/{merchant_code}/readers/{reader_id}/checkout",
		Summary:     "Create a Reader Checkout",
		Description: "Creates a Checkout for a Reader.\n\nThis process is asynchronous and the actual transaction may take some time to be started on the device.\n\n\nThere are some caveats when using this endpoint:\n* The target device must be online, otherwise checkout won't be accepted\n* After the checkout is accepted, the system has 60 seconds to start the payment on the target device. During this time, any other checkout for the same device will be rejected.\n\n\n**Note**: If the target device is a Solo, it must be in version 3.3.24.3 or higher.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Merchant Code", Type: "string", Format: "", Required: true},
			{Name: "reader_id", Location: "path", Description: "The unique identifier of the Reader", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "CreateReaderCheckoutRequest", Required: true},
	},
	{
		ID:          "CreateGoReaderCheckout",
		Client:      "Readers",
		SDKMethod:   "CreateGoCheckout",
		HTTPMethod:  "POST",
		Path:        "/v0/merchants/{merchant_code}/readers/{reader_id}/go-checkout",
		Summary:     "Create a Go Reader Payment",
		Description: "Initiates a payment on the SumUp Go terminal identified by the reader ID.\n\nUse `client_transaction_id` as an idempotency key: retrying the request with the same value returns the result of the original payment instead of creating a duplicate.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "reader_id", Location: "path", Description: "The unique identifier of the reader.", Type: "ReaderID", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "ReaderPaymentRequestParams", Required: true},
	},
	{
		ID:          "DeleteReader",
		Client:      "Readers",
		SDKMethod:   "Delete",
		HTTPMethod:  "DELETE",
		Path:        "/v0.1/merchants/{merchant_code}/readers/{reader_id}",
		Summary:     "Delete a reader",
		Description: "Delete a reader.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "reader_id", Location: "path", Description: "The unique identifier of the reader.", Type: "ReaderID", Format: "", Required: true},
		},
	},
	{
		ID:          "GetReader",
		Client:      "Readers",
		SDKMethod:   "Get",
		HTTPMethod:  "GET",
		Path:        "/v0.1/merchants/{merchant_code}/readers/{reader_id}",
		Summary:     "Retrieve a Reader",
		Description: "Retrieve a Reader.",
		Parameters: []Parameter{
			{Name: "If-Modified-Since", Location: "header", Description: "Return the reader only if it has been modified after the specified timestamp given in the headers.\n\nTimestamps are accepted in the following formats:\n\n - HTTP Standard: [IMF format (RFC 5322)](https://www.rfc-editor.org/rfc/rfc5322#section-3.3), sometimes also referred to as [RFC 7231](https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1).\n - RFC 3339: Used for timestamps in JSON payloads on this API.", Type: "string", Format: "", Required: false},
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "reader_id", Location: "path", Description: "The unique identifier of the reader.", Type: "ReaderID", Format: "", Required: true},
		},
	},
	{
		ID:          "GetReaderCheckout",
		Client:      "Readers",
		SDKMethod:   "GetCheckout",
		HTTPMethod:  "GET",
		Path:        "/v0.1/merchants/{merchant_code}/readers/{reader_id}/checkout/{checkout_id}",
		Summary:     "Get a Reader Checkout",
		Description: "Get a Checkout for a Reader.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Merchant Code", Type: "string", Format: "", Required: true},
			{Name: "reader_id", Location: "path", Description: "The unique identifier of the Reader", Type: "string", Format: "", Required: true},
			{Name: "checkout_id", Location: "path", Description: "The unique identifier of the Checkout", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "GetReaderStatus",
		Client:      "Readers",
		SDKMethod:   "GetStatus",
		HTTPMethod:  "GET",
		Path:        "/v0.1/merchants/{merchant_code}/readers/{reader_id}/status",
		Summary:     "Get a Reader Status",
		Description: "Provides the last known status for a Reader.\n\nThis endpoint allows you to retrieve updates from the connected card reader, including the current screen being displayed during the payment process and the device status (battery level, connectivity, and update state).\n\nSupported States\n\n* `IDLE` – Reader ready for next transaction\n* `SELECTING_TIP` – Waiting for tip input\n* `WAITING_FOR_CARD` – Awaiting card insert/tap\n* `WAITING_FOR_PIN` – Waiting for PIN entry\n* `WAITING_FOR_SIGNATURE` – Waiting for customer signature\n* `UPDATING_FIRMWARE` – Firmware update in progress\n\nDevice Status\n\n* `ONLINE` – Device connected and operational\n* `OFFLINE` – Device disconnected (last state persisted)\n\n**Note**: If the target device is a Solo, it must be in version 3.3.39.0 or higher.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Merchant Code", Type: "string", Format: "", Required: true},
			{Name: "reader_id", Location: "path", Description: "The unique identifier of the Reader", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "ListReaders",
		Client:      "Readers",
		SDKMethod:   "List",
		HTTPMethod:  "GET",
		Path:        "/v0.1/merchants/{merchant_code}/readers",
		Summary:     "List Readers",
		Description: "List all readers of the merchant.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "CreateReaderTerminate",
		Client:      "Readers",
		SDKMethod:   "TerminateCheckout",
		HTTPMethod:  "POST",
		Path:        "/v0.1/merchants/{merchant_code}/readers/{reader_id}/terminate",
		Summary:     "Terminate a Reader Checkout",
		Description: "Terminate a Reader Checkout stops the current transaction on the target device.\n\nThis process is asynchronous and the actual termination may take some time to be performed on the device.\n\n\nThere are some caveats when using this endpoint:\n* The target device must be online, otherwise terminate won't be accepted\n* The action will succeed only if the device is waiting for cardholder action: e.g: waiting for card, waiting for PIN, etc.\n* There is no confirmation of the termination.\n\nIf a transaction is successfully terminated and `return_url` was provided on Checkout, the transaction status will be sent as `failed` to the provided URL.\n\n\n**Note**: If the target device is a Solo, it must be in version 3.3.28.0 or higher.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Merchant Code", Type: "string", Format: "", Required: true},
			{Name: "reader_id", Location: "path", Description: "The unique identifier of the Reader", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "", Required: false},
	},
	{
		ID:          "UpdateReader",
		Client:      "Readers",
		SDKMethod:   "Update",
		HTTPMethod:  "PATCH",
		Path:        "/v0.1/merchants/{merchant_code}/readers/{reader_id}",
		Summary:     "Update a Reader",
		Description: "Update a Reader.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "reader_id", Location: "path", Description: "The unique identifier of the reader.", Type: "ReaderID", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "object", Required: true},
	},
	{
		ID:          "GetReceipt",
		Client:      "Receipts",
		SDKMethod:   "Get",
		HTTPMethod:  "GET",
		Path:        "/v1.1/receipts/{transaction_id}",
		Summary:     "Retrieve receipt details",
		Description: "Retrieves receipt specific data for a transaction.",
		Parameters: []Parameter{
			{Name: "transaction_id", Location: "path", Description: "SumUp unique transaction ID or transaction code, e.g. TS7HDYLSKD.", Type: "string", Format: "", Required: true},
			{Name: "mid", Location: "query", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "tx_event_id", Location: "query", Description: "Unique identifier of the transaction event to include on the receipt.", Type: "integer", Format: "", Required: false},
		},
	},
	{
		ID:          "CreateMerchantRole",
		Client:      "Roles",
		SDKMethod:   "Create",
		HTTPMethod:  "POST",
		Path:        "/v0.1/merchants/{merchant_code}/roles",
		Summary:     "Create a role",
		Description: "Create a custom role for the merchant. Roles are defined by the set of permissions that they grant to the members that they are assigned to.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "object", Required: true},
	},
	{
		ID:          "DeleteMerchantRole",
		Client:      "Roles",
		SDKMethod:   "Delete",
		HTTPMethod:  "DELETE",
		Path:        "/v0.1/merchants/{merchant_code}/roles/{role_id}",
		Summary:     "Delete a role",
		Description: "Delete a custom role.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "role_id", Location: "path", Description: "The ID of the role to retrieve.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "GetMerchantRole",
		Client:      "Roles",
		SDKMethod:   "Get",
		HTTPMethod:  "GET",
		Path:        "/v0.1/merchants/{merchant_code}/roles/{role_id}",
		Summary:     "Retrieve a role",
		Description: "Retrieve a custom role by ID.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "role_id", Location: "path", Description: "The ID of the role to retrieve.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "ListMerchantRoles",
		Client:      "Roles",
		SDKMethod:   "List",
		HTTPMethod:  "GET",
		Path:        "/v0.1/merchants/{merchant_code}/roles",
		Summary:     "List roles",
		Description: "List merchant's custom roles.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
		},
	},
	{
		ID:          "UpdateMerchantRole",
		Client:      "Roles",
		SDKMethod:   "Update",
		HTTPMethod:  "PATCH",
		Path:        "/v0.1/merchants/{merchant_code}/roles/{role_id}",
		Summary:     "Update a role",
		Description: "Update a custom role.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "role_id", Location: "path", Description: "The ID of the role to retrieve.", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "object", Required: true},
	},
	{
		ID:          "GetTransactionV2.1",
		Client:      "Transactions",
		SDKMethod:   "Get",
		HTTPMethod:  "GET",
		Path:        "/v2.1/merchants/{merchant_code}/transactions",
		Summary:     "Retrieve a transaction",
		Description: "Retrieves the full details of an identified transaction. The transaction resource is identified by a query parameter and *one* of following parameters is required:\n- `id`\n- `transaction_code`\n- `foreign_transaction_id`\n- `client_transaction_id`",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "id", Location: "query", Description: "Retrieves the transaction resource with the specified transaction ID (the `id` parameter in the transaction resource).", Type: "string", Format: "", Required: false},
			{Name: "transaction_code", Location: "query", Description: "Retrieves the transaction resource with the specified transaction code.", Type: "string", Format: "", Required: false},
			{Name: "foreign_transaction_id", Location: "query", Description: "External transaction identifier supplied by the client.", Type: "string", Format: "", Required: false},
			{Name: "client_transaction_id", Location: "query", Description: "Client-supplied identifier of the transaction.", Type: "string", Format: "", Required: false},
		},
	},
	{
		ID:          "ListTransactionsV2.1",
		Client:      "Transactions",
		SDKMethod:   "List",
		HTTPMethod:  "GET",
		Path:        "/v2.1/merchants/{merchant_code}/transactions/history",
		Summary:     "List transactions",
		Description: "Lists detailed history of all transactions associated with the merchant profile.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "transaction_code", Location: "query", Description: "Retrieves the transaction resource with the specified transaction code.", Type: "string", Format: "", Required: false},
			{Name: "order", Location: "query", Description: "Specifies the order in which the returned results are displayed.", Type: "string", Format: "", Required: false},
			{Name: "limit", Location: "query", Description: "Specifies the maximum number of results per page. Value must be a positive integer and if not specified, will return 10 results.", Type: "integer", Format: "", Required: false},
			{Name: "users[]", Location: "query", Description: "Filters the returned results by user email.", Type: "array", Format: "", Required: false},
			{Name: "statuses[]", Location: "query", Description: "Filters the returned results by the specified list of final statuses of the transactions.", Type: "array", Format: "", Required: false},
			{Name: "payment_types[]", Location: "query", Description: "Filters the returned results by the specified list of payment types used for the transactions.", Type: "array", Format: "", Required: false},
			{Name: "entry_modes[]", Location: "query", Description: "Filters the returned results by the specified list of entry modes.", Type: "array", Format: "", Required: false},
			{Name: "types[]", Location: "query", Description: "Filters the returned results by the specified list of transaction types.", Type: "array", Format: "", Required: false},
			{Name: "changes_since", Location: "query", Description: "Filters the results by the latest modification time of resources and returns only transactions that are modified *at or after* the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).", Type: "string", Format: "date-time", Required: false},
			{Name: "newest_time", Location: "query", Description: "Filters the results by the creation time of resources and returns only transactions that are created *before* the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).", Type: "string", Format: "date-time", Required: false},
			{Name: "newest_ref", Location: "query", Description: "Filters the results by the reference ID of transaction events and returns only transactions with events whose IDs are *smaller* than the specified value. This parameters supersedes the `newest_time` parameter (if both are provided in the request).", Type: "string", Format: "", Required: false},
			{Name: "oldest_time", Location: "query", Description: "Filters the results by the creation time of resources and returns only transactions that are created *at or after* the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).", Type: "string", Format: "date-time", Required: false},
			{Name: "oldest_ref", Location: "query", Description: "Filters the results by the reference ID of transaction events and returns only transactions with events whose IDs are *greater* than the specified value. This parameters supersedes the `oldest_time` parameter (if both are provided in the request).", Type: "string", Format: "", Required: false},
		},
	},
	{
		ID:          "RefundTransaction",
		Client:      "Transactions",
		SDKMethod:   "Refund",
		HTTPMethod:  "POST",
		Path:        "/v1.0/merchants/{merchant_code}/payments/{transaction_id}/refunds",
		Summary:     "Refund a transaction",
		Description: "Refunds an identified transaction either in full or partially.",
		Parameters: []Parameter{
			{Name: "merchant_code", Location: "path", Description: "Short unique identifier for the merchant.", Type: "string", Format: "", Required: true},
			{Name: "transaction_id", Location: "path", Description: "Unique identifier of the transaction.", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "object", Required: false},
	},
	{
		ID:          "ProcessCheckout",
		Client:      "Checkouts",
		SDKMethod:   "Process",
		HTTPMethod:  "PUT",
		Path:        "/v0.1/checkouts/{checkout_id}",
		Summary:     "Process a checkout",
		Description: ":::caution[PCI DSS compliance required]\nWhen you submit raw card details directly to the Checkout API, your systems store, process, or transmit cardholder data and are therefore subject to applicable [PCI DSS requirements](https://www.pcisecuritystandards.org/document_library/). You should only use this integration if your environment is appropriately PCI DSS compliant.\n:::\n\nProcessing 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.\n\nFollow this request with `Retrieve a checkout` to confirm its status.",
		Unsupported: true,
		Parameters: []Parameter{
			{Name: "checkout_id", Location: "path", Description: "Unique identifier of the checkout resource.", Type: "string", Format: "", Required: true},
		},
		RequestBody: &RequestBody{Schema: "ProcessCheckout", Required: true},
	},
}

Functions

func Bind

func Bind(operationID string, command *cli.Command) *cli.Command

Bind records which OpenAPI operation a CLI command exposes and returns the command so the binding can live next to the command definition.

func OperationID

func OperationID(command *cli.Command) (string, bool)

OperationID returns the OpenAPI operation ID bound to a CLI command.

Types

type Operation

type Operation struct {
	ID          string
	Client      string
	SDKMethod   string
	HTTPMethod  string
	Path        string
	Summary     string
	Description string
	Unsupported bool
	Parameters  []Parameter
	RequestBody *RequestBody
}

Operation describes one SDK method generated from an OpenAPI operation.

func Lookup

func Lookup(operationID string) (Operation, bool)

Lookup returns the generated operation with the given OpenAPI operation ID.

type Parameter

type Parameter struct {
	Name        string
	Location    string
	Description string
	Type        string
	Format      string
	Required    bool
}

Parameter describes an OpenAPI operation parameter.

type RequestBody

type RequestBody struct {
	Schema   string
	Required bool
}

RequestBody describes the JSON request body accepted by an operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL