Follow the steps below to access the Cybersouce authorisation details via the Submarine Payments API.
Prerequisites
Step 1
Contact Cybersource to enable the Token Management Service for your account.
The Token Management Service allows to generate the payment instrument tokens during the authorisation call and is required to use the Submarine Payments API.
Step 2
Provide the Cybersource credentials during the onboarding. More details can be found here:
Submarine Payments API
GraphQL endpoint
All queries are executed by sending POST HTTP requests to:
https://submarine-payments.submarineplatform.com/graphqlAuthentication
Every request to the API requires a valid access token.
The access token is created during onboarding and can be found in the Submarine API access section.
The access token should be presented in the Authorization header as a bearer token.
The Shopify domain needs to be provided in the X-Shopify-Domain header.
Provide the following headers with each request:
Authorization: Bearer <insert your access token here>
X-Shopify-Domain: your-shopify-domain.myshopify.com
Accept: application/json
Content-Type: application/jsonpaymentSession API
The paymentSession GraphQL query allows to retrieve the Cybersource authorisation details.
Required ID
An ID is required to retrieve the payment session information via the paymentSession GraphQL endpoint.
The ID needs to be provided with every request as a GraphQL variable. Here’s an example of the ID:
gid://external/PaymentSession/rOeHMOmaTosfqpW9TBc9o7aelThe ID can be found in the Shopify order transaction data as a payment_id.
The ID is then referenced in Cybersource UI as a Merchant Reference Number.
Example request
Example response
Authorisation details
Tokens
Note: All tokens are redacted by default. After completing the onboarding steps, the Submarine Payments team will update the default configuration for you.
Payment instrument token
A payment instrument token can be used to make calls to Cybersource directly. Use the following query to access the token:
query paymentSession($id: SharedGlobalID!) {
paymentSession(id: $id) {
vaultedPaymentMethod {
paymentInstrument {
token
}
}
}
}{
"data": {
"paymentSession": {
"vaultedPaymentMethod": {
"paymentInstrument": {
"token": "149E5D0A0F49F946E063AF598E0A9E88"
}
}
}
}
}