Radial Integration | 2016

Payments, Tax & Fraud > Asynchronous API Operations > Payment Settlement

Payment Settlement

Overview

A PaymentSettlementRequest message must be submitted to capture funds from the customer's form of payment. The PaymentSettlementStatus message is returned to inform the caller of the final state of the settlement. In some cases, more than one PaymentSettlementStatus message is sent for a given settlement (for example, a credit card charge back after a successful settlement).

An alternate request format, PaymentSettlementRequestList, groups several events together in a single message, and is intended for clients using the Webhooks Implementation for Asynchronous Messages. If you are using the Webhooks implemention, see Payment Settlement Status List Event, below.

URI Description

Action URI Template URI Example Non-URI Request Response
POST /v[M.m]/stores/[StoreId]/
payments/settlement/
create/[TenderType].[format]
/v1.0/stores/ABCXYZ/
payments/settlement/
create/VC.xml
XML 200 + XML response

Request Examples

The request is a PaymentSettlementRequest message.

With a Payment Account Number

<?xml version="1.0" encoding="UTF-8"?>
<PaymentSettlementRequest requestId="123" xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
   <PaymentContext>
      <OrderId>12345</OrderId>
      <PaymentAccountUniqueId isToken="true">4111110PASeK1111</PaymentAccountUniqueId>
   </PaymentContext>
   <InvoiceId>invoice-id</InvoiceId>
   <Amount currencyCode="USD">100.00</Amount>
   <TaxAmount currencyCode="USD">6.00</TaxAmount>
   <SettlementType>Debit</SettlementType>
   <ClientContext>987654321</ClientContext>
   <FinalDebit>true</FinalDebit>
</PaymentSettlementRequest>

Without a Payment Account Number (For Example, PayPal)

<?xml version="1.0" encoding="UTF-8"?>
<PaymentSettlementRequest requestId="123" xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
   <PaymentContextBase>
      <OrderId>12345</OrderId>
   </PaymentContextBase>
   <InvoiceId>invoice-id</InvoiceId>
   <Amount currencyCode="USD">100.00</Amount>
   <TaxAmount currencyCode="USD">6.00</TaxAmount>
   <SettlementType>Debit</SettlementType>
   <ClientContext>987654321</ClientContext>
   <FinalDebit>true</FinalDebit>
</PaymentSettlementRequest>

Request Elements

Element Required Description Type Restriction
PaymentSettlementRequest/
@requestId
Yes Attribute that indicates the unique ID for this request String Max 40 characters
PaymentContext Choice of PaymentContext (when a PaymentAccountUniqueId is available) or PaymentContextBase (when a PaymentAccountUniqueId is not available) Sequence of OrderId, PaymentAccountUniqueId ComplexType  
PaymentContext/
OrderId
Yes (when PaymentContext is present) Order ID String Max 20 characters
PaymentContext/
PaymentAccountUniqueId
Yes (when PaymentContext is present) Tokenized payment account number (for example, credit card number) String Max 22 characters
PaymentContext/
PaymentAccountUniqueId
@isToken
Yes (when PaymentContext is present) Attribute that indicates whether the payment account number is tokenized String true
PaymentContextBase Choice of PaymentContext (when a PaymentAccountUniqueId is available) or PaymentContextBase (when a PaymentAccountUniqueId is not available) Sequence of OrderId ComplexType  
PaymentContextBase/
OrderId
Yes (when PaymentContextBase is present) Order ID String Max 20 characters
InvoiceId Yes Invoice ID for the settlement.

Although marked as optional in the the schema, this element needs to be passed at all times in order to facilitate with reporting reconciliation.

String Max 20 characters
Amount Yes Amount to be debited (when SettlementType is DEBIT) or credited (when SettlementType is CREDIT) String

Positive decimal, up to two decimal places (for example, 4.75)

Amount/
@currencyCode
Yes Attribute that indicates the type of currency used for the amount String 3-character ISO 4217 code (for example, USD, CAD, EUR). See http://en.wikipedia.org/
wiki/ISO_4217.
TaxAmount Yes Amount of the tax String

Positive decimal, up to two decimal places (for example, 4.75)

TaxAmount/
@currencyCode
Yes Attribute that indicates the type of currency used for the tax String 3-character ISO 4217 code (for example, USD, CAD, EUR). See http://en.wikipedia.org/
wiki/ISO_4217.
SettlementType Yes Type of settlement String Debit or Credit
AuthorizationResponseCode No Authorization code returned by the payment processor upon a successful credit card authorization. Only needed for verbal authorizations. String
AuthorizationDate No Date of credit card authorization. Only needed for verbal authorizations. DateTime
ExpirationDate No Expiration date on the credit card. Only needed for verbal authorizations. YearMonth
ClientContext No ID for the settlement. Echoed back in the PaymentSettlementStatus message for correlation. String
FinalDebit No Flag that indicates whether this settlement is the final debit for an order that has multiple settlements. Although optional, this element should be provided for most integrations. Boolean true or false
BillingAddress No Sequence of Person, Address ComplexType
BillingAddress/
Person

Yes

Sequence of Honorific, LastName, MiddleName, FirstName ComplexType
BillingAddress/
Person/
Honorific
No Person's title(for example, Dr., Mr., Ms.) String Max 10 characters
BillingAddress/
Person/
LastName

Yes

Person's last name String Max 64 characters
BillingAddress/
Person/
MiddleName
No Person's middle name String Max 40 characters
BillingAddress/
Person/
FirstName
No Person's first name String Max 64 characters
BillingAddress/
Address

Yes

Sequence of Line1, Line2, Line3, Line4, City, MainDivision, CountryCode, PostalCode ComplexType
BillingAddress/
Address/
Line1

Yes

Line 1 of the address String Max 70 characters
BillingAddress/
Address/
Line2
No Line 2 of the address String Max 70 characters
BillingAddress/
Address/
Line3
No Line 3 of the address String Max 70 characters
BillingAddress/
Address/
Line4
No Line 4 of the address String Max characters
BillingAddress/
Address/
City

Yes

City String Max 40 characters
BillingAddress/
Address/
MainDivision
No State, province, or county String Max 35 characters
BillingAddress/
Address/
CountryCode

Yes

ISO 3166 alpha 2 country code String Max 40 characters
BillingAddress/
Address/
PostalCode
No Postal code String Max 15 characters
InvoiceData No Sequence of VATData, LineItems, CustomAttributes ComplexType
InvoiceData/
VATData
No Sequence of VATInvoiceNumber, VATInvoiceDate, OriginalVATInvoiceDetails, VATRateInfo, BalanceClearedAmount, InvoicePresentment. Only used for open invoice tender. ComplexType
InvoiceData/
VATData/
VATInvoiceNumber

Yes

VAT invoice number associated with the order String 20 characters; no white space
InvoiceData/
VATData/
VATInvoiceDate

Yes

Effective date of the receivable list. Date when the VAT invoice was generated. DateTime
InvoiceData/
VATData/
OriginalVATInvoiceDetails
No Sequence of OriginalVATInvoice. Only used for open invoice CREDIT transaction. ComplexType
InvoiceData/
VATData/
OriginalVATInvoiceDetails/
OriginalVATInvoice

Yes, unbounded repetitions

Sequence of OriginalVATInvoiceNumber, OriginalVATInvoiceDate ComplexType
InvoiceData/
VATData/
OriginalVATInvoiceDetails/
OriginalVATInvoice/
OriginalVATInvoiceNumber
Yes Original VAT invoice number for the order being credited. Only used for open invoice CREDIT transaction. String 20 characters; no white space
InvoiceData/
VATData/
OriginalVATInvoiceDetails/
OriginalVATInvoice/
OriginalVATInvoiceDate
Yes Original reference date for the order being credited. Only used for open invoice CREDIT transaction. DateTime
InvoiceData/
VATData/
VATRateInfo
Yes Sequence of VAT ComplexType
InvoiceData/
VATData/
VATRateInfo/
VAT
Yes, unbounded repetitions Sequence of VATRegistrationId, Amount ComplexType
InvoiceData/
VATData/
VATRateInfo/
VAT/
@rate
Yes Attribute that indicates the VAT rate Decimal
InvoiceData/
VATData/
VATRateInfo/
VAT/
VATRegistrationId
No Tax ID used for value-added tax purposes String
InvoiceData/
VATData/
VATRateInfo/
VAT/
Amount
Yes Amount of the VAT Decimal

