openapi: 3.2.0 info: title: Gr4vy Digital Wallets API version: 1.1.0-beta contact: name: Gr4vy Support email: code@gr4vy.com url: https://gr4vy.com termsOfService: https://gr4vy.com license: name: MIT url: https://raw.githubusercontent.com/gr4vy/gr4vy-openapi/main/LICENSE description: 'Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change.' servers: - url: https://api.sandbox.{id}.gr4vy.app x-speakeasy-server-id: sandbox variables: id: default: example description: The subdomain for your Gr4vy instance. - url: https://api.{id}.gr4vy.app x-speakeasy-server-id: production variables: id: default: example description: The subdomain for your Gr4vy instance. security: - bearerAuth: [] tags: - name: Digital Wallets description: 'In Gr4vy, a digital wallet represents a way for a buyer to pay using card details already stored on their device via a digital wallet service such as Apple Pay or Google Pay. The buyer will not have to fill in their card details on checkout. The digital wallets API can be used to: * Register with a digital wallet provider. * List digital wallets currently registered.' paths: /digital-wallets: post: operationId: new-digital-wallet summary: Register digital wallet description: Register with a digital wallet provider. tags: - Digital Wallets requestBody: content: application/json: schema: $ref: '#/components/schemas/DigitalWalletRequest' responses: '201': description: Returns the newly registered digital wallet. content: application/json: schema: $ref: '#/components/schemas/DigitalWallet' '400': description: Returns an error if the request was badly formatted or missing required fields. content: application/json: schema: $ref: '#/components/schemas/Error400BadRequest' '401': description: Returns an error if no valid authentication was provided. content: application/json: schema: $ref: '#/components/schemas/Error401Unauthorized' '409': description: Returns an error if duplicate resource has been found. content: application/json: schema: $ref: '#/components/schemas/Error409DuplicateRecord' get: operationId: list-digital-wallets summary: List digital wallets description: Returns a list of all registered digital wallets. tags: - Digital Wallets responses: '200': description: Returns a list of registered digital wallets. content: application/json: schema: $ref: '#/components/schemas/DigitalWallets' '401': description: Returns an error if no valid authentication was provided. content: application/json: schema: $ref: '#/components/schemas/Error401Unauthorized' /digital-wallets/{digital_wallet_id}: parameters: - schema: type: string example: fe26475d-ec3e-4884-9553-f7356683f7f9 name: digital_wallet_id in: path required: true description: The ID of the registered digital wallet. get: operationId: get-digital-wallet summary: Get digital wallet description: Returns a registered digital wallet. tags: - Digital Wallets responses: '200': description: Returns a registered digital wallet. content: application/json: schema: $ref: '#/components/schemas/DigitalWallet' '401': description: Returns an error if no valid authentication was provided. content: application/json: schema: $ref: '#/components/schemas/Error401Unauthorized' '404': description: Returns an error if the resource can not be found. content: application/json: schema: $ref: '#/components/schemas/Error404NotFound' put: operationId: update-digital-wallet summary: Update digital wallet description: Updates the values a digital wallet was registered with. tags: - Digital Wallets requestBody: content: application/json: schema: $ref: '#/components/schemas/DigitalWalletUpdate' responses: '200': description: Returns the updated digital wallet. content: application/json: schema: $ref: '#/components/schemas/DigitalWallet' '400': description: Returns an error if the request was badly formatted or missing required fields. content: application/json: schema: $ref: '#/components/schemas/Error400BadRequest' '401': description: Returns an error if no valid authentication was provided. content: application/json: schema: $ref: '#/components/schemas/Error401Unauthorized' '404': description: Returns an error if the resource can not be found. content: application/json: schema: $ref: '#/components/schemas/Error404NotFound' delete: operationId: delete-digital-wallet summary: De-register digital wallet description: 'De-registers a digital wallet with a provider. Upon successful de-registration, the digital wallet''s record is deleted and will no longer be available. A digital wallet of the Apple provider may only be de-registered if there are no active Apple Pay certificates. When there are only incomplete or expired Apple Pay certificates, these certificates are deleted alongside the Apple digital wallet''s record.' tags: - Digital Wallets responses: '204': description: Returns an empty response. '401': description: Returns an error if no valid authentication was provided. content: application/json: schema: $ref: '#/components/schemas/Error401Unauthorized' '404': description: Returns an error if the resource can not be found. content: application/json: schema: $ref: '#/components/schemas/Error404NotFound' /digital-wallets/{digital_wallet_id}/domains: parameters: - schema: type: string example: fe26475d-ec3e-4884-9553-f7356683f7f9 name: digital_wallet_id in: path required: true description: The ID of the registered digital wallet. post: operationId: add-digital-wallet-domain-name summary: Add digital wallet domain name description: Adds new domain for given digital wallet. tags: - Digital Wallets requestBody: content: application/json: schema: $ref: '#/components/schemas/DigitalWalletDomain' responses: '204': description: Returns an empty response. '400': description: Returns an error if the request was badly formatted or missing required fields. content: application/json: schema: $ref: '#/components/schemas/Error400BadRequest' '401': description: Returns an error if no valid authentication was provided. content: application/json: schema: $ref: '#/components/schemas/Error401Unauthorized' '404': description: Returns an error if the resource can not be found. content: application/json: schema: $ref: '#/components/schemas/Error404NotFound' delete: operationId: delete-digital-wallet-domain-name summary: Remove digital wallet domain name description: Removes domain for given digital wallet. tags: - Digital Wallets requestBody: content: application/json: schema: $ref: '#/components/schemas/DigitalWalletDomain' responses: '204': description: Returns an empty response. '400': description: Returns an error if the request was badly formatted or missing required fields. content: application/json: schema: $ref: '#/components/schemas/Error400BadRequest' '401': description: Returns an error if no valid authentication was provided. content: application/json: schema: $ref: '#/components/schemas/Error401Unauthorized' '404': description: Returns an error if the resource can not be found. content: application/json: schema: $ref: '#/components/schemas/Error404NotFound' /digital-wallets/apple/session: post: operationId: new-apple-pay-session summary: New Apple Pay session description: 'Initiates a new session with Apple Pay. This can be used when implementing Apple Pay without our SDK. This endpoint returns an opaque object that can be directly passed to the Apple Pay SDK. The format of this object may change when the format returned by the Apple Pay API changes.' tags: - Digital Wallets x-internal: true requestBody: content: application/json: schema: $ref: '#/components/schemas/ApplePaySessionRequest' responses: '200': description: Returns an opaque Apple Pay session object. content: application/json: schema: $ref: '#/components/schemas/ApplePaySession' examples: Apple Pay session: value: status: '200' statusMessage: epochTimestamp: 1683210471377 expiresAt: 1683214071377 merchantSessionIdentifier: SSH5F16FF313BC246698E095440F39D9BAE_7E0DD8CB4E6B9B9FB4C5E36B3EDF9FB0DEA51F9419420173 nonce: 500a2a26 merchantIdentifier: A77873CD368A460BD5D3325AD76B01C16CFFF654F9A993F4B6A9B4098 domainName: applepaydemo.apple.com displayName: Apple Pay Demo signature: 308006092a864886f70d010702a0803080020101310d348016503040201308006092a864886f70d0107010000a080308203e330820388a00302010202084c304149519d5436300a06082a8648ce3d040302307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553301e170d3139303531383031333235375a170d3234303531363031333235375a305f3125302306035504030c1c6563632d736d702d62726f6b65722d7369676e5f5543342d50524f4431143012060355040b0c0b694f532053797374656d7331133011060355040a0c0a4170706c6520496e632e310b30090603550406130255533059301306072a8648ce3d020106082a8648ce3d03010703420004c21577edebd6c7b2218f68dd7090a1218dc7b0bd6f2c283d846095d94af4a5411b83420ed811f3407e83331f1c54c3f7eb3220d6bad5d4eff49289893e7c0f13a38202113082020d300c0603551d130101ff04023000301f0603551d2304183016801423f249c44f93e4ef27e6c4f6286c3fa2bbfd2e4b304506082b0601050507010104393037303506082b060105050730018629687474703a2f2f6f6373702e6170706c652e636f6d2f6f63737030342d6170706c65616963613330323082011d0603551d2004820114308201103082010c06092a864886f7636405013081fe3081c306082b060105050702023081b60c81b352656c69616e6365206f6e207468697320636572746966696361746520627920616e7920706172747920617373756d657320616363657074616e6365206f6620746865207468656e206170706c696361626c65207374616e64617264207465726d7320616e6420636f6e646974696f6e73206f66207573652c20636572746966696361746520706f6c69637920616e642063657274696669636174696f6e2070726163746963652073746174656d656e74732e303606082b06010505070201162a687474703a2f2f7777772e6170706c652e636f6d2f6365727469666963617465617574686f726974792f30340603551d1f042d302b3029a027a0258623687474703a2f2f63726c2e6170706c652e636f6d2f6170706c6561696361332e63726c301d0603551d0e041604149457db6fd57481868989762f7e578507e79b5824300e0603551d0f0101ff040403020780300f06092a864886f76364061d04020500300a06082a8648ce3d0403020349003046022100be09571fe71e1e735b55e5afacb4c72feb445f30185222c7251002b61ebd6f55022100d18b350a5dd6dd6eb1746035b11eb2ce87cfa3e6af6cbd8380890dc82cddaa63308202ee30820275a0030201020208496d2fbf3a98da97300a06082a8648ce3d0403023067311b301906035504030c124170706c6520526f6f74204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553301e170d3134303530363233343633305a170d3239303530363233343633305a307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b30090603550406130255533059301306072a8648ce3d020106082a8648ce3d03010703420004f017118419d76485d51a5e25810776e880a2efde7bae4de08dfc4b93e13356d5665b35ae22d097760d224e7bba08fd7617ce88cb76bb6670bec8e82984ff5445a381f73081f4304606082b06010505070101043a3038303606082b06010505073001862a687474703a2f2f6f6373702e6170706c652e636f6d2f6f63737030342d6170706c65726f6f7463616733301d0603551d0e0416041423f249c44f93e4ef27e6c4f6286c3fa2bbfd2e4b300f0603551d130101ff040530030101ff301f0603551d23041830168014bbb0dea15833889aa48a99debebdebafdacb24ab30370603551d1f0430302e302ca02aa0288626687474703a2f2f63726c2e6170706c652e636f6d2f6170706c65726f6f74636167332e63726c300e0603551d0f0101ff0404030201063010060a2a864886f7636406020e04020500300a06082a8648ce3d040302036700306402303acf7283511699b186fb35c356ca62bff417edd90f754da28ebef19c815e42b789f898f79b599f98d5410d8f9de9c2fe0230322dd54421b0a305776c5df3383b9067fd177c2c216d964fc6726982126f54f87a7d1b99cb9b0989216106990f09921d00003182018830820184020101308186307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b300906035504061302555302084c304149519d5436300b0609608648016503040201a08193301806092a864886f70d010903310b06092a864886f70d010701301c06092a864886f70d010905310f170d3233303530343134323735315a302806092a864886f70d010934311b3019300b0609608648016503040201a10a06082a8648ce3d040302302f06092a864886f70d0109043122042004eaf499fad08381253991505170637816c33797a14caa950ba44eac67a8fe7b300a06082a8648ce3d04030204473045022100fd2af84afe4acadfb7f1ac2bd2ff9c6b4f32bf64a86401b4adbdbd7b750689a0022016cda7918941782c14b60150a40dc88f73b89471df83921d4c98e8de14ada7be000000000000 operationalAnalyticsIdentifier: Apple Pay Demo:A77873CD368A460BD01C16BB7F838CFFF654F9A993F4B6A9B4098 retries: 0 pspId: A77873CD368A460BD5D3321C16BB7F838CFFF654F9A993F4B6A9B4098 statusCode: 200 '400': description: Returns an error if the request was badly formatted or missing required fields. content: application/json: schema: $ref: '#/components/schemas/Error400BadRequest' '401': description: Returns an error if no valid authentication was provided. content: application/json: schema: $ref: '#/components/schemas/Error401Unauthorized' '404': description: Returns an error if no active Apple Pay service can be found. content: application/json: schema: $ref: '#/components/schemas/Error404NotFound' /digital-wallets/click-to-pay/session: post: operationId: new-click-to-pay-session summary: New Click to Pay session description: Returns digital payment application ID & name for use with Click to Pay. tags: - Digital Wallets x-internal: true requestBody: content: application/json: schema: $ref: '#/components/schemas/ClickToPaySessionRequest' responses: '200': description: Returns Click to Pay session object. content: application/json: schema: $ref: '#/components/schemas/ClickToPaySession' examples: Click to Pay session: value: digital_payment_application_id: DPA ID digital_payment_application_name: DPA name '400': description: Returns an error if the request was badly formatted or missing required fields. content: application/json: schema: $ref: '#/components/schemas/Error400BadRequest' '401': description: Returns an error if no valid authentication was provided. content: application/json: schema: $ref: '#/components/schemas/Error401Unauthorized' '404': description: Returns an error if no active Click to Pay service can be found. content: application/json: schema: $ref: '#/components/schemas/Error404NotFound' /digital-wallets/google/session: post: operationId: new-google-pay-session summary: New Google Pay session description: 'Initiates a new session with Google Pay. This can be used when implementing Google Pay without our SDK.' tags: - Digital Wallets x-internal: true requestBody: content: application/json: schema: $ref: '#/components/schemas/GooglePaySessionRequest' responses: '200': description: Returns a JWT used for Google Pay authentication. content: application/json: schema: $ref: '#/components/schemas/GooglePaySession' '400': description: Returns an error if the request was badly formatted or missing required fields. content: application/json: schema: $ref: '#/components/schemas/Error400BadRequest' '401': description: Returns an error if no valid authentication was provided. content: application/json: schema: $ref: '#/components/schemas/Error401Unauthorized' '404': description: Returns an error if no active Google Pay service can be found. content: application/json: schema: $ref: '#/components/schemas/Error404NotFound' components: schemas: GooglePaySessionRequest: title: Google Pay session request type: object description: Initiates a new session with Google Pay. x-tags: - Request Bodies required: - origin_domain properties: origin_domain: type: string description: Fully qualified domain name of the merchant. DigitalWalletUpdate: title: Digital Wallet (Update) type: object description: Request body to update a registered digital wallet's details. x-tags: - Request Bodies properties: merchant_name: type: string description: 'The name of the merchant. This is used to update the value initially used to register with a digital wallet provider and this name is not displayed to the buyer.' example: Gr4vy domain_names: type: array minItems: 1 maxItems: 99 items: type: string example: - example.com description: 'The list of domain names that a digital wallet can be used on. To use a digital wallet on a website, the domain of the site is required to be in this list.' merchant_display_name: type: - string - 'null' example: Gr4vy description: The consumer facing name of the merchant. merchant_country_code: type: - string - 'null' example: US description: The country code where the merchant is registered. maxLength: 2 minLength: 2 merchant_url: type: string example: https://example.com description: The main URL of the merchant. DigitalWallet: title: Digital Wallet type: object description: A digital wallet (e.g. Apple Pay) that has been registered. x-tags: - Digital Wallets properties: type: type: string example: digital-wallet description: '`digital-wallet`.' enum: - digital-wallet id: type: string example: 8d3fe99b-1422-42e6-bbb3-932d95ae5f79 description: The ID of the registered digital wallet. format: uuid merchant_account_id: type: string description: The unique ID for a merchant account. example: default provider: type: string example: apple description: The name of the digital wallet provider. enum: - apple - google merchant_name: type: string example: Gr4vy description: The name of the merchant the digital wallet is registered to. merchant_url: type: - string - 'null' example: https://example.com description: The main URL of the merchant. default: null format: url merchant_display_name: type: - string - 'null' example: Gr4vy description: The consumer facing name of the merchant. merchant_country_code: type: - string - 'null' example: US description: The country code where the merchant is registered. maxLength: 2 minLength: 2 domain_names: type: array minItems: 1 maxItems: 99 items: type: string example: - example.com description: 'The list of domain names that a digital wallet can be used on. To use a digital wallet on a website, the domain of the site is required to be in this list.' fields: description: 'Custom attributes for some digital wallets. Currently only used by Click to Pay.' $ref: '#/components/schemas/DigitalWalletClickToPayFields' created_at: type: string format: date-time example: '2012-12-12T10:53:43+00:00' description: The date and time when this digital wallet was registered. updated_at: type: string format: date-time example: '2012-12-12T10:53:43+00:00' description: The date and time when this digital wallet was last updated. active_certificate_count: type: integer example: 1 description: The number of active custom certificates registered for this digital wallet (Apple Pay only). pending_certificate_count: type: integer example: 1 description: The number of pending custom certificates registered for this digital wallet (Apple Pay only). expired_certificate_count: type: integer example: 1 description: The number of expired custom certificates registered for this digital wallet (Apple Pay only). DigitalWalletDomain: title: Digital Wallet Domain type: object description: Domain name for a digital wallet. x-tags: - Request Bodies required: - domain_name properties: domain_name: type: string example: example.com description: 'The domain name that a digital wallet can be used on. To use a digital wallet on a website, the domain of the site is required to be in this list.' Error404NotFound: title: Not Found Error type: object description: Not Found Error (HTTP 404). x-tags: - Errors properties: type: type: string description: '`error`.' enum: - error example: error code: type: string description: The reason code for the error. example: not_found enum: - not_found - pending_creation status: type: integer description: '`404`.' example: 404 enum: - 404 message: type: string description: The human readable reason for the error. example: The resource could not be found details: type: array description: 'A list of detail objects that further clarify the reason for the error. Not every error supports more detail.' example: [] items: $ref: '#/components/schemas/ErrorDetail' GooglePaySession: title: Google Pay Session type: object x-internal: true properties: gateway_merchant_id: type: string description: Your merchant ID. example: app.gr4vy.sandbox.spider.default token: type: string description: The JWT for the current Google Pay session. example: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElkIjoiQkNSMkRONFQ3QzNLWDZEWSIsIm1lcmNoYW50T3JpZ2luIjoiZW1iZWQuc2FuZGJveC5zcGlkZXIuZ3I0dnkuYXBwIiwiaWF0IjoxNjgzMjExMzk5fQ.Qk99p_j96aSxGmxUyyb06rNxIY7nh9-BvHJGWBrLBSFb3HkSbYRgq9YQzscWJtLHVvIJifkzSc8BgtllfAzh9A ClickToPaySessionRequest: title: Click to Pay session request type: object description: Return digital payment application details for Click to Pay. x-tags: - Request Bodies required: - checkout_session_id properties: checkout_session_id: type: string example: fe26475d-ec3e-4884-9553-f7356683f7f9 description: The identifier for the current checkout session. format: uuid ErrorDetail: title: Error details description: Additional detail about the part of a request body that caused an issue. type: object x-tags: - Errors properties: location: type: string example: body description: The location where the error caused an issue. enum: - query - body - path - header type: type: string example: value_error.missing description: A unique identifier for the type of error that occurred. pointer: type: string example: /payment_method/number description: 'The exact item for which the validation did not succeed. This is a JSON pointer for request bodies, while for query, path, and header parameters it is the name of the parameter.' message: type: string example: field required description: A human readable message for this error detail. ClickToPaySession: title: Click to Pay Session type: object x-internal: true properties: digital_payment_application_id: type: string description: The ID of the Digital Payment Application for Click to Pay. example: a0b093e4-028a-4310-93fb-4ed0afc813fb digital_payment_application_name: type: string description: The name of the Digital Payment Application for Click to Pay. example: Plantly T4JUU1 ApplePaySessionRequest: title: Apple Pay session request type: object description: Initiates a new session with Apple Pay. x-tags: - Request Bodies required: - validation_url - domain_name properties: validation_url: type: string format: uri description: 'Validation URL obtained from the event passed to a `onvalidatemerchant` callback.' domain_name: type: string description: Fully qualified domain name of the merchant. Error409DuplicateRecord: title: Duplicate Record Error type: object description: Duplicate Record Error (HTTP 409). x-tags: - Errors properties: type: type: string description: '`error`.' enum: - error example: error code: type: string description: '`duplicate_record`.' example: duplicate_record enum: - duplicate_record status: type: integer description: '`409`.' example: 409 enum: - 409 message: type: string description: Further details on the field that triggered the error. example: A duplicate record exists with this external_identifier value details: type: array description: 'A list of detail objects that further clarify the reason for the error. Not every error supports more detail.' example: [] items: $ref: '#/components/schemas/ErrorDetail' Error401Unauthorized: title: Unauthorized Error type: object description: Unauthorized Error (HTTP 401). x-tags: - Errors properties: type: type: string description: '`error`.' enum: - error example: error code: type: string description: '`unauthorized`.' example: unauthorized enum: - unauthorized status: type: integer description: '`401`.' example: 401 enum: - 401 message: type: string description: No valid API authentication found. example: No valid API authentication found enum: - No valid API authentication found details: type: array description: 'A list of detail objects that further clarify the reason for the error. Not every error supports more detail.' example: [] items: $ref: '#/components/schemas/ErrorDetail' ApplePaySession: title: Apple Pay Session type: object x-internal: true additionalProperties: true DigitalWallets: title: Digital Wallets type: object description: A list of registered digital wallets. x-tags: - Digital Wallets properties: items: type: array description: A list of registered digital wallets. items: $ref: '#/components/schemas/DigitalWallet' DigitalWalletRequest: title: Digital Wallet (Register) type: object description: Merchant details used to register with a digital wallet provider. x-tags: - Request Bodies required: - provider - merchant_name - domain_names - accept_terms_and_conditions properties: provider: type: string example: apple description: The name of the digital wallet provider. enum: - apple - google merchant_name: type: string description: 'The name of the merchant. This is used to register the merchant with a digital wallet provider and this name is not displayed to the buyer.' example: Gr4vy merchant_url: type: - string - 'null' example: https://example.com default: null description: The main URL of the merchant. format: url merchant_display_name: type: - string - 'null' example: Gr4vy description: The consumer facing name of the merchant. merchant_country_code: type: - string - 'null' example: US description: The country code where the merchant is registered. maxLength: 2 minLength: 2 domain_names: type: array minItems: 1 maxItems: 99 items: type: string example: - example.com description: 'The list of domain names that a digital wallet can be used on. To use a digital wallet on a website, the domain of the site is required to be in this list.' accept_terms_and_conditions: type: boolean description: 'The explicit acceptance of the digital wallet provider''s terms and conditions by the merchant. Needs to be `true` to register a new digital wallet.' example: true Error400BadRequest: title: Bad Request type: object description: Bad Request (HTTP 400). x-tags: - Errors properties: type: type: string description: '`error`.' enum: - error example: error code: type: string description: A short code that describes the reason for the error. example: bad_request enum: - bad_request - incorrect_json - invalid_credentials status: type: integer description: '`400`.' example: 400 enum: - 400 message: type: string description: A human-readable reason for the error. example: Missing '****' field details: type: array description: A list of detail objects that further clarify the reason for the error. items: $ref: '#/components/schemas/ErrorDetail' DigitalWalletClickToPayFields: title: Click to Pay type: object x-tags: - Request Bodies properties: digital_payment_application_id: type: string description: Unique ID assigned for digital payment application. digital_payment_application_name: type: string description: Name assigned for digital payment application. securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT