Fanatics EcoSystem
  • Fanatics ID
  • Loyalty
  • Home
  • Environments
  • V1 Features
    • Lookup
    • Bulk Bonus FanCash Earn
    • Earn
    • Auth
    • Capture
    • Void
    • Refund
  • V2 Features
    • Add
Powered by GitBook
On this page
  1. V1 Features

Auth

PreviousEarnNextCapture

Last updated 4 days ago

Use this endpoint to hold FanCash to be spent for a single user. This must be followed by a FanCash Capture API call for the auth to complete the FanCash spend process.

Preconditions

  • You must know the Account Tenant FanID for the user's account, this value is a property of the ID Token returned in the SSO login process. It is possible to store and re-use this value for the user.

  • This API requires either a sever-to-server or user access auth token:

  • You can generate a server-to-server token using the

  • User access tokens are returned from the step of the SSO auth process.

Required Scopes

fancash:auth

Request

URL

/v1/{account_tenant_fanid}/auth

Path Parameters

Name
Description

account_tenant_fanid

unique identifier representing the user in a non-Fanatics system as a proxy for their internal fanatics id. Each vendor will have their own account_tenant_fan_id for a user. This value is a property of the ID Token returned in the SSO login process.

Headers

Name
Description

Authorization

either a user Bearer token or a server-to-server Bearer token for accessing the API

Data

Request Object

Name
Required
Description

amount

dollar amount of FanCash written as a string NOT a number. supports fractional dollar amounts up to six decimal places

currency

ISO currency code for the FanCash issuance. Only USD is supported for now. Please pass USD only.

external_reference_id

unique identifier for this transaction within the systems of the caller of the API. If you have a unique id (ideally a uuid) on your side for this transaction you should use that (order id for example). If not, It is recommended to generate and store a uuid for your own records and to add this uuid to the request in this field. Please note, we use this id for idempotency. If you send the same id more than once it will be rejected.

country_code

country of the jurisdiction in which the FanCash is being earned written as a 3-character ISO 3166 country code.

subdivision

political subdivision of the country of jurisdiction in which the FanCash is being earned written as a 2-character abbreviation. Within the United States of America, this would be the 2 character abbreviation of the particular State. For example, NY for New York.

test_transaction

indicates whether this transaction is for testing purposes only. True for a test, False if a normal non-test transaction

Response

Normal Response Data

Name
Description

external_reference_id

the external_reference_id from the request used for correlating this transaction to partner systems

auth_transaction_id

unique identifier for the FanCash auth transaction within the Fanatics system.

Error Response Data

Error Response Wrapper

Property
Description

errors

array containing error response entries

rc

randomly generated identifier allowing call tracing within Fanatics. When reporting repeated errors or coordinating issue resolution with Fanatics, this value will assist in diagnosing any issues.

timestamp

processing timestamp in Zulu time of Fanatics API server using ISO 8601 format (https://datatracker.ietf.org/doc/html/rfc3339#section-5.6). Useful for issue resolution with Fanatics as log data is partitioned by date and time.

Error Response Wrapper -> Errors -> item

Property
Description

code

Fanatics error code for the specific error; this is generally not an http status code. Code values are generally stable for the API.

message

additional textual information describing the error. This is useful in debugging, but should not be checked programmatically

Full Spec

S2S Auth API
Code Exchange
  • Preconditions
  • Required Scopes
  • Request
  • URL
  • Path Parameters
  • Headers
  • Data
  • Response
  • Normal Response Data
  • Error Response Data
  • Full Spec
  • POSTFancash Fancash Auth

Fancash Fancash Auth

post

Fancash Fancash Auth. Requires the fancash:auth permission.

Path parameters
account_tenant_fanidstring · uuidRequired

Account Tenant Fan ID

Header parameters
AuthorizationstringRequired

User or server access Bearer token

Body
amountstring · numberOptionalExample: 10.00
country_codestringOptional
currencystring · iso4217OptionalExample: USD
external_reference_idstringOptional
sub_divisionstringOptional
test_transactionbooleanOptional
Responses
200
Fancash Auth Response
application/json
400
Bad request
application/json
401
Forbidden
application/json
404
Not Found
application/json
429
Rate Limited
application/json
500
Internal error
application/json
post
POST /v1/{account_tenant_fanid}/auth HTTP/1.1
Host: 
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 134

{
  "amount": "10.00",
  "country_code": "text",
  "currency": "USD",
  "external_reference_id": "text",
  "sub_division": "text",
  "test_transaction": true
}
{
  "auth_transaction_id": "e5e8d7f0-ecc4-11ec-8f48-fb35300e50dd",
  "external_reference_id": "text"
}