This binding defines a RESTful API over HTTPS for the Transfer Process Protocol.
- The
<base>notation indicates the base URL for a [=Connector=] endpoint. For example, if the scheme ishttpsand the full hostname isconnector.example.com, the URL<base>/transfers/requestwill map tohttps://connector.example.com/transfers/request. - All request and response messages MUST use the
application/jsonmedia type. Derived media types, e.g.,application/ld+jsonMAY be exposed in addition.
In the event of a client request error, the [=Connector=] MUST return an appropriate HTTP 4xx client error code. If an error body is returned it MUST be a Transfer Error.
If a client or [=Provider=] makes a request that results in an invalid [=Transfer Process=] state transition as defined by the [=Transfer Process Protocol=], it MUST return an HTTP code 400 (Bad Request) with a Transfer Error in the response body.
If the [=Transfer Process=] does not exist, the [=Consumer=] or [=Provider=] MUST return an HTTP 404 (Not Found) response.
If the client is not authorized, the [=Consumer=] or [=Provider=] MUST return an HTTP 404 (Not Found) response.
| Endpoint | Method | Path |
|---|---|---|
| [[[#transfers-get]]] | GET |
/transfers/:providerPid |
| [[[#transfers-request-post]]] | POST |
/transfers/request |
| [[[#transfers-providerpid-start-post]]] | POST |
/transfers/:providerPid/start |
| [[[#transfers-providerpid-completion-post]]] | POST |
/transfers/:providerPid/completion |
| [[[#transfers-providerpid-termination-post]]] | POST |
/transfers/:providerPid/termination |
| [[[#transfers-providerpid-suspension-post]]] | POST |
/transfers/:providerPid/suspension |
Request
A [=Contract Negotiation=] can be accessed by a [=Consumer=] or [=Provider=] sending a GET request to transfers/:providerPid:
GET https://provider.com/transfers/:providerPid Authorization: ...
Response
If the [=Transfer Process=] is found and the client is authorized, the [=Provider=] MUST return an HTTP 200 (OK) response and a body containing the Transfer Process:
GET https://provider.com/transfers/:providerPid Authorization: ...
Predefined states are: REQUESTED, STARTED, SUSPENDED, REQUESTED, COMPLETED, and TERMINATED (
see [[[#transfer-process-states]]]).
Request
A [=Transfer Process=] is started and placed in the REQUESTED state when a [=Consumer=] POSTs
a Transfer Request Message to transfers/request:
POST https://provider.com/transfers/request Authorization: ...
-
The
callbackAddressproperty specifies the base endpointURLwhere the client receives messages associated with the [=Transfer Process=]. The HTTPS scheme MUST be supported. Implementations MAY optionally support other URL schemes. -
Callback messages will be sent to paths under the base URL as described by this specification. Note that [=Providers=] SHOULD properly handle the cases where a trailing
/is included with or absent from thecallbackAddresswhen resolving full URL.
Response
The [=Provider=] MUST return an HTTP 201 (Created) response with a body containing the Transfer Process:
Request
The [=Consumer=] can POST a Transfer Start Message to attempt to start a [=Transfer Process=] after it has been suspended:
POST https://provider.com/transfers/:providerPid/start Authorization: ...
Response
If the [=Transfer Process=]'s state is successfully transitioned, the [=Provider=] MUST return HTTP code 200 (OK). The response body is not specified and clients MAY process it.
Request
The [=Consumer=] can POST a Transfer Completion Message to complete a [=Transfer Process=]:
POST https://provider.com/transfers/:providerPid/completion Authorization: ...
Response
If the [=Transfer Process=]'s state is successfully transitioned, the [=Provider=] MUST return HTTP code 200 (OK). The response body is not specified and clients MAY process it.
Request
The [=Consumer=] can POST a Transfer Termination Message to terminate a [=Transfer Process=]:
POST https://provider.com/transfers/:providerPid/termination Authorization: ...
Response
If the [=Transfer Process=]'s state is successfully transitioned, the [=Provider=] MUST return HTTP code 200 (OK). The response body is not specified and clients MAY process it.
Request
The [=Consumer=] can POST a Transfer Suspension Message to suspend a [=Transfer Process=]:
POST https://provider.com/transfers/:providerPid/suspension Authorization: ...
Response
If the [=Transfer Process=]'s state is successfully transitioned, the [=Provider=] MUST return HTTP code 200 (OK). The response body is not specified and clients MAY process it.
| Endpoint | Method | Path |
|---|---|---|
| [[[#transfers-consumerpid-start-post]]] | POST |
/:callback/transfers/:consumerPid/start |
| [[[#transfers-consumerpid-completion-post]]] | POST |
/:callback/transfers/:consumerPid/completion |
| [[[#transfers-consumerpid-termination-post]]] | POST |
/:callback/transfers/:consumerPid/termination |
| [[[#transfers-consumerpid-suspension-post]]] | POST |
/:callback/transfers/:consumerPid/suspension |
All callback paths are relative to the callbackAddress base URL specified in
the Transfer Request Message that initiated a [=Transfer Process=]. For
example, if the callbackAddress is specified as https://consumer.com/:callback and a callback path binding
is transfers/:consumerPid/start, the resolved URL will
be https://consumer.com/:callback/transfers/:consumerPid/start.
The :callback MAY be chosen freely by the implementations.
Request
The [=Provider=] can POST a Transfer Start Message to indicate the start of a [=Transfer Process=]:
POST https://consumer.com/:callback/transfers/:consumerPid/start Authorization: ...
Response
If the [=Transfer Process=]'s state is successfully transitioned, the [=Consumer=] MUST return HTTP code 200 (OK). The response body is not specified and clients MAY process it.
Request
The [=Provider=] can POST a Transfer Completion Message to complete a [=Transfer Process=]:
POST https://consumer.com/:callback/transfers/:consumerPid/completion Authorization: ...
Response
If the [=Transfer Process=]'s state is successfully transitioned, the [=Consumer=] MUST return HTTP code 200 (OK). The response body is not specified and clients MAY process it.
Request
The [=Provider=] can POST a Transfer Termination Message to terminate a [=Transfer Process=]:
POST https://consumer.com/:callback/transfers/:consumerPid/termination Authorization: ...
Response
If the [=Transfer Process=]'s state is successfully transitioned, the [=Consumer=] MUST return HTTP code 200 (OK). The response body is not specified and clients MAY process it.
Request
The [=Provider=] can POST a Transfer Suspension Message to suspend a [=Transfer Process=]:
POST https://consumer.com/:callback/transfers/:consumerPid/suspension Authorization: ...
Response
If the [=Transfer Process=]'s state is successfully transitioned, the [=Consumer=] MUST return HTTP code 200 (OK). The response body is not specified and clients MAY process it.