Positive decimal, up to two decimal places (for example, 4.75)

InvoiceData/
VATData/
VATRateInfo/
VAT/
Amount/
@currencyCode
Yes Attribute that indicates the type of currency used for VAT String 3-character ISO 4217 code (for example, USD, CAD, EUR). See http://en.wikipedia.org/
wiki/ISO_4217.
InvoiceData/
VATData/
BalanceClearedAmount
No Sum of payments or credits deducted from the total gross amount, if any. This can be any amount paid or credited through a non open invoice payment method. Decimal

Positive decimal, up to two decimal places (for example, 4.75)

InvoiceData/
VATData/
BalanceClearedAmount/
@currencyCode
Yes Attribute that indicates the type of currency for the credited VAT String 3-character ISO 4217 code (for example, USD, CAD, EUR). See http://en.wikipedia.org/
wiki/ISO_4217.
InvoiceData/
VATData/
InvoicePresentment
Yes Method for dispatching the invoice to the recipient String

letter
email
web

InvoiceData/
LineItems
No Sequence of LineItem ComplexType
InvoiceData/
LineItems/
LineItem
Yes, unbounded repetitions Sequence of ItemId, ClientItemId, Quantity, ItemShortDescription, VATInclusiveUnitPrice, VATRateInfo, CustomAttributes ComplexType
InvoiceData/
LineItems/
LineItem/
@lidCode
No Attribute that indicates the line item description code String 4 to 7 characters
InvoiceData/
LineItems/
LineItem/
@lineId
No Attribute that indicates the unique identifier for the line item String
InvoiceData/
LineItems/
LineItem/
ItemId
Yes Product SKU ID String Max 20 characters
InvoiceData/
LineItems/
LineItem/
ClientItemId
No Vendor/client SKU ID. Only used in loyalty program. String
InvoiceData/
LineItems/
LineItem/
Quantity
Yes Item quantity Decimal
InvoiceData/
LineItems/
LineItem/
ItemShortDescription
Yes Product description String Max 100 characters
InvoiceData/
LineItems/
LineItem/
VATInclusiveUnitPrice
No VAT inclusive price per unit for VAT stores Decimal

Positive decimal, up to two decimal places (for example, 4.75)

InvoiceData/
LineItems/
LineItem/
VATInclusiveUnitPrice/
@currencyCode
Yes Attribute that indicates the type of currency for the unit price String 3-character ISO 4217 code (for example, USD, CAD, EUR). See http://en.wikipedia.org/
wiki/ISO_4217.
InvoiceData/
LineItems/
LineItem/
VATRateInfo
Yes Sequence of VAT ComplexType
InvoiceData/
LineItems/
LineItem/
VATRateInfo/
VAT
Yes, unbounded repetitions Sequence of VATRegistrationId, Amount ComplexType
InvoiceData/
LineItems/
LineItem/
VATRateInfo/
VAT/
@rate
Yes Attribute that indicates the VAT rate Decimal
InvoiceData/
LineItems/
LineItem/
VATRateInfo/
VAT/
VATRegistrationId
No Tax ID used for value-added tax purposes String
InvoiceData/
LineItems/
LineItem/
VATRateInfo/
VAT/
Amount
Yes Currency amount Decimal

Positive decimal, up to two decimal places (for example, 4.75)

InvoiceData/
LineItems/
LineItem/
VATRateInfo/
VAT/
Amount/
@currencyCode
C Attribute that indicates the type of currency used String 3-character ISO 4217 code (for example, USD, CAD, EUR). See http://en.wikipedia.org/
wiki/ISO_4217.
InvoiceData/
LineItems/
LineItem/
CustomAttributes
No Sequence of CustomAttribute ComplexType
InvoiceData/
LineItems/
LineItem/
CustomAttributes/
CustomAttribute
Yes, unbounded repetitions Sequence of Key, Value ComplexType
InvoiceData/
LineItems/
LineItem/
CustomAttributes/
CustomAttribute/
Key
Yes Custom attribute key String
InvoiceData/
LineItems/
LineItem/
CustomAttributes/
CustomAttribute/
Value
Yes Custom attribute value NormalizedString
InvoiceData/
CustomAttributes
No Sequence of CustomAttribute ComplexType
InvoiceData/
CustomAttributes/
CustomAttribute
Yes, unbounded repetitions Sequence of Key, Value ComplexType
InvoiceData/
CustomAttributes/
CustomAttribute/
Key
Yes Custom attribute key String

InvoiceData/
CustomAttributes/

CustomAttribute/
Value

Yes Custom attribute value NormalizedString

HTTP Response

<?xml version="1.0" encoding="UTF-8"?>
<AckReply xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
   <Received/>
</AckReply>

Queue Format

q.Payments.Settlements.Status.<RABBIT_MQ_USERNAME>

Response Examples

The response is a PaymentStatementStatus message.

Successful Debit With a Payment Account Number

<?xml version="1.0" encoding="UTF-8"?>
<PaymentSettlementStatus xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
   <PaymentContext>
      <OrderId>12345</OrderId>
      <PaymentAccountUniqueId isToken="true">4111110PASeK1111</PaymentAccountUniqueId>
   </PaymentContext>
   <TenderType>VC</TenderType>
   <Amount currencyCode="USD">100.00</Amount>
   <SettlementType>Debit</SettlementType>
   <SettlementStatus>S</SettlementStatus>
   <!--Optional:-->
   <ClientContext>987654321</ClientContext>
   <StoreId>ABCXYZ</StoreId>
</PaymentSettlementStatus>

Rejected Refund With a Payment Account Number

<?xml version="1.0" encoding="UTF-8"?>
<PaymentSettlementStatus xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
   <PaymentContext>
      <OrderId>12345</OrderId>
      <PaymentAccountUniqueId isToken="true">4111110PASeK1111</PaymentAccountUniqueId>
   </PaymentContext>
   <TenderType>VC</TenderType>
   <Amount currencyCode="USD">100.00</Amount>
   <SettlementType>Credit</SettlementType>
   <SettlementStatus>R</SettlementStatus>
   <!--Optional:--> 
   <DeclineReason>Insufficient Capture balance for refund request amount</DeclineReason>
   <!--Optional:-->
   <ClientContext>987654321</ClientContext>
   <StoreId>ABCXYZ</StoreId>
</PaymentSettlementStatus>

Successful Debit Without a Payment Account Number

<?xml version="1.0" encoding="UTF-8"?>
<PaymentSettlementStatus xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
   <PaymentContextBase>
      <OrderId>12345</OrderId>
   </PaymentContextBase>
   <TenderType>PY</TenderType>
   <Amount currencyCode="USD">100.00</Amount> 
   <SettlementType>Debit</SettlementType>
   <SettlementStatus>S</SettlementStatus>
   <!--Optional:-->
   <ClientContext>987654321</ClientContext>
   <StoreId>ABCXYZ</StoreId>
</PaymentSettlementStatus>

Response Elements

Element Required Description Type Restriction
PaymentContext Choice of PaymentContext or PaymentContextBase. The same element that was used in the request is returned in the reply. Sequence of OrderId, PaymentAccountUniqueId ComplexType  
PaymentContext/
OrderId
Yes (when PaymentContext is present) Order ID String Max 20 characters
PaymentContext/
PaymentAccountUniqueId
Yes (when PaymentContext is present) Tokenized payment account number (for example, credit card number) String Max 22 characters
PaymentContext/
PaymentAccountUniqueId/
@isToken
Yes (when PaymentContext is present) Attribute that indicates whether the payment account number is tokenized String true
PaymentContextBase Choice of PaymentContext or PaymentContextBase. The same element that was used in the request is returned in the reply. Sequence of OrderId ComplexType  
PaymentContextBase/
OrderId
Yes (when PaymentContextBase is present) Order ID String Max 20 characters
TenderType Yes Tender type identifier String 2 to 4 characters
Amount Yes Settlement amount String

Positive decimal, up to two decimal places (for example, 4.75)

Amount/
@currencyCode
Yes Attribute that indicates the type of currency used for the amount String 3-character ISO 4217 code (for example, USD, CAD, EUR). See http://en.wikipedia.org/
wiki/ISO_4217.
SettlementType Yes Type of settlement String Debit
Credit
SettlementStatus Yes

Status of settlement:

S- successful
R - rejected

String S or R
DeclineReason No Additional details related to a rejected settlement String
ClientContext No If a ClientContext value is provided in the request, the same value is provided in this element. String
StoreId Yes Store identifier String Max 100 characters

Payment Settlement Status List Event

The xml response (mentioned below) contains a list of PaymentSettlementStatus messages all clubbed under one parent element and is available only for clients using webhook. This message cannot be obtained from a queue in RabbitMQ and hence the queue format is not applicable here. In case you want to sign up for these events please contact customer service.

However individual PaymentSettlementStatus message continues to live on RabbitMQ server and can be accessed using the information provided above.

Response Examples

The response is a list of PaymentSettlementStatus messages. Instead of returning single PaymentSettlementStatus message, a list/batch of messsages are getting returned

Successful Debit With a Payment Account Number

<?xml version="1.0" encoding="UTF-8"?>
<PaymentSettlementStatusList xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
    <PaymentSettlementStatus>
        <PaymentContext>
            <OrderId>12345</OrderId>
            <PaymentAccountUniqueId isToken="true">4387751111111111</PaymentAccountUniqueId>
        </PaymentContext>
        <TenderType>VC</TenderType>
        <Amount currencyCode="USD">100.00</Amount>
        <SettlementType>Debit</SettlementType>
        <SettlementStatus>S</SettlementStatus>
        <!--Optional:-->
        <ClientContext>987654321</ClientContext>
        <StoreId>ABCXYZ</StoreId>
    </PaymentSettlementStatus>
    <PaymentSettlementStatus>
        <PaymentContext>
            <OrderId>10001</OrderId>
            <PaymentAccountUniqueId isToken="true">5500000000000004</PaymentAccountUniqueId>
        </PaymentContext>
        <TenderType>MC</TenderType>
        <Amount currencyCode="USD">200.00</Amount>
        <SettlementType>Debit</SettlementType>
        <SettlementStatus>S</SettlementStatus>
        <!--Optional:-->
        <ClientContext>123456789</ClientContext>
        <StoreId>ABC</StoreId>
    </PaymentSettlementStatus>
</PaymentSettlementStatusList>

Rejected Refund With a Payment Account Number

<?xml version="1.0" encoding="UTF-8"?>
<PaymentSettlementStatusList xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
    <PaymentSettlementStatus>
        <PaymentContext>
            <OrderId>12345</OrderId>
            <PaymentAccountUniqueId isToken="true">4000000000001992</PaymentAccountUniqueId>
        </PaymentContext>
        <TenderType>VC</TenderType>
        <Amount currencyCode="USD">100.00</Amount>
        <SettlementType>Credit</SettlementType>
        <SettlementStatus>R</SettlementStatus>
        <!--Optional:-->
        <DeclineReason>Insufficient Capture balance for refund request amount</DeclineReason>
        <!--Optional:-->
        <ClientContext>987654321</ClientContext>
        <StoreId>ABCXYZ</StoreId>
    </PaymentSettlementStatus>
    <PaymentSettlementStatus>
        <PaymentContext>
            <OrderId>100023</OrderId>
            <PaymentAccountUniqueId isToken="true">5200000000000031</PaymentAccountUniqueId>
        </PaymentContext>
        <TenderType>MC</TenderType>
        <Amount currencyCode="USD">500.00</Amount>
        <SettlementType>Credit</SettlementType>
        <SettlementStatus>R</SettlementStatus>
        <!--Optional:-->
        <DeclineReason>Insufficient Capture balance for refund request amount</DeclineReason>
        <!--Optional:-->
        <ClientContext>123456789</ClientContext>
        <StoreId>ABC</StoreId>
    </PaymentSettlementStatus>
</PaymentSettlementStatusList>

Successful Debit Without a Payment Account Number

<?xml version="1.0" encoding="UTF-8"?>
<PaymentSettlementStatusList xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
    <PaymentSettlementStatus>
        <PaymentContextBase>
            <OrderId>12345</OrderId>
        </PaymentContextBase>
        <TenderType>PY</TenderType>
        <Amount currencyCode="USD">100.00</Amount>
        <SettlementType>Debit</SettlementType>
        <SettlementStatus>S</SettlementStatus>
        <!--Optional:-->
        <ClientContext>987654321</ClientContext>
        <StoreId>ABCXYZ</StoreId>
    </PaymentSettlementStatus>
    <PaymentSettlementStatus>
        <PaymentContextBase>
            <OrderId>11111</OrderId>
        </PaymentContextBase>
        <TenderType>PY</TenderType>
        <Amount currencyCode="USD">520.00</Amount>
        <SettlementType>Debit</SettlementType>
        <SettlementStatus>S</SettlementStatus>
        <!--Optional:-->
        <ClientContext>123456789</ClientContext>
        <StoreId>ABC</StoreId>
    </PaymentSettlementStatus>
</PaymentSettlementStatusList>

Response Elements

Element Required Description Type Restriction
PaymentSettlementStatusList A wrapper/parent object for all the PaymentSettlementStatus elements Sequence of PaymentSettlementStatus elements ComplexType  
PaymentSettlementStatus A wrapper/parent object for all the sub-elements such as PaymentContext, TenderType, Amount, SettlementType, SettlementStatus etc. Sequence of PaymentContext, TenderType, Amount, SettlementType, SettlementStatus ComplexType  
PaymentContext Choice of PaymentContext or PaymentContextBase. The same element that was used in the request is returned in the reply. Sequence of OrderId, PaymentAccountUniqueId ComplexType  
PaymentContext/
OrderId
Yes (when PaymentContext is present) Order ID String Max 20 characters
PaymentContext/
PaymentAccountUniqueId
Yes (when PaymentContext is present) Tokenized payment account number (for example, credit card number) String Max 22 characters
PaymentContext/
PaymentAccountUniqueId/
@isToken
Yes (when PaymentContext is present) Attribute that indicates whether the payment account number is tokenized String true
PaymentContextBase Choice of PaymentContext or PaymentContextBase. The same element that was used in the request is returned in the reply. Sequence of OrderId ComplexType  
PaymentContextBase/
OrderId
Yes (when PaymentContextBase is present) Order ID String Max 20 characters
TenderType Yes Tender type identifier String 2 to 4 characters
Amount Yes Settlement amount String

Positive decimal, up to two decimal places (for example, 4.75)

Amount/
@currencyCode
Yes Attribute that indicates the type of currency used for the amount String 3-character ISO 4217 code (for example, USD, CAD, EUR). See http://en.wikipedia.org/
wiki/ISO_4217.
SettlementType Yes Type of settlement String Debit
Credit
SettlementStatus Yes

Status of settlement:

S- successful
R - rejected

String S or R
DeclineReason No Additional details related to a rejected settlement String
ClientContext No If a ClientContext value is provided in the request, the same value is provided in this element. String
StoreId Yes Store identifier String Max 100 characters

 

Copyright © 2017 Radial. All rights reserved.