Viviot.Api

<back to all web services

PaymentMethodsRequest

Requires Authentication
The following routes are available for this service:
POST/mobile/payments/getAvailablePaymentMethodsValidates the payment data and returns all available payment methods from integrated payment provider.
PaymentMethodsRequest Parameters:
NameParameterData TypeRequiredDescription
ServiceIdquerystringYesService Id (GUID).
ProductDatabodyDictionary<Guid, Guid>YesList of product Ids along with access template Ids
AddonIdsbodyList<Guid>NoList of selected addon Ids
TotalPricequeryintegerYesTotal price of the service.
SelectedOptionsbodySelectedOptionsDtoYesSelected options of the reservation/request service
ClientTypequeryClientTypeYesType of client initiating the payment methods request.

Allowable Values

  • IOS
  • Android
  • Web
BaseRequest Parameters:
NameParameterData TypeRequiredDescription
VersionformintegerNoApi version
SelectedOptionsDto Parameters:
NameParameterData TypeRequiredDescription
TimeslotformTimeslotDtoNo
PersonformPersonOptionDtoNo
CurrencyCodeformstringNo
TimeslotDto Parameters:
NameParameterData TypeRequiredDescription
FromformDateTime?No
ToformDateTime?No
PersonOptionDto Parameters:
NameParameterData TypeRequiredDescription
NumberOfAdultsformintNo
NumberOfChildrenformint?No
ClientType Enum:
NameValue
IOS1
Android2
Web3
PaymentMethodsResponse Parameters:
NameParameterData TypeRequiredDescription
DataformPaymentMethodsViewNo
BaseResponse Parameters:
NameParameterData TypeRequiredDescription
ResponseStatusformResponseStatusNo
PaymentMethodsView Parameters:
NameParameterData TypeRequiredDescription
PaymentMethodsformstringNo
PaymentIdformGuidNo
PriceformlongNo
CurrencyformCurrencyDtoNo
CurrencyDto Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
NameformstringNo
CodeformstringNo
SymbolformstringNo

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /mobile/payments/getAvailablePaymentMethods HTTP/1.1 
Host: api.4spaces.io 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<PaymentMethodsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Viviot.Api.ServiceModel.Api.Mobile">
  <Version xmlns="http://schemas.datacontract.org/2004/07/Viviot.Api.ServiceModel.Api.Base">0</Version>
  <AddonIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
  </AddonIds>
  <ClientType>IOS</ClientType>
  <ProductData xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfguidguid>
      <d2p1:Key>00000000-0000-0000-0000-000000000000</d2p1:Key>
      <d2p1:Value>00000000-0000-0000-0000-000000000000</d2p1:Value>
    </d2p1:KeyValueOfguidguid>
  </ProductData>
  <SelectedOptions xmlns:d2p1="http://schemas.datacontract.org/2004/07/Viviot.Infrastructure.Dto.Service.Mobile">
    <d2p1:CurrencyCode>String</d2p1:CurrencyCode>
    <d2p1:Person>
      <d2p1:NumberOfAdults>0</d2p1:NumberOfAdults>
      <d2p1:NumberOfChildren>0</d2p1:NumberOfChildren>
    </d2p1:Person>
    <d2p1:Timeslot xmlns:d3p1="http://schemas.datacontract.org/2004/07/Viviot.Infrastructure.Dto.Service">
      <d3p1:From>0001-01-01T00:00:00</d3p1:From>
      <d3p1:To>0001-01-01T00:00:00</d3p1:To>
    </d2p1:Timeslot>
  </SelectedOptions>
  <ServiceId>00000000-0000-0000-0000-000000000000</ServiceId>
  <TotalPrice>0</TotalPrice>
</PaymentMethodsRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PaymentMethodsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Viviot.Api.ServiceModel.Api.Mobile">
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types" xmlns="http://schemas.datacontract.org/2004/07/Viviot.Api.ServiceModel.Api.Base">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Data xmlns:d2p1="http://schemas.datacontract.org/2004/07/Viviot.Api.ServiceModel.Views.Mobile.Payment">
    <d2p1:Currency xmlns:d3p1="http://schemas.datacontract.org/2004/07/Integrations.Payment.Responses">
      <d3p1:Code>String</d3p1:Code>
      <d3p1:Id>00000000-0000-0000-0000-000000000000</d3p1:Id>
      <d3p1:Name>String</d3p1:Name>
      <d3p1:Symbol>String</d3p1:Symbol>
    </d2p1:Currency>
    <d2p1:PaymentId>00000000-0000-0000-0000-000000000000</d2p1:PaymentId>
    <d2p1:PaymentMethods>String</d2p1:PaymentMethods>
    <d2p1:Price>0</d2p1:Price>
  </Data>
</PaymentMethodsResponse